summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/stmfx.c
diff options
context:
space:
mode:
authorAmelie Delaunay <amelie.delaunay@st.com>2020-04-22 11:08:31 +0200
committerLee Jones <lee.jones@linaro.org>2020-05-26 10:51:20 +0100
commite583649d87ec090444aa5347af0927cd6e8581ae (patch)
treeac6530a4749ad3f55a41aa69f8e837cc16065eae /drivers/mfd/stmfx.c
parent7ff864e1ad343dc0960f454a58af48883c5f0f5d (diff)
downloadlinux-e583649d87ec090444aa5347af0927cd6e8581ae.tar.bz2
mfd: stmfx: Reset chip on resume as supply was disabled
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> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/stmfx.c')
-rw-r--r--drivers/mfd/stmfx.c7
1 files changed, 7 insertions, 0 deletions
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)