From 96b315a9208d61af5f8cbaa5665bb9e78e0d62ed Mon Sep 17 00:00:00 2001 From: "Jiejing.Zhang" Date: Wed, 14 Oct 2009 10:58:46 +0800 Subject: [PATCH] add disable sound amp while sound not playback. This will save power of amp. Signed-off-by: Jiejing.Zhang --- .../linux/xburst/files-2.6.31/sound/soc/jz4740/qi_lb60.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/target/linux/xburst/files-2.6.31/sound/soc/jz4740/qi_lb60.c b/target/linux/xburst/files-2.6.31/sound/soc/jz4740/qi_lb60.c index 1c5b3bf25..a2ce3cf7e 100644 --- a/target/linux/xburst/files-2.6.31/sound/soc/jz4740/qi_lb60.c +++ b/target/linux/xburst/files-2.6.31/sound/soc/jz4740/qi_lb60.c @@ -31,9 +31,13 @@ #define QI_LB60_AMP_GPIO JZ_GPIO_PORTD(4) static int qi_lb60_spk_event(struct snd_soc_dapm_widget *widget, - struct snd_kcontrol *ctrl, int event) + struct snd_kcontrol *ctrl, int event) { - int on = !SND_SOC_DAPM_EVENT_OFF(event); + int on = 0; + if (event & SND_SOC_DAPM_POST_PMU) + on = 1; + else if (event & SND_SOC_DAPM_PRE_PMD) + on = 0; gpio_set_value(QI_LB60_SND_GPIO, on); gpio_set_value(QI_LB60_AMP_GPIO, on);