From fabb877fb9a60ec61f73f0b31a80bec8751c4e9d Mon Sep 17 00:00:00 2001 From: Bhalchandra Gajare Date: Thu, 10 Nov 2011 19:52:01 -0800 Subject: [PATCH] ASoC: WCD9310: Fix button polling frequency for tabla 2.0 For tabla version 1.0 the button press voltage threshold is 12 bit value whereas for tabla version 2.0 it is a 16-bit value. Fix by always updating the 16-bit value, since tabla 1.0 will just ignore the most significant 4 bits. Change-Id: Ia421d73dddb7a192e1b51c78952ec77fab46c373 Signed-off-by: Bhalchandra Gajare --- sound/soc/codecs/wcd9310.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/codecs/wcd9310.c b/sound/soc/codecs/wcd9310.c index d330f7abcb6..cab5ec5c8df 100644 --- a/sound/soc/codecs/wcd9310.c +++ b/sound/soc/codecs/wcd9310.c @@ -2168,7 +2168,7 @@ static void tabla_codec_calibrate_hs_polling(struct snd_soc_codec *codec) snd_soc_write(codec, TABLA_A_CDC_MBHC_VOLT_B10_CTL, 0xFF); snd_soc_write(codec, TABLA_A_CDC_MBHC_VOLT_B9_CTL, 0x20); - snd_soc_write(codec, TABLA_A_CDC_MBHC_VOLT_B4_CTL, 0x08); + snd_soc_write(codec, TABLA_A_CDC_MBHC_VOLT_B4_CTL, 0xF8); snd_soc_write(codec, TABLA_A_CDC_MBHC_VOLT_B3_CTL, 0xEE); snd_soc_write(codec, TABLA_A_CDC_MBHC_VOLT_B2_CTL, 0xFC); snd_soc_write(codec, TABLA_A_CDC_MBHC_VOLT_B1_CTL, 0xCE); @@ -2762,7 +2762,6 @@ static irqreturn_t tabla_dce_handler(int irq, void *data) */ priv->buttons_pressed |= SND_JACK_BTN_0; - snd_soc_write(codec, TABLA_A_CDC_MBHC_VOLT_B4_CTL, 0x09); msleep(100); schedule_delayed_work(&priv->btn0_dwork, msecs_to_jiffies(400)); @@ -2822,7 +2821,6 @@ static irqreturn_t tabla_release_handler(int irq, void *data) priv->buttons_pressed &= ~SND_JACK_BTN_0; } - snd_soc_write(codec, TABLA_A_CDC_MBHC_VOLT_B4_CTL, 0x08); tabla_codec_start_hs_polling(codec); return IRQ_HANDLED;