]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - sound/soc/jz4740/qi_lb60.c
ASoC: JZ4740: qi_lb60: Use the SND_SOC_DAPM_EVENT_OFF for the speakers status
[karo-tx-linux.git] / sound / soc / jz4740 / qi_lb60.c
index 8c4e84bcc32011a121d680a6c188735356689c6c..c5fc339f68f1b792bf42932c8390590d5c4a058e 100644 (file)
 static int qi_lb60_spk_event(struct snd_soc_dapm_widget *widget,
                             struct snd_kcontrol *ctrl, int event)
 {
-       int on = 0;
-       if (event & SND_SOC_DAPM_POST_PMU)
-               on = 1;
-       else if (event & SND_SOC_DAPM_PRE_PMD)
-               on = 0;
+       int on = !SND_SOC_DAPM_EVENT_OFF(event);
 
        gpio_set_value(QI_LB60_SND_GPIO, on);
        gpio_set_value(QI_LB60_AMP_GPIO, on);