ASoC: max98090: fix interrupt handling problem 59/93259/5
authorDongwoo Lee <dwoo08.lee@samsung.com>
Fri, 21 Oct 2016 07:51:40 +0000 (16:51 +0900)
committerAndi Shyti <andi.shyti@samsung.com>
Mon, 24 Oct 2016 06:47:28 +0000 (23:47 -0700)
commit8a337af62f2939d50a335993f3674b8382e9a571
treeadfaf70959ac8bc26c96560f7789f1a9c5bd30fa
parent632666157edfe1958b1e1f350dd9c067b362c72e
ASoC: max98090: fix interrupt handling problem

The max98090_interrupt handler currently will read the device status
register. After that, it will act only when the JDET bit is set.
However, when max98090_interrupt handler is triggered and jack status
register has really changed, the JDET bit of device status register
is not set as expected for unknown reason. Because of this, the jack status cannot be reported.

This patch adds a workaround solution for jack detection, by adding
the second chance to recognize the reason of interrupt generation.
If the interrupt is generated without setting any values on device
status register, jack status register is compared to the current jack
states. If the jack status is changed, the JDET bit is manually set.

Change-Id: I74f6fb54fb9cc47e292f1f8e116032faae89c063
Reported-by: Huang Chao <chao7.huang@samsung.com>
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
sound/soc/codecs/max98090.c