Re: [PATCH] ASoC: rt1320-sdw: kcontrol for brown-out feature switch

Mark Brown
2026-04-01T13:24:10Z

[-- Attachment #1: Type: text/plain, Size: 964 bytes --]

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.

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]