]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
mfd: stmfx: Reset chip on resume as supply was disabled
authorAmelie Delaunay <amelie.delaunay@st.com>
Wed, 22 Apr 2020 09:08:31 +0000 (11:08 +0200)
committerKhalid Elmously <khalid.elmously@canonical.com>
Sat, 8 Aug 2020 05:53:12 +0000 (01:53 -0400)
BugLink: https://bugs.launchpad.net/bugs/1885322
[ Upstream commit e583649d87ec090444aa5347af0927cd6e8581ae ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/mfd/stmfx.c

index 857991cb3cbb8b5a890514a24d0b3e7d2e0467c0..fde6541e347c8aef52e011c0188312200f07f33f 100644 (file)
@@ -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)