diff options
author | Eric Nelson <eric.nelson@boundarydevices.com> | 2013-05-20 12:20:32 -0700 |
---|---|---|
committer | Eric Nelson <eric.nelson@boundarydevices.com> | 2013-06-02 09:51:13 -0700 |
commit | ed81c3e0be11e2f165f913979642ac25feb113c0 (patch) | |
tree | f54e2b2f2fef4d1a1f1cfe83aaf8e1376adbfae7 /sound | |
parent | 1012b75d9e3b37ac99365a5ef7c195653235ea58 (diff) |
imx-sgtl5000: Allow platform-specific callback for enabling an amplifier
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/imx/imx-sgtl5000.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sound/soc/imx/imx-sgtl5000.c b/sound/soc/imx/imx-sgtl5000.c index 9325dc8e346c..773535fece2c 100644 --- a/sound/soc/imx/imx-sgtl5000.c +++ b/sound/soc/imx/imx-sgtl5000.c @@ -195,11 +195,23 @@ static int sgtl5000_set_line_in(struct snd_kcontrol *kcontrol, return 1; } +static int spk_amp_event(struct snd_soc_dapm_widget *w, + struct snd_kcontrol *kcontrol, int event) +{ + struct imx_sgtl5000_priv *priv = &card_priv; + struct platform_device *pdev = priv->pdev; + struct mxc_audio_platform_data *plat = pdev->dev.platform_data; + + if (plat->amp_enable) + plat->amp_enable(SND_SOC_DAPM_EVENT_ON(event)? 1 : 0); + return 0; +} + /* imx_3stack card dapm widgets */ static const struct snd_soc_dapm_widget imx_3stack_dapm_widgets[] = { SND_SOC_DAPM_MIC("Mic Jack", NULL), SND_SOC_DAPM_LINE("Line In Jack", NULL), - SND_SOC_DAPM_SPK("Ext Spk", NULL), + SND_SOC_DAPM_SPK("Ext Spk", spk_amp_event), SND_SOC_DAPM_HP("Headphone Jack", NULL), }; |