From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: "Shuming [范書銘]" <shumingf@realtek.com>
Cc: "broonie@kernel.org" <broonie@kernel.org>,
"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
"linux-sound@vger.kernel.org" <linux-sound@vger.kernel.org>,
"lars@metafoo.de" <lars@metafoo.de>,
"Flove(HsinFu)" <flove@realtek.com>,
"Oder Chiou" <oder_chiou@realtek.com>,
"Jack Yu" <jack.yu@realtek.com>,
"Derek [方德義]" <derek.fang@realtek.com>
Subject: Re: [PATCH] ASoC: SDCA: support Q7.8 volume format
Date: Thu, 6 Nov 2025 09:35:24 +0000 [thread overview]
Message-ID: <aQxr3E3BxwjdFgQV@opensource.cirrus.com> (raw)
In-Reply-To: <c61adef5f21141d99b20182bac6216e6@realtek.com>
On Thu, Nov 06, 2025 at 02:30:17AM +0000, Shuming [范書銘] wrote:
> > > +static int sdca_soc_q78_reg_to_ctl(struct soc_mixer_control *mc, unsigned
> > int reg_val,
> > > + unsigned int mask, unsigned int shift,
> > > +int max) {
> > > + int val = reg_val;
> > > +
> > > + if (WARN_ON(!mc->shift))
> >
> > We should use the function argument for shift in these functions.
>
> It is intentional to do this.
> The patch only uses the 'shift' field to store the step value and the 'rshift' field remains zero.
> Therefore, we could reuse the function 'soc_put_volsw' and generate the correct result for stereo volume.
Ah ok that does make sense, perhaps a comment for this would be
good.
> > > static int soc_mixer_reg_to_ctl(struct soc_mixer_control *mc, unsigned int
> > reg_val,
> > > unsigned int mask, unsigned int shift,
> > > int max) { @@ -202,14 +232,22 @@ static int soc_put_volsw(struct
> > > snd_kcontrol *kcontrol,
> > > unsigned int val2 = 0;
> > > bool double_r = false;
> > > int ret;
> > > + unsigned int (*ctl_to_reg)(struct soc_mixer_control *, int,
> > > + unsigned int, unsigned int, int);
> >
> > Would be nice to put this at the top of the variable list, given the length.
>
> Will fix
Thanks,
Charles
prev parent reply other threads:[~2025-11-06 9:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-05 9:11 [PATCH] ASoC: SDCA: support Q7.8 volume format shumingf
2025-11-05 14:25 ` Charles Keepax
2025-11-05 14:30 ` Mark Brown
2025-11-06 2:30 ` Shuming [范書銘]
2025-11-06 9:35 ` Charles Keepax [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aQxr3E3BxwjdFgQV@opensource.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=broonie@kernel.org \
--cc=derek.fang@realtek.com \
--cc=flove@realtek.com \
--cc=jack.yu@realtek.com \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=linux-sound@vger.kernel.org \
--cc=oder_chiou@realtek.com \
--cc=shumingf@realtek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox