[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210615122241.GE5149@sirena.org.uk>
Date: Tue, 15 Jun 2021 13:22:41 +0100
From: Mark Brown <broonie@...nel.org>
To: Claudius Heine <ch@...x.de>
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 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.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists