[PATCH 2/3] ASoC: tlv320aic32x4: add support for TAS2505

Mark Brown broonie at kernel.org
Tue Jun 15 14:22:41 CEST 2021


On Tue, Jun 15, 2021 at 11:49:31AM +0200, Claudius Heine wrote:

> +static int aic32x4_tas2505_spkdrv_putvol(struct snd_kcontrol *kcontrol,
> +	struct snd_ctl_elem_value *ucontrol)
> +{
> +	struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
> +	struct soc_mixer_control *mc =
> +		(struct soc_mixer_control *)kcontrol->private_value;
> +	u8 val;
> +
> +	val = (ucontrol->value.integer.value[0] & 0x7f);
> +	val = mc->invert ? mc->max - val : val;
> +	val = (val < 0) ? 0 : val;
> +	snd_soc_component_write(component, TAS2505_SPKVOL1, val);
> +
> +	return 0;
> +}

Controls should return a boolean indicating if they changed their value
when written.  Other than the hard coded register what's device specific
here?  It looks like a normal control with a maximum value, it is
unclear why this is being open coded.

> +	SOC_DOUBLE_R_S_TLV("HP Driver Gain Playback Volume", AIC32X4_HPLGAIN,
> +			AIC32X4_HPLGAIN, 0, -0x6, 0x1d, 5, 0,
> +			tlv_driver_gain),

Drop the Gain.  See control-names.rst.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20210615/74153dc0/attachment.sig>


More information about the Alsa-devel mailing list