summaryrefslogtreecommitdiff
path: root/sound/soc/sof/control.c
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2022-03-29 15:00:39 +0300
committerMark Brown <broonie@kernel.org>2022-04-05 12:22:55 +0300
commit9b014266ef8ad0159b39920a752f191bcd6f356c (patch)
tree758d5be632fae0f22c4827cc481ccb44de5e1edc /sound/soc/sof/control.c
parent3123109284176b1532874591f7c81f3837bbdc17 (diff)
downloadlinux-9b014266ef8ad0159b39920a752f191bcd6f356c.tar.xz
ASoC: SOF: topology: use new sound control LED layer
Use the new sound control LED layer instead the direct ledtrig_audio_set() call - see 22d8de62f11b ("ALSA: control - add generic LED trigger module as the new control layer"). Signed-off-by: Jaroslav Kysela <perex@perex.cz> Cc: Bard Liao <yung-chuan.liao@linux.intel.com> Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20220329120039.2394138-1-perex@perex.cz Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/control.c')
-rw-r--r--sound/soc/sof/control.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/sound/soc/sof/control.c b/sound/soc/sof/control.c
index de1778c4002b..3b5718a3516d 100644
--- a/sound/soc/sof/control.c
+++ b/sound/soc/sof/control.c
@@ -15,36 +15,6 @@
#include "sof-priv.h"
#include "sof-audio.h"
-static void update_mute_led(struct snd_sof_control *scontrol,
- struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- int temp = 0;
- int mask;
- int i;
-
- mask = 1U << snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
-
- for (i = 0; i < scontrol->num_channels; i++) {
- if (ucontrol->value.integer.value[i]) {
- temp |= mask;
- break;
- }
- }
-
- if (temp == scontrol->led_ctl.led_value)
- return;
-
- scontrol->led_ctl.led_value = temp;
-
-#if IS_REACHABLE(CONFIG_LEDS_TRIGGER_AUDIO)
- if (!scontrol->led_ctl.direction)
- ledtrig_audio_set(LED_AUDIO_MUTE, temp ? LED_OFF : LED_ON);
- else
- ledtrig_audio_set(LED_AUDIO_MICMUTE, temp ? LED_OFF : LED_ON);
-#endif
-}
-
int snd_sof_volume_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
@@ -121,9 +91,6 @@ int snd_sof_switch_put(struct snd_kcontrol *kcontrol,
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
- if (scontrol->led_ctl.use_led)
- update_mute_led(scontrol, kcontrol, ucontrol);
-
if (tplg_ops->control->switch_put)
return tplg_ops->control->switch_put(scontrol, ucontrol);