summaryrefslogtreecommitdiffstats
path: root/sound/soc/mid-x86
diff options
context:
space:
mode:
authorVinod Koul <vinod.koul@intel.com>2011-02-10 12:58:01 +0530
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-02-11 11:16:29 +0000
commit7ae7434086f5b106021276e88b8ef49debf30aa8 (patch)
tree3a8775b2e5bb80923125159d2495c8371f2193fd /sound/soc/mid-x86
parent4a5aa6e9ea670cf8de39ae0b87010fce41a6dd73 (diff)
ASoC: mid-x86: Use the soc-jack apis for jack type detection
This patch modifies the mfld_machine to use the new jack apis for adding the voltage zones for jack type detection. It also modifed TI sn95031 codec driver to use these new apis Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Harsha Priya <priya.harsha@intel.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/mid-x86')
-rw-r--r--sound/soc/mid-x86/mfld_machine.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sound/soc/mid-x86/mfld_machine.c b/sound/soc/mid-x86/mfld_machine.c
index 45a00670802..96487fb8d26 100644
--- a/sound/soc/mid-x86/mfld_machine.c
+++ b/sound/soc/mid-x86/mfld_machine.c
@@ -74,6 +74,12 @@ static struct snd_soc_jack_pin mfld_jack_pins[] = {
},
};
+/* jack detection voltage zones */
+static struct snd_soc_jack_zone mfld_zones[] = {
+ {MFLD_MV_START, MFLD_MV_AM_HS, SND_JACK_HEADPHONE},
+ {MFLD_MV_AM_HS, MFLD_MV_HS, SND_JACK_HEADSET},
+};
+
/* sound card controls */
static const char *headset_switch_text[] = {"Earpiece", "Headset"};
@@ -264,6 +270,12 @@ static int mfld_init(struct snd_soc_pcm_runtime *runtime)
pr_err("adding jack pins failed\n");
return ret_val;
}
+ ret_val = snd_soc_jack_add_zones(&mfld_jack,
+ ARRAY_SIZE(mfld_zones), mfld_zones);
+ if (ret_val) {
+ pr_err("adding jack zones failed\n");
+ return ret_val;
+ }
/* we want to check if anything is inserted at boot,
* so send a fake event to codec and it will read adc