Linux Sound subsystem development
 help / color / mirror / Atom feed
From: "Shuming [范書銘]" <shumingf@realtek.com>
To: Charles Keepax <ckeepax@opensource.cirrus.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 02:30:17 +0000	[thread overview]
Message-ID: <c61adef5f21141d99b20182bac6216e6@realtek.com> (raw)
In-Reply-To: <aQteVxu1gLyzbfLs@opensource.cirrus.com>

> > +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.

> >  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


  parent reply	other threads:[~2025-11-06  2:30 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 [范書銘] [this message]
2025-11-06  9:35     ` Charles Keepax

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=c61adef5f21141d99b20182bac6216e6@realtek.com \
    --to=shumingf@realtek.com \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --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 \
    /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