Permalink
Browse files

Merge pull request #54 from pawitp/android-samsung-2.6.35

Fix media buttons on Galaxy S
  • Loading branch information...
2 parents a4ec87d + 3fedca6 commit 89e6de16be6f7506fca38208a6359a51c878aa70 @atinm atinm committed Sep 18, 2011
Showing with 18 additions and 19 deletions.
  1. +3 −3 arch/arm/mach-s5pv210/mach-aries.c
  2. +4 −5 sound/soc/codecs/wm8994_herring.c
  3. +11 −11 sound/soc/codecs/wm8994_samsung.c
@@ -1376,7 +1376,7 @@ static void sec_jack_set_micbias_state(bool on)
static struct wm8994_platform_data wm8994_pdata = {
.ldo = GPIO_CODEC_LDO_EN,
- .ear_sel = GPIO_EARPATH_SEL,
+ .ear_sel = -1,
.set_mic_bias = wm8994_set_mic_bias,
};
@@ -2753,9 +2753,9 @@ static struct sec_jack_buttons_zone sec_jack_buttons_zones[] = {
},
#else
{
- /* 300 <= adc <=1000, stable zone */
+ /* 0 <= adc <=1000, stable zone */
.code = KEY_MEDIA,
- .adc_low = 300,
+ .adc_low = 0,
.adc_high = 1000,
},
#endif
@@ -1176,7 +1176,10 @@ static int wm8994_earsel_control(struct wm8994_platform_data *pdata, int en)
return -EINVAL;
}
- gpio_set_value(pdata->ear_sel, en);
+ // Don't set ear_sel on aries devices
+ if (gpio_is_valid(pdata->ear_sel)) {
+ gpio_set_value(pdata->ear_sel, en);
+ }
return 0;
@@ -1945,11 +1948,7 @@ void wm8994_set_playback_headset(struct snd_soc_codec *codec)
DEBUG_LOG("");
-#if defined(CONFIG_SAMSUNG_CAPTIVATE)
- wm8994_earsel_control(wm8994->pdata, 1); //keep earsel enabled otherwise adc disappears and sendend button fails
-#else
wm8994_earsel_control(wm8994->pdata, 0);
-#endif
/* Enable the Timeslot0 to DAC1L */
val = wm8994_read(codec, WM8994_DAC1_LEFT_MIXER_ROUTING);
@@ -3234,17 +3234,14 @@ static int wm8994_i2c_probe(struct i2c_client *i2c,
pr_err("Failed to request EAR_SEL!\n");
goto err_earsel;
}
-#if defined(CONFIG_SAMSUNG_CAPTIVATE)
- gpio_direction_output(pdata->ear_sel, 1);
-#else
gpio_direction_output(pdata->ear_sel, 0);
-#endif
- }
- if (!herring_is_cdma_wimax_dev() && !phone_is_aries_cdma()) {
- s3c_gpio_setpull(pdata->ear_sel, S3C_GPIO_PULL_NONE);
- s3c_gpio_slp_cfgpin(pdata->ear_sel, S3C_GPIO_SLP_PREV);
- s3c_gpio_slp_setpull_updown(pdata->ear_sel, S3C_GPIO_PULL_NONE);
+ if (!herring_is_cdma_wimax_dev() && !phone_is_aries_cdma()) {
+ s3c_gpio_setpull(pdata->ear_sel, S3C_GPIO_PULL_NONE);
+
+ s3c_gpio_slp_cfgpin(pdata->ear_sel, S3C_GPIO_SLP_PREV);
+ s3c_gpio_slp_setpull_updown(pdata->ear_sel, S3C_GPIO_PULL_NONE);
+ }
}
wm8994_ldo_control(pdata, 1);
@@ -3266,7 +3263,8 @@ static int wm8994_i2c_probe(struct i2c_client *i2c,
return ret;
err_init:
- gpio_free(pdata->ear_sel);
+ if (gpio_is_valid(pdata->ear_sel))
+ gpio_free(pdata->ear_sel);
err_earsel:
gpio_free(pdata->ldo);
err_ldo:
@@ -3280,7 +3278,9 @@ static int wm8994_i2c_remove(struct i2c_client *client)
struct wm8994_priv *wm8994_priv = i2c_get_clientdata(client);
gpio_free(wm8994_priv->pdata->ldo);
- gpio_free(wm8994_priv->pdata->ear_sel);
+
+ if (gpio_is_valid(wm8994_priv->pdata->ear_sel))
+ gpio_free(wm8994_priv->pdata->ear_sel);
kfree(wm8994_priv);
return 0;

0 comments on commit 89e6de1

Please sign in to comment.