diff options
author | Tony Lindgren <tony@atomide.com> | 2021-09-21 12:42:25 +0300 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2021-09-21 12:50:38 +0300 |
commit | 6a52bc2b81fa06b7ab98472c7d80644e8e071af6 (patch) | |
tree | 986eb5fc8d85362ca3ed1bf921f05cd83e603f91 /drivers/bus | |
parent | 9d881361206ebcf6285c2ec2ef275aff80875347 (diff) |
bus: ti-sysc: Add quirk handling for reset on re-init
At least am335x gpmc module needs a reset in addition to re-init on resume.
Let's add a quirk handling for reset on re-init.
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'drivers/bus')
-rw-r--r-- | drivers/bus/ti-sysc.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index a73c707d14c3..cacdc4e301fb 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -157,6 +157,7 @@ struct sysc { static void sysc_parse_dts_quirks(struct sysc *ddata, struct device_node *np, bool is_child); +static int sysc_reset(struct sysc *ddata); static void sysc_write(struct sysc *ddata, int offset, u32 value) { @@ -1440,6 +1441,15 @@ static int sysc_reinit_module(struct sysc *ddata, bool leave_enabled) if (error) dev_warn(dev, "reinit resume failed: %i\n", error); + /* Some modules like am335x gpmc need reset and restore of sysconfig */ + if (ddata->cfg.quirks & SYSC_QUIRK_RESET_ON_CTX_LOST) { + error = sysc_reset(ddata); + if (error) + dev_warn(dev, "reinit reset failed: %i\n", error); + + sysc_write_sysconfig(ddata, ddata->sysconfig); + } + if (leave_enabled) return error; |