From: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx>
---
sound/soc/codecs/wcd9335.c | 268 ++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 266 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c
index efbb698..6c95cff 100644
--- a/sound/soc/codecs/wcd9335.c
+++ b/sound/soc/codecs/wcd9335.c
@@ -89,12 +90,18 @@Though MBHC HW supports button detection up to 8, we are only supporting 4 buttons in SW, right ?
#define CF_MIN_3DB_75HZ 0x1
#define CF_MIN_3DB_150HZ 0x2
+#define WCD9335_MBHC_MAX_BUTTONS (8)
+
#define WCD9335_SLIM_RX_CH(p) \
{.port = p + WCD9335_RX_START, .shift = p,}
#define WCD9335_SLIM_TX_CH(p) \
{.port = p, .shift = p,}
@@ -3988,6 +4003,131 @@ static int wcd9335_codec_enable_ear_pa(struct snd_soc_dapm_widget *w,Are we supporting only headset and headphone detection for now ? Extension cable and electrical detection will be supported later ?
return ret;
}
+static irqreturn_t wcd9335_mbhc_sw_irq(int irq, void *data)
+{
+ struct wcd9335_codec *wcd = data;