Skip to content
Browse files

Fix captivate wired headset mic

  • Loading branch information...
1 parent f244472 commit 1ffd9d109da33947def2db23fcb0800df7137381 @xcaliburinhand committed
View
2 arch/arm/mach-s5pv210/include/mach/gpio-herring.h
@@ -578,7 +578,7 @@
#define GPIO_AP_PMIC_SCL S5PV210_GPJ4(3)
-#ifdef GALAXYS
+#if defined(CONFIG_GALAXYS) && !defined(CONFIG_GALAXYS_SGH_I897)
#define GPIO_TV_EN S5PV210_GPJ4(4)
#else
#define GPIO_EAR_MICBIAS_EN S5PV210_GPJ4(4)
View
15 arch/arm/mach-s5pv210/mach-herring.c
@@ -1305,12 +1305,19 @@ static void sec_jack_set_micbias_state(bool on)
set_shared_mic_bias();
spin_unlock_irqrestore(&mic_bias_lock, flags);
} else
+#if defined(CONFIG_GALAXYS_SGH_I897)
+ gpio_set_value(GPIO_EARPATH_SEL, on);
+#endif
gpio_set_value(GPIO_EAR_MICBIAS_EN, on);
}
static struct wm8994_platform_data wm8994_pdata = {
.ldo = GPIO_CODEC_LDO_EN,
+#if defined(CONFIG_GALAXYS_SGH_I897)
+ .ear_sel = GPIO_EARPATH_SEL,
+#else
.ear_sel = GPIO_EAR_SEL,
+#endif
.set_mic_bias = wm8994_set_mic_bias,
};
@@ -2370,7 +2377,11 @@ struct sec_jack_platform_data sec_jack_pdata = {
.zones = sec_jack_zones,
.num_zones = ARRAY_SIZE(sec_jack_zones),
.det_gpio = GPIO_DET_35,
+#if defined(CONFIG_GALAXYS_SGH_I897)
+ .send_end_gpio = GPIO_KBC2,
+#else
.send_end_gpio = GPIO_EAR_SEND_END,
+#endif
};
static struct platform_device sec_device_jack = {
@@ -4394,8 +4405,12 @@ static void __init herring_machine_init(void)
#endif
/* headset/earjack detection */
+#if defined(CONFIG_GALAXYS_SGH_I897)
+ gpio_request(GPIO_EAR_MICBIAS_EN, "ear_micbias_enable");
+#else
if (system_rev >= 0x09)
gpio_request(GPIO_EAR_MICBIAS_EN, "ear_micbias_enable");
+#endif
gpio_request(GPIO_TOUCH_EN, "touch en");
View
4 drivers/misc/sec_jack.c
@@ -101,11 +101,15 @@ static void sec_jack_set_type(struct sec_jack_info *hi, int jack_type)
/* for a 4 pole headset, enable detection of send/end key */
if (hi->send_key_dev == NULL)
/* enable to get events again */
+#if !defined(CONFIG_GALAXYS_SGH_I897) //temp disable send end - needs to be fixed
hi->send_key_dev = platform_device_register_data(NULL,
GPIO_EVENT_DEV_NAME,
hi->dev_id,
&sec_jack_input_data,
sizeof(sec_jack_input_data));
+#else
+printk("enable send/end\n");
+#endif
} else {
/* for all other jacks, disable send/end key detection */
if (hi->send_key_dev != NULL) {
View
4 sound/soc/codecs/wm8994_samsung.c
@@ -2975,7 +2975,11 @@ static int wm8994_i2c_probe(struct i2c_client *i2c,
pr_err("Failed to request EAR_SEL!\n");
goto err_earsel;
}
+#if defined(CONFIG_GALAXYS_SGH_I897) //Possibly needed for all Galaxy variants
+ gpio_direction_output(pdata->ear_sel, 1);
+#else
gpio_direction_output(pdata->ear_sel, 0);
+#endif
}
s3c_gpio_setpull(pdata->ear_sel, S3C_GPIO_PULL_NONE);

4 comments on commit 1ffd9d1

@atinm

Hey, did this actually fix it or is this a partial fix? I see the fixme - you still working on this?

@xcaliburinhand

This fixes the wired headset mic, but the send/end button is still broken. I never really got around to fixing the send/end button. From my investigations adapting the code will not work, porting the send/end code from froyo is probably the best bet.

@atinm

That's what I was looking at - looks painful to port. And my mic still doesn't work . . . are there other commits I should look at? Oh, and lines 1308-1310 in mach-herring.c don't look right (the else doesn't have any parens but you added a line)

@xcaliburinhand

Good point, there should be curly brackets surrounding the two lines. Shouldn't need another commit for the headset mic to work. Double check your GPIO definitions. The mic bias and ear path selection are key to the mic working.

Please sign in to comment.
Something went wrong with that request. Please try again.