summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhani Kumar Uppalapati <phaniu@codeaurora.org>2015-11-16 16:06:59 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 21:17:00 -0700
commit6fd817114cf4cc90ad61070eb8dd927a995901ce (patch)
treeb1a8057402b2650adc38070fb9e06d233b312914
parentb0d56ee1cb80e3b3b6af5bf738b0233b36fc9483 (diff)
ASoC: wcd9335: Give more headroom for headphone PA ramp
Give more headroom for headphone PA ramp up and down during impedance detection to avoid any click and pop or ramp error. Change-Id: I3e3980e48ce19955b4230876887adfde5b44e8ea Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
-rwxr-xr-xsound/soc/codecs/wcd9335.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c
index 694b52faa8ea..e942c277d50d 100755
--- a/sound/soc/codecs/wcd9335.c
+++ b/sound/soc/codecs/wcd9335.c
@@ -106,7 +106,7 @@
/* Convert from vout ctl to micbias voltage in mV */
#define WCD_VOUT_CTL_TO_MICB(v) (1000 + v * 50)
-#define TASHA_ZDET_NUM_MEASUREMENTS 60
+#define TASHA_ZDET_NUM_MEASUREMENTS 150
#define TASHA_MBHC_GET_C1(c) ((c & 0xC000) >> 14)
#define TASHA_MBHC_GET_X1(x) (x & 0x3FFF)
/* z value compared in milliOhm */
@@ -1554,11 +1554,15 @@ static inline void tasha_mbhc_get_result_params(struct wcd9xxx *wcd9xxx,
WCD9335_ANA_MBHC_ZDET, 0x20, 0x00);
x1 = TASHA_MBHC_GET_X1(val);
c1 = TASHA_MBHC_GET_C1(val);
+ /* If ramp is not complete, give additional 5ms */
+ if ((c1 < 2) && x1)
+ usleep_range(5000, 5050);
+
if (!c1 || !x1) {
dev_dbg(wcd9xxx->dev,
"%s: Impedance detect ramp error, c1=%d, x1=0x%x\n",
__func__, c1, x1);
- return;
+ goto ramp_down;
}
d1 = d1_a[c1];
denom = (x1 * d1) - (1 << (14 - noff));
@@ -1569,6 +1573,7 @@ static inline void tasha_mbhc_get_result_params(struct wcd9xxx *wcd9xxx,
dev_dbg(wcd9xxx->dev, "%s: d1=%d, c1=%d, x1=0x%x, z_val=%d(milliOhm)\n",
__func__, d1, c1, x1, *zdet);
+ramp_down:
i = 0;
while (x1) {
wcd9xxx_bulk_read(&wcd9xxx->core_res,