aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorJarkko Nikula <jarkko.nikula@nokia.com>2009-03-18 10:46:54 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-03-19 07:56:16 -0400
commitf8d5fc924b1bec95f47b0a9e8f9a6e22fa1c7b05 (patch)
treeb579cd2dd7caaaa97c5249a82cf9004cc85d20a3 /sound/soc
parent13b9d2ab5921d77df5217a2104b687a1c729d521 (diff)
ASoC: OMAP: N810: Add more jack functions
Add functions "Headset" and "Mic" to the control "Jack Function" for activating and de-activating codec input pin LINE1L which is connected to the mic pin of 4-pole Nokia AV connecter. Note there is no mic bias voltage management here since bias is coming from Nokia ASIC and driver for it is not in mainline. Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/omap/n810.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c
index f203221d9cb..a6d1178ce12 100644
--- a/sound/soc/omap/n810.c
+++ b/sound/soc/omap/n810.c
@@ -40,6 +40,13 @@
40#define N810_HEADSET_AMP_GPIO 10 40#define N810_HEADSET_AMP_GPIO 10
41#define N810_SPEAKER_AMP_GPIO 101 41#define N810_SPEAKER_AMP_GPIO 101
42 42
43enum {
44 N810_JACK_DISABLED,
45 N810_JACK_HP,
46 N810_JACK_HS,
47 N810_JACK_MIC,
48};
49
43static struct clk *sys_clkout2; 50static struct clk *sys_clkout2;
44static struct clk *sys_clkout2_src; 51static struct clk *sys_clkout2_src;
45static struct clk *func96m_clk; 52static struct clk *func96m_clk;
@@ -50,15 +57,32 @@ static int n810_dmic_func;
50 57
51static void n810_ext_control(struct snd_soc_codec *codec) 58static void n810_ext_control(struct snd_soc_codec *codec)
52{ 59{
60 int hp = 0, line1l = 0;
61
62 switch (n810_jack_func) {
63 case N810_JACK_HS:
64 line1l = 1;
65 case N810_JACK_HP:
66 hp = 1;
67 break;
68 case N810_JACK_MIC:
69 line1l = 1;
70 break;
71 }
72
53 if (n810_spk_func) 73 if (n810_spk_func)
54 snd_soc_dapm_enable_pin(codec, "Ext Spk"); 74 snd_soc_dapm_enable_pin(codec, "Ext Spk");
55 else 75 else
56 snd_soc_dapm_disable_pin(codec, "Ext Spk"); 76 snd_soc_dapm_disable_pin(codec, "Ext Spk");
57 77
58 if (n810_jack_func) 78 if (hp)
59 snd_soc_dapm_enable_pin(codec, "Headphone Jack"); 79 snd_soc_dapm_enable_pin(codec, "Headphone Jack");
60 else 80 else
61 snd_soc_dapm_disable_pin(codec, "Headphone Jack"); 81 snd_soc_dapm_disable_pin(codec, "Headphone Jack");
82 if (line1l)
83 snd_soc_dapm_enable_pin(codec, "LINE1L");
84 else
85 snd_soc_dapm_disable_pin(codec, "LINE1L");
62 86
63 if (n810_dmic_func) 87 if (n810_dmic_func)
64 snd_soc_dapm_enable_pin(codec, "DMic"); 88 snd_soc_dapm_enable_pin(codec, "DMic");
@@ -229,7 +253,7 @@ static const struct snd_soc_dapm_route audio_map[] = {
229}; 253};
230 254
231static const char *spk_function[] = {"Off", "On"}; 255static const char *spk_function[] = {"Off", "On"};
232static const char *jack_function[] = {"Off", "Headphone"}; 256static const char *jack_function[] = {"Off", "Headphone", "Headset", "Mic"};
233static const char *input_function[] = {"ADC", "Digital Mic"}; 257static const char *input_function[] = {"ADC", "Digital Mic"};
234static const struct soc_enum n810_enum[] = { 258static const struct soc_enum n810_enum[] = {
235 SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(spk_function), spk_function), 259 SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(spk_function), spk_function),