History

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.

Amelie Delaunay committed 6 years ago

Commit 97eda5d1 parent 60c2c4b2 files · +7 −0Browse files

Unified · Split

2 files
  1. drivers/mfd/stmfx.c +6 −0
  2. include/linux/mfd/stmfx.h +1 −0
drivers/mfd/stmfx.c+6−0
@@ -296,6 +296,8 @@ static int stmfx_irq_init(struct i2c_client *client) · 295 unmodified lines
296296 if (ret)
297297 goto irq_exit;
298298
299+ stmfx->irq = client->irq;
300+
299301 return 0;
300302
301303 irq_exit:
@@ -486,6 +488,8 @@ static int stmfx_suspend(struct device *dev) · 184 unmodified lines
486488 if (ret)
487489 return ret;
488490
491+ disable_irq(stmfx->irq);
492+
489493 if (stmfx->vdd)
490494 return regulator_disable(stmfx->vdd);
491495
@@ -529,6 +533,8 @@ static int stmfx_resume(struct device *dev) · 37 unmodified lines
529533 if (ret)
530534 return ret;
531535
536+ enable_irq(stmfx->irq);
537+
532538 return 0;
533539 }
534540 #endif
include/linux/mfd/stmfx.h+1−0
@@ -109,6 +109,7 @@ struct stmfx { · 108 unmodified lines
109109 struct device *dev;
110110 struct regmap *map;
111111 struct regulator *vdd;
112+ int irq;
112113 struct irq_domain *irq_domain;
113114 struct mutex lock; /* IRQ bus lock */
114115 u8 irq_src;