diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2013-07-04 08:56:28 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-07-15 11:07:02 +0100 |
commit | b63144e6c6097486e7678f9ecc2769b68d2ec83e (patch) | |
tree | 5965c48949e925ef88882fa6aaec2d50580656b6 /sound/soc/codecs/arizona.c | |
parent | 326c29b6bedb7440b4232631686027af84a62cf5 (diff) | |
download | op-kernel-dev-b63144e6c6097486e7678f9ecc2769b68d2ec83e.zip op-kernel-dev-b63144e6c6097486e7678f9ecc2769b68d2ec83e.tar.gz |
ASoC: arizona: Add signal activity output for DRC
When doing signal activity detection, the only output from the DRC will
often be a GPIO pin. This patch adds a signal activity output that is
activated when a GPIO is configured to output the DRC signal activity
detection.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/codecs/arizona.c')
-rw-r--r-- | sound/soc/codecs/arizona.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c index de62581..c9116ac 100644 --- a/sound/soc/codecs/arizona.c +++ b/sound/soc/codecs/arizona.c @@ -19,6 +19,7 @@ #include <sound/tlv.h> #include <linux/mfd/arizona/core.h> +#include <linux/mfd/arizona/gpio.h> #include <linux/mfd/arizona/registers.h> #include "arizona.h" @@ -223,6 +224,38 @@ int arizona_init_spk(struct snd_soc_codec *codec) } EXPORT_SYMBOL_GPL(arizona_init_spk); +int arizona_init_gpio(struct snd_soc_codec *codec) +{ + struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec); + struct arizona *arizona = priv->arizona; + int i; + + switch (arizona->type) { + case WM5110: + snd_soc_dapm_disable_pin(&codec->dapm, "DRC2 Signal Activity"); + } + + snd_soc_dapm_disable_pin(&codec->dapm, "DRC1 Signal Activity"); + + for (i = 0; i < ARRAY_SIZE(arizona->pdata.gpio_defaults); i++) { + switch (arizona->pdata.gpio_defaults[i] & ARIZONA_GPN_FN_MASK) { + case ARIZONA_GP_FN_DRC1_SIGNAL_DETECT: + snd_soc_dapm_enable_pin(&codec->dapm, + "DRC1 Signal Activity"); + break; + case ARIZONA_GP_FN_DRC2_SIGNAL_DETECT: + snd_soc_dapm_enable_pin(&codec->dapm, + "DRC2 Signal Activity"); + break; + default: + break; + } + } + + return 0; +} +EXPORT_SYMBOL_GPL(arizona_init_gpio); + const char *arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS] = { "None", "Tone Generator 1", |