extcon: arizona: Disable mic detect if running when driver is removed
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Thu, 4 Apr 2019 16:33:56 +0000 (17:33 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:46:23 +0000 (06:46 -0700)
commitc9aa87e5f3457fc4a229804319017fb3d308e7da
tree386a389761ff8f4c4eda2405db876ba2169411f0
parent82234265845921411e0ec8284667200990a7c4ed
extcon: arizona: Disable mic detect if running when driver is removed

[ Upstream commit 00053de52231117ddc154042549f2256183ffb86 ]

Microphone detection provides the button detection features on the
Arizona CODECs as such it will be running if the jack is currently
inserted. If the driver is unbound whilst the jack is still inserted
this will cause warnings from the regulator framework as the MICVDD
regulator is put but was never disabled.

Correct this by disabling microphone detection on driver removal and if
the microphone detection was running disable the regulator and put the
runtime reference that was currently held.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/extcon/extcon-arizona.c