diff mbox series

[1/3] mfd: stmfx: reset chip on resume as supply was disabled

Message ID 20200422090833.9743-2-amelie.delaunay@st.com (mailing list archive)
State Mainlined
Commit e583649d87ec090444aa5347af0927cd6e8581ae
Headers show
Series STMFX power related fixes | expand

Commit Message

Amelie Delaunay April 22, 2020, 9:08 a.m. UTC
STMFX supply is disabled during suspend. To avoid a too early access to
the STMFX firmware on resume, reset the chip and wait for its firmware to
be loaded.

Fixes: 06252ade9156 ("mfd: Add ST Multi-Function eXpander (STMFX) core driver")
Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
---
 drivers/mfd/stmfx.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Lee Jones May 26, 2020, 7:57 a.m. UTC | #1
On Wed, 22 Apr 2020, Amelie Delaunay wrote:

> STMFX supply is disabled during suspend. To avoid a too early access to
> the STMFX firmware on resume, reset the chip and wait for its firmware to
> be loaded.
> 
> Fixes: 06252ade9156 ("mfd: Add ST Multi-Function eXpander (STMFX) core driver")
> Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
> ---
>  drivers/mfd/stmfx.c | 7 +++++++
>  1 file changed, 7 insertions(+)

Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/mfd/stmfx.c b/drivers/mfd/stmfx.c
index 857991cb3cbb..fde6541e347c 100644
--- a/drivers/mfd/stmfx.c
+++ b/drivers/mfd/stmfx.c
@@ -501,6 +501,13 @@  static int stmfx_resume(struct device *dev)
 		}
 	}
 
+	/* Reset STMFX - supply has been stopped during suspend */
+	ret = stmfx_chip_reset(stmfx);
+	if (ret) {
+		dev_err(stmfx->dev, "Failed to reset chip: %d\n", ret);
+		return ret;
+	}
+
 	ret = regmap_raw_write(stmfx->map, STMFX_REG_SYS_CTRL,
 			       &stmfx->bkp_sysctrl, sizeof(stmfx->bkp_sysctrl));
 	if (ret)