public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
From: Jack Yu <jack.yu@realtek.com>
To: Mark Brown <broonie@kernel.org>
Cc: "lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"lars@metafoo.de" <lars@metafoo.de>,
	"Flove(HsinFu)" <flove@realtek.com>,
	"Oder Chiou" <oder_chiou@realtek.com>,
	"Shuming [范書銘]" <shumingf@realtek.com>,
	"Derek [方德義]" <derek.fang@realtek.com>
Subject: RE: [PATCH] ASoC: rt1320-sdw: kcontrol for brown-out feature switch
Date: Thu, 2 Apr 2026 04:37:53 +0000	[thread overview]
Message-ID: <9aff5474398c4ac79f18f356512b5181@realtek.com> (raw)
In-Reply-To: <e5623b92-fe3a-4c3d-a93f-a9acb1fd8181@sirena.org.uk>


> -----Original Message-----
> From: Mark Brown <broonie@kernel.org>
> Sent: Wednesday, April 1, 2026 9:23 PM
> To: Jack Yu <jack.yu@realtek.com>
> Cc: lgirdwood@gmail.com; alsa-devel@alsa-project.org; lars@metafoo.de;
> Flove(HsinFu) <flove@realtek.com>; Oder Chiou <oder_chiou@realtek.com>;
> Shuming [范書銘] <shumingf@realtek.com>; Derek [方德義]
> <derek.fang@realtek.com>
> Subject: Re: [PATCH] ASoC: rt1320-sdw: kcontrol for brown-out feature switch
> 
> On Wed, Apr 01, 2026 at 05:31:07PM +0800, jack.yu@realtek.com wrote:
> > From: Jack Yu <jack.yu@realtek.com>
> >
> > Create a kcontrol to enable or disable brown-out dynamically.
> 
> > +static const char * const rt1320_brown_out_mode[] = {
> > +	"On",
> > +	"Off",
> > +};
> > +
> > +static SOC_ENUM_SINGLE_DECL(rt1320_brown_out_enum, 0, 0,
> > +	rt1320_brown_out_mode);
> > +
> 
> On/off switches should be a Switch control, not an enum.

Maybe the name of kcontrol leads to misunderstand, it's just an effect setting for amplifier.
I'll update this and use another control type but not enum.
> 
> > +static int rt1320_brown_out_put(struct snd_kcontrol *kcontrol,
> > +				 struct snd_ctl_elem_value *ucontrol) {
> > +	struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
> > +	struct rt1320_sdw_priv *rt1320 =
> snd_soc_component_get_drvdata(component);
> > +	struct device *dev = &rt1320->sdw_slave->dev;
> > +	int ret, tmp;
> > +
> > +	ret = pm_runtime_resume(component->dev);
> > +	if (ret < 0 && ret != -EACCES)
> > +		return ret;
> 
> Other controls in this driver ignore writes before hw_init is set, should this
> one?
Will fix it.

  reply	other threads:[~2026-04-02  4:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-01  9:31 [PATCH] ASoC: rt1320-sdw: kcontrol for brown-out feature switch jack.yu
2026-04-01 13:02 ` Shuming [范書銘]
2026-04-01 13:11   ` Shuming [范書銘]
2026-04-01 13:23 ` Mark Brown
2026-04-02  4:37   ` Jack Yu [this message]
2026-04-02 11:14     ` Mark Brown
2026-04-07  3:48 ` kernel test robot

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=9aff5474398c4ac79f18f356512b5181@realtek.com \
    --to=jack.yu@realtek.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=derek.fang@realtek.com \
    --cc=flove@realtek.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --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