(SHIFT) techpack: audio: wcd-mbhc bringup for SHIFT6mq
Change-Id: I878ff86cab869a3fdae4e7d9481da0596dc5380e
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
diff --git a/techpack/audio/asoc/codecs/wcd-mbhc-v2.c b/techpack/audio/asoc/codecs/wcd-mbhc-v2.c
index 806abd4..f5e7dad 100644
--- a/techpack/audio/asoc/codecs/wcd-mbhc-v2.c
+++ b/techpack/audio/asoc/codecs/wcd-mbhc-v2.c
@@ -859,6 +859,9 @@ static void wcd_mbhc_swch_irq_handler(struct wcd_mbhc *mbhc)
if (wcd_cancel_btn_work(mbhc))
pr_debug("%s: button press is canceled\n", __func__);
+#ifdef CONFIG_SHIFT_PROJECT
+ msleep(300);
+#endif
WCD_MBHC_REG_READ(WCD_MBHC_MECH_DETECTION_TYPE, detection_type);
/* Set the detection type appropriately */
diff --git a/techpack/audio/asoc/codecs/wcd-mbhc-v2.h b/techpack/audio/asoc/codecs/wcd-mbhc-v2.h
index f362f48..5090715 100644
--- a/techpack/audio/asoc/codecs/wcd-mbhc-v2.h
+++ b/techpack/audio/asoc/codecs/wcd-mbhc-v2.h
@@ -144,7 +144,11 @@ do { \
#define GND_MIC_SWAP_THRESHOLD 4
#define GND_MIC_USBC_SWAP_THRESHOLD 2
#define WCD_FAKE_REMOVAL_MIN_PERIOD_MS 100
+#ifdef CONFIG_SHIFT_PROJECT
+#define HS_VREF_MIN_VAL 2700
+#else
#define HS_VREF_MIN_VAL 1400
+#endif
#define FW_READ_ATTEMPTS 15
#define FW_READ_TIMEOUT 4000000
#define FAKE_REM_RETRY_ATTEMPTS 3
diff --git a/techpack/audio/asoc/sdm845.c b/techpack/audio/asoc/sdm845.c
index 16fea1e..b84a086 100644
--- a/techpack/audio/asoc/sdm845.c
+++ b/techpack/audio/asoc/sdm845.c
@@ -621,9 +621,15 @@ static struct wcd_mbhc_config wcd_mbhc_cfg = {
.swap_gnd_mic = NULL,
.hs_ext_micbias = true,
.key_code[0] = KEY_MEDIA,
+#ifdef CONFIG_SHIFT_PROJECT
+ .key_code[1] = KEY_VOLUMEUP,
+ .key_code[2] = KEY_VOLUMEDOWN,
+ .key_code[3] = 0,
+#else
.key_code[1] = KEY_VOICECOMMAND,
.key_code[2] = KEY_VOLUMEUP,
.key_code[3] = KEY_VOLUMEDOWN,
+#endif
.key_code[4] = 0,
.key_code[5] = 0,
.key_code[6] = 0,
@@ -4206,8 +4212,13 @@ static void *def_tavil_mbhc_cal(void)
(sizeof(btn_cfg->_v_btn_low[0]) * btn_cfg->num_btn);
btn_high[0] = 75;
+#ifdef CONFIG_SHIFT_PROJECT
+ btn_high[1] = 200;
+ btn_high[2] = 412;
+#else
btn_high[1] = 150;
btn_high[2] = 237;
+#endif
btn_high[3] = 500;
btn_high[4] = 500;
btn_high[5] = 500;