Skip to content

Commit 97eda5d

Browse files
ADESTMLee Jones
authored andcommitted
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: 06252ad ("mfd: Add ST Multi-Function eXpander (STMFX) core driver") Signed-off-by: Amelie Delaunay <[email protected]> Signed-off-by: Lee Jones <[email protected]>
1 parent 60c2c4b commit 97eda5d

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

drivers/mfd/stmfx.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@ static int stmfx_irq_init(struct i2c_client *client)
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)
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)
529533
if (ret)
530534
return ret;
531535

536+
enable_irq(stmfx->irq);
537+
532538
return 0;
533539
}
534540
#endif

include/linux/mfd/stmfx.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ struct stmfx {
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;

0 commit comments

Comments
 (0)