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
296 if (ret)296 if (ret)
297 goto irq_exit;297 goto irq_exit;
298 298
299 stmfx->irq = client->irq;
300
299 return 0;301 return 0;
300 302
301irq_exit:303irq_exit:
@@ -486,6 +488,8 @@ static int stmfx_suspend(struct device *dev) · 184 unmodified lines
486 if (ret)488 if (ret)
487 return ret;489 return ret;
488 490
491 disable_irq(stmfx->irq);
492
489 if (stmfx->vdd)493 if (stmfx->vdd)
490 return regulator_disable(stmfx->vdd);494 return regulator_disable(stmfx->vdd);
491 495
@@ -529,6 +533,8 @@ static int stmfx_resume(struct device *dev) · 37 unmodified lines
529 if (ret)533 if (ret)
530 return ret;534 return ret;
531 535
536 enable_irq(stmfx->irq);
537
532 return 0;538 return 0;
533}539}
534#endif540#endif
include/linux/mfd/stmfx.h+1−0
@@ -109,6 +109,7 @@ struct stmfx { · 108 unmodified lines
109 struct device *dev;109 struct device *dev;
110 struct regmap *map;110 struct regmap *map;
111 struct regulator *vdd;111 struct regulator *vdd;
112 int irq;
112 struct irq_domain *irq_domain;113 struct irq_domain *irq_domain;
113 struct mutex lock; /* IRQ bus lock */114 struct mutex lock; /* IRQ bus lock */
114 u8 irq_src;115 u8 irq_src;