[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4b72d6cd-ef07-fcdd-f90b-1cd53a3e3c8b@denx.de>
Date: Tue, 15 Jun 2021 14:39:42 +0200
From: Claudius Heine <ch@...x.de>
To: Mark Brown <broonie@...nel.org>
Cc: Liam Girdwood <lgirdwood@...il.com>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>, alsa-devel@...a-project.org,
Marek Vasut <marex@...x.de>,
Michael Sit Wei Hong <michael.wei.hong.sit@...el.com>,
Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
Sia Jee Heng <jee.heng.sia@...el.com>,
Miquel Raynal <miquel.raynal@...tlin.com>,
Annaliese McDermond <nh6z@...z.net>,
Matthias Schiffer <matthias.schiffer@...tq-group.com>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/3] ASoC: tlv320aic32x4: add support for TAS2505
On 2021-06-15 14:22, Mark Brown wrote:
> 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.
Well probably because I didn't knew any better. Will look into it. Thx!
>
>> + 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.
>
Ok.
Thanks!
Claudius
Powered by blists - more mailing lists