summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/stmfx.c
diff options
context:
space:
mode:
authorAmelie Delaunay <amelie.delaunay@st.com>2020-04-22 11:08:33 +0200
committerLee Jones <lee.jones@linaro.org>2020-05-26 11:51:21 +0200
commit97eda5dcc2cde5dcc778bef7a9344db3b6bf8ef5 (patch)
tree04383d6df8a3cd64f00b0e98d36407e5a50be4f5 /drivers/mfd/stmfx.c
parentmfd: stmfx: Fix stmfx_irq_init error path (diff)
downloadlinux-97eda5dcc2cde5dcc778bef7a9344db3b6bf8ef5.tar.xz
linux-97eda5dcc2cde5dcc778bef7a9344db3b6bf8ef5.zip
mfd: stmfx: Disable IRQ in suspend to avoid spurious interrupt
When STMFX supply is stopped, spurious interrupt can occur. To avoid that, disable the interrupt in suspend before disabling the regulator and re-enable it at the end of resume. Fixes: 06252ade9156 ("mfd: Add ST Multi-Function eXpander (STMFX) core driver") Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/stmfx.c')
-rw-r--r--drivers/mfd/stmfx.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mfd/stmfx.c b/drivers/mfd/stmfx.c
index 1977fe95f876..711979afd90a 100644
--- a/drivers/mfd/stmfx.c
+++ b/drivers/mfd/stmfx.c
@@ -296,6 +296,8 @@ static int stmfx_irq_init(struct i2c_client *client)
if (ret)
goto irq_exit;
+ stmfx->irq = client->irq;
+
return 0;
irq_exit:
@@ -486,6 +488,8 @@ static int stmfx_suspend(struct device *dev)
if (ret)
return ret;
+ disable_irq(stmfx->irq);
+
if (stmfx->vdd)
return regulator_disable(stmfx->vdd);
@@ -529,6 +533,8 @@ static int stmfx_resume(struct device *dev)
if (ret)
return ret;
+ enable_irq(stmfx->irq);
+
return 0;
}
#endif