[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YbETxcwa83U8WXTO@sirena.org.uk>
Date: Wed, 8 Dec 2021 20:21:25 +0000
From: Mark Brown <broonie@...nel.org>
To: Ajit Kumar Pandey <AjitKumar.Pandey@....com>
Cc: alsa-devel@...a-project.org, Vijendar.Mukunda@....com,
Alexander.Deucher@....com, Basavaraj.Hiregoudar@....com,
Sunil-kumar.Dommati@....com, Liam Girdwood <lgirdwood@...il.com>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ASoC: max98357a: Add mixer control to mute/unmute speaker
On Thu, Dec 09, 2021 at 12:28:49AM +0530, Ajit Kumar Pandey wrote:
> +static int speaker_mute_put(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
> + struct max98357a_priv *max98357a = snd_soc_component_get_drvdata(component);
> + int mode = ucontrol->value.enumerated.item[0];
> +
> + max98357a->sdmode_switch = mode;
> + gpiod_set_value_cansleep(max98357a->sdmode, mode);
> + dev_dbg(component->dev, "set sdmode to %d", mode);
This looks like it should just be a DAPM widget - it's just a generic
GPIO control, there's no connection with the CODEC that I can see so it
definitely shouldn't be in the CODEC driver. Often trivial stuff like
this is done in the machine driver, though the simple-amplifier driver
is probably a good fit here.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists