1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-29 08:29:53 +02:00

add disable sound amp while sound not playback.

This will save power of amp.

Signed-off-by: Jiejing.Zhang <kzjeef@gmail.com>
This commit is contained in:
Jiejing.Zhang 2009-10-14 10:58:46 +08:00 committed by Xiangfu Liu
parent 6aec1a06bf
commit 96b315a920

View File

@ -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);