]> git.hungrycats.org Git - linux/commitdiff
ASoC: tas2781: Fix compiling warning for tasdevice_set_capture_profile_id()
authorShenghao Ding <shenghao-ding@ti.com>
Tue, 11 Aug 2026 12:14:46 +0000 (20:14 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 11 Aug 2026 13:40:50 +0000 (14:40 +0100)
Correct the mismatched function description, parameter names and return
value documentation in the comment block. No functional code change, only
comment and documentation update.

Fixes: 431c15610d01 ("ASoC: tas2781: add capture_profile_id field and update the tuning_switch function")
Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20260811121446.1805-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/tas2781-i2c.c

index 70229e8279a32abb432865304a3f0b4a29c064da..c029345b4644421be863f53ea1e73d475d5e0ae4 100644 (file)
@@ -1001,18 +1001,25 @@ static int tasdevice_set_profile_id(struct snd_kcontrol *kcontrol,
 }
 
 /**
- * tasdevice_get_capture_profile_id - Report current active capture profile
- * ID to user space
- * @kcontrol: ALSA kcontrol structure passed from ALSA core
- * @ucontrol: User-space control element value buffer to write the result back
+ * tasdevice_set_capture_profile_id - Set runtime capture profile index via
+ * ALSA control
+ * @kcontrol: ALSA kcontrol handle that triggers this operation
+ * @ucontrol: User space control value carrying the new profile index
  *
- * This function ensures the returned profile ID is always clamped inside the
- * valid range advertised by the info callback, preventing accidental invalid
- * values from being exposed to applications even if internal driver state is
- * temporarily inconsistent.
+ * This mixer control handler validates the user-provided capture profile ID
+ * against the maximum valid index parsed from the loaded DSP firmware,
+ * then updates the runtime stored capture profile ID only if the new value
+ * differs from the current active one. It will immediately return -EINVAL
+ * if the submitted profile ID falls outside the valid range, including the
+ * edge case that no valid configuration blocks are detected in firmware.
  *
- * Returns 0 on successful fill of the control value, no error conditions
- * are defined for this getter callback.
+ * No actual DSP register write is performed in this handler. The updated
+ * profile ID will be applied to the hardware when the next ALSA capture
+ * stream starts up. Caller does not need to take extra codec lock here,
+ * as the ALSA control core already guarantees serialized execution.
+ *
+ * Return: 1 if profile ID value was changed, 0 if no modification needed,
+ *        -EINVAL if the input profile ID is out of valid range
  */
 static int tasdevice_set_capture_profile_id(struct snd_kcontrol *kcontrol,
                struct snd_ctl_elem_value *ucontrol)