Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Amelie Delaunay and committed by
Lee Jones
97eda5dc 60c2c4bc

+7
+6
drivers/mfd/stmfx.c
··· 296 296 if (ret) 297 297 goto irq_exit; 298 298 299 + stmfx->irq = client->irq; 300 + 299 301 return 0; 300 302 301 303 irq_exit: ··· 488 486 if (ret) 489 487 return ret; 490 488 489 + disable_irq(stmfx->irq); 490 + 491 491 if (stmfx->vdd) 492 492 return regulator_disable(stmfx->vdd); 493 493 ··· 532 528 &stmfx->irq_src, sizeof(stmfx->irq_src)); 533 529 if (ret) 534 530 return ret; 531 + 532 + enable_irq(stmfx->irq); 535 533 536 534 return 0; 537 535 }
+1
include/linux/mfd/stmfx.h
··· 109 109 struct device *dev; 110 110 struct regmap *map; 111 111 struct regulator *vdd; 112 + int irq; 112 113 struct irq_domain *irq_domain; 113 114 struct mutex lock; /* IRQ bus lock */ 114 115 u8 irq_src;