mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-13 22:25:03 +00:00
mfd: stmfx: Disable IRQ in suspend to avoid spurious interrupt
[ Upstream commit97eda5dcc2
] 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:06252ade91
("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
d8d1b8b417
commit
9669bf039f
2 changed files with 7 additions and 0 deletions
|
@ -296,6 +296,8 @@ static int stmfx_irq_init(struct i2c_client *client)
|
||||||
if (ret)
|
if (ret)
|
||||||
goto irq_exit;
|
goto irq_exit;
|
||||||
|
|
||||||
|
stmfx->irq = client->irq;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
irq_exit:
|
irq_exit:
|
||||||
|
@ -486,6 +488,8 @@ static int stmfx_suspend(struct device *dev)
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
disable_irq(stmfx->irq);
|
||||||
|
|
||||||
if (stmfx->vdd)
|
if (stmfx->vdd)
|
||||||
return regulator_disable(stmfx->vdd);
|
return regulator_disable(stmfx->vdd);
|
||||||
|
|
||||||
|
@ -529,6 +533,8 @@ static int stmfx_resume(struct device *dev)
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
enable_irq(stmfx->irq);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -109,6 +109,7 @@ struct stmfx {
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
struct regmap *map;
|
struct regmap *map;
|
||||||
struct regulator *vdd;
|
struct regulator *vdd;
|
||||||
|
int irq;
|
||||||
struct irq_domain *irq_domain;
|
struct irq_domain *irq_domain;
|
||||||
struct mutex lock; /* IRQ bus lock */
|
struct mutex lock; /* IRQ bus lock */
|
||||||
u8 irq_src;
|
u8 irq_src;
|
||||||
|
|
Loading…
Reference in a new issue