From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: shumingf@realtek.com
Cc: broonie@kernel.org, lgirdwood@gmail.com,
linux-sound@vger.kernel.org, lars@metafoo.de, flove@realtek.com,
oder_chiou@realtek.com, jack.yu@realtek.com,
derek.fang@realtek.com
Subject: Re: [PATCH] ASoC: SDCA: support Q7.8 volume format
Date: Wed, 5 Nov 2025 14:25:27 +0000 [thread overview]
Message-ID: <aQteVxu1gLyzbfLs@opensource.cirrus.com> (raw)
In-Reply-To: <20251105091122.495561-1-shumingf@realtek.com>
On Wed, Nov 05, 2025 at 05:11:22PM +0800, shumingf@realtek.com wrote:
> From: Shuming Fan <shumingf@realtek.com>
>
> The SDCA specification uses Q7.8 volume format.
> This patch adds a field to indicate whether it is SDCA volume control
> and supports the volume settings.
>
> Signed-off-by: Shuming Fan <shumingf@realtek.com>
> ---
> include/sound/soc.h | 1 +
> sound/soc/sdca/sdca_asoc.c | 34 ++++++---------------
> sound/soc/soc-ops.c | 62 +++++++++++++++++++++++++++++++-------
Mark, how do you feel about putting this in soc-ops? I think I
am good with putting it here, the code is definitely a little
smaller than open coding helpers in the SDCA code. However, I
do have a slight doubt that this doesn't have great reusability
outside of SDCA.
> +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.
> 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.
Thanks,
Charles
next prev parent reply other threads:[~2025-11-05 14:25 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 [this message]
2025-11-05 14:30 ` Mark Brown
2025-11-06 2:30 ` Shuming [范書銘]
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=aQteVxu1gLyzbfLs@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