diff options
author | Lucas Stach <l.stach@pengutronix.de> | 2021-10-02 03:59:41 +0300 |
---|---|---|
committer | Shawn Guo <shawnguo@kernel.org> | 2021-10-06 15:13:39 +0300 |
commit | 18c98573a4cf2dc183cd884cec23869ba0c9fc1b (patch) | |
tree | 727c8723ea9d89d57a558e64845d2c009a612e3c /drivers/soc/imx/gpcv2.c | |
parent | fadf79a07b48af66e367b49c3a445a1282148fcf (diff) | |
download | linux-18c98573a4cf2dc183cd884cec23869ba0c9fc1b.tar.xz |
soc: imx: gpcv2: add domain option to keep domain clocks enabled
Some of the MIX domains are using clocks to drive the bus bridges. Those
must be enabled at all times, as long as the domain is powered up and
they don't have any other consumer than the power domain. Add an option
to keep the clocks attached to a domain enabled as long as the domain
is power up and only disable them after the domain is powered down.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Diffstat (limited to 'drivers/soc/imx/gpcv2.c')
-rw-r--r-- | drivers/soc/imx/gpcv2.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index fcea95317287..e5a98107ad56 100644 --- a/drivers/soc/imx/gpcv2.c +++ b/drivers/soc/imx/gpcv2.c @@ -202,6 +202,7 @@ struct imx_pgc_domain { } bits; const int voltage; + const bool keep_clocks; struct device *dev; }; @@ -295,7 +296,8 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd) } /* Disable reset clocks for all devices in the domain */ - clk_bulk_disable_unprepare(domain->num_clks, domain->clks); + if (!domain->keep_clocks) + clk_bulk_disable_unprepare(domain->num_clks, domain->clks); return 0; @@ -317,10 +319,12 @@ static int imx_pgc_power_down(struct generic_pm_domain *genpd) int ret; /* Enable reset clocks for all devices in the domain */ - ret = clk_bulk_prepare_enable(domain->num_clks, domain->clks); - if (ret) { - dev_err(domain->dev, "failed to enable reset clocks\n"); - return ret; + if (!domain->keep_clocks) { + ret = clk_bulk_prepare_enable(domain->num_clks, domain->clks); + if (ret) { + dev_err(domain->dev, "failed to enable reset clocks\n"); + return ret; + } } /* request the ADB400 to power down */ |