Skip to content

Commit

Permalink
ASoC: JZ4740: qi_lb60: Use the SND_SOC_DAPM_EVENT_OFF for the speaker…
Browse files Browse the repository at this point in the history
…s status

Use SND_SOC_DAPM_EVENT_OFF for determining whether the speaker should be turned
on or off instead of open coding it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Lars-Peter Clausen authored and Mark Brown committed Apr 13, 2011
1 parent c6f0ede commit 621206b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions sound/soc/jz4740/qi_lb60.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@
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);
Expand Down

0 comments on commit 621206b

Please sign in to comment.