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

From: Mark Brown
Date: Tue Jun 15 2021 - 08:23:14 EST


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.

Attachment: signature.asc
Description: PGP signature