aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/codecs/sn95031.c4
-rw-r--r--sound/soc/mid-x86/mfld_machine.c12
2 files changed, 13 insertions, 3 deletions
diff --git a/sound/soc/codecs/sn95031.c b/sound/soc/codecs/sn95031.c
index 4cc00177ee3d..d0b780206716 100644
--- a/sound/soc/codecs/sn95031.c
+++ b/sound/soc/codecs/sn95031.c
@@ -782,9 +782,7 @@ static int sn95031_get_headset_state(struct snd_soc_jack *mfld_jack)
782{ 782{
783 int micbias = sn95031_get_mic_bias(mfld_jack->codec); 783 int micbias = sn95031_get_mic_bias(mfld_jack->codec);
784 784
785 /* Defaulting to HEADSET for now. 785 int jack_type = snd_soc_jack_get_type(mfld_jack, micbias);
786 * will change after adding soc-jack detection apis */
787 int jack_type = SND_JACK_HEADSET;
788 786
789 pr_debug("jack type detected = %d\n", jack_type); 787 pr_debug("jack type detected = %d\n", jack_type);
790 if (jack_type == SND_JACK_HEADSET) 788 if (jack_type == SND_JACK_HEADSET)
diff --git a/sound/soc/mid-x86/mfld_machine.c b/sound/soc/mid-x86/mfld_machine.c
index 45a006708022..96487fb8d265 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[] = {
74 }, 74 },
75}; 75};
76 76
77/* jack detection voltage zones */
78static struct snd_soc_jack_zone mfld_zones[] = {
79 {MFLD_MV_START, MFLD_MV_AM_HS, SND_JACK_HEADPHONE},
80 {MFLD_MV_AM_HS, MFLD_MV_HS, SND_JACK_HEADSET},
81};
82
77/* sound card controls */ 83/* sound card controls */
78static const char *headset_switch_text[] = {"Earpiece", "Headset"}; 84static const char *headset_switch_text[] = {"Earpiece", "Headset"};
79 85
@@ -264,6 +270,12 @@ static int mfld_init(struct snd_soc_pcm_runtime *runtime)
264 pr_err("adding jack pins failed\n"); 270 pr_err("adding jack pins failed\n");
265 return ret_val; 271 return ret_val;
266 } 272 }
273 ret_val = snd_soc_jack_add_zones(&mfld_jack,
274 ARRAY_SIZE(mfld_zones), mfld_zones);
275 if (ret_val) {
276 pr_err("adding jack zones failed\n");
277 return ret_val;
278 }
267 279
268 /* we want to check if anything is inserted at boot, 280 /* we want to check if anything is inserted at boot,
269 * so send a fake event to codec and it will read adc 281 * so send a fake event to codec and it will read adc