aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/extcon/extcon-sm5502.c
diff options
context:
space:
mode:
authorStephan Gerhold <stephan@gerhold.net>2019-10-10 17:47:20 +0200
committerChanwoo Choi <cw00.choi@samsung.com>2019-10-11 10:43:26 +0900
commit6942635032cfd3e003e980d2dfa4e6323a3ce145 (patch)
treeb8e4259a672214f4dd08cec7d21d5d64d182bddb /drivers/extcon/extcon-sm5502.c
parentextcon-intel-cht-wc: Don't reset USB data connection at probe (diff)
downloadlinux-dev-6942635032cfd3e003e980d2dfa4e6323a3ce145.tar.xz
linux-dev-6942635032cfd3e003e980d2dfa4e6323a3ce145.zip
extcon: sm5502: Reset registers during initialization
On some devices (e.g. Samsung Galaxy A5 (2015)), the bootloader seems to keep interrupts enabled for SM5502 when booting Linux. Changing the cable state (i.e. plugging in a cable) - until the driver is loaded - will therefore produce an interrupt that is never read. In this situation, the cable state will be stuck forever on the initial state because SM5502 stops sending interrupts. This can be avoided by clearing those pending interrupts after the driver has been loaded. One way to do this is to reset all registers to default state by writing to SM5502_REG_RESET. This ensures that we start from a clean state, with all interrupts disabled. Suggested-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon/extcon-sm5502.c')
-rw-r--r--drivers/extcon/extcon-sm5502.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/extcon/extcon-sm5502.c b/drivers/extcon/extcon-sm5502.c
index dc43847ad2b0..b3d93baf4fc5 100644
--- a/drivers/extcon/extcon-sm5502.c
+++ b/drivers/extcon/extcon-sm5502.c
@@ -65,6 +65,10 @@ struct sm5502_muic_info {
/* Default value of SM5502 register to bring up MUIC device. */
static struct reg_data sm5502_reg_data[] = {
{
+ .reg = SM5502_REG_RESET,
+ .val = SM5502_REG_RESET_MASK,
+ .invert = true,
+ }, {
.reg = SM5502_REG_CONTROL,
.val = SM5502_REG_CONTROL_MASK_INT_MASK,
.invert = false,