Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

Fix media buttons on Galaxy S
  • Loading branch information...
commit 89e6de16be6f7506fca38208a6359a51c878aa70 2 parents a4ec87d + 3fedca6
Atin M atinm authored
6 arch/arm/mach-s5pv210/mach-aries.c
@@ -1376,7 +1376,7 @@ static void sec_jack_set_micbias_state(bool on)
1376 1376
1377 1377 static struct wm8994_platform_data wm8994_pdata = {
1378 1378 .ldo = GPIO_CODEC_LDO_EN,
1379   - .ear_sel = GPIO_EARPATH_SEL,
  1379 + .ear_sel = -1,
1380 1380 .set_mic_bias = wm8994_set_mic_bias,
1381 1381 };
1382 1382
@@ -2753,9 +2753,9 @@ static struct sec_jack_buttons_zone sec_jack_buttons_zones[] = {
2753 2753 },
2754 2754 #else
2755 2755 {
2756   - /* 300 <= adc <=1000, stable zone */
  2756 + /* 0 <= adc <=1000, stable zone */
2757 2757 .code = KEY_MEDIA,
2758   - .adc_low = 300,
  2758 + .adc_low = 0,
2759 2759 .adc_high = 1000,
2760 2760 },
2761 2761 #endif
9 sound/soc/codecs/wm8994_herring.c
@@ -1176,7 +1176,10 @@ static int wm8994_earsel_control(struct wm8994_platform_data *pdata, int en)
1176 1176 return -EINVAL;
1177 1177 }
1178 1178
1179   - gpio_set_value(pdata->ear_sel, en);
  1179 + // Don't set ear_sel on aries devices
  1180 + if (gpio_is_valid(pdata->ear_sel)) {
  1181 + gpio_set_value(pdata->ear_sel, en);
  1182 + }
1180 1183
1181 1184 return 0;
1182 1185
@@ -1945,11 +1948,7 @@ void wm8994_set_playback_headset(struct snd_soc_codec *codec)
1945 1948
1946 1949 DEBUG_LOG("");
1947 1950
1948   -#if defined(CONFIG_SAMSUNG_CAPTIVATE)
1949   - wm8994_earsel_control(wm8994->pdata, 1); //keep earsel enabled otherwise adc disappears and sendend button fails
1950   -#else
1951 1951 wm8994_earsel_control(wm8994->pdata, 0);
1952   -#endif
1953 1952
1954 1953 /* Enable the Timeslot0 to DAC1L */
1955 1954 val = wm8994_read(codec, WM8994_DAC1_LEFT_MIXER_ROUTING);
22 sound/soc/codecs/wm8994_samsung.c
@@ -3234,17 +3234,14 @@ static int wm8994_i2c_probe(struct i2c_client *i2c,
3234 3234 pr_err("Failed to request EAR_SEL!\n");
3235 3235 goto err_earsel;
3236 3236 }
3237   -#if defined(CONFIG_SAMSUNG_CAPTIVATE)
3238   - gpio_direction_output(pdata->ear_sel, 1);
3239   -#else
3240 3237 gpio_direction_output(pdata->ear_sel, 0);
3241   -#endif
3242   - }
3243   - if (!herring_is_cdma_wimax_dev() && !phone_is_aries_cdma()) {
3244   - s3c_gpio_setpull(pdata->ear_sel, S3C_GPIO_PULL_NONE);
3245 3238
3246   - s3c_gpio_slp_cfgpin(pdata->ear_sel, S3C_GPIO_SLP_PREV);
3247   - s3c_gpio_slp_setpull_updown(pdata->ear_sel, S3C_GPIO_PULL_NONE);
  3239 + if (!herring_is_cdma_wimax_dev() && !phone_is_aries_cdma()) {
  3240 + s3c_gpio_setpull(pdata->ear_sel, S3C_GPIO_PULL_NONE);
  3241 +
  3242 + s3c_gpio_slp_cfgpin(pdata->ear_sel, S3C_GPIO_SLP_PREV);
  3243 + s3c_gpio_slp_setpull_updown(pdata->ear_sel, S3C_GPIO_PULL_NONE);
  3244 + }
3248 3245 }
3249 3246 wm8994_ldo_control(pdata, 1);
3250 3247
@@ -3266,7 +3263,8 @@ static int wm8994_i2c_probe(struct i2c_client *i2c,
3266 3263 return ret;
3267 3264
3268 3265 err_init:
3269   - gpio_free(pdata->ear_sel);
  3266 + if (gpio_is_valid(pdata->ear_sel))
  3267 + gpio_free(pdata->ear_sel);
3270 3268 err_earsel:
3271 3269 gpio_free(pdata->ldo);
3272 3270 err_ldo:
@@ -3280,7 +3278,9 @@ static int wm8994_i2c_remove(struct i2c_client *client)
3280 3278 struct wm8994_priv *wm8994_priv = i2c_get_clientdata(client);
3281 3279
3282 3280 gpio_free(wm8994_priv->pdata->ldo);
3283   - gpio_free(wm8994_priv->pdata->ear_sel);
  3281 +
  3282 + if (gpio_is_valid(wm8994_priv->pdata->ear_sel))
  3283 + gpio_free(wm8994_priv->pdata->ear_sel);
3284 3284
3285 3285 kfree(wm8994_priv);
3286 3286 return 0;

0 comments on commit 89e6de1

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