diff options
author | Lucas Stach <l.stach@pengutronix.de> | 2017-04-05 15:19:07 +0200 |
---|---|---|
committer | Shawn Guo <shawnguo@kernel.org> | 2017-04-07 20:47:24 +0800 |
commit | 7c42af783ab817f40a8cfb9aef05b6fb92b780b3 (patch) | |
tree | c3cd0e94d1152daebaec476261fa87ebd4bef9a4 /drivers/soc/imx/gpc.c | |
parent | 03aa12629fc4f73acf28e519c9ee9cb1f5dd3706 (diff) |
soc: imx: gpc: add defines for domain index
Makes referencing a specfic domain in the driver code
less error prone.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Diffstat (limited to 'drivers/soc/imx/gpc.c')
-rw-r--r-- | drivers/soc/imx/gpc.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c index 4294287e5f6c..d4ebb325b558 100644 --- a/drivers/soc/imx/gpc.c +++ b/drivers/soc/imx/gpc.c @@ -235,6 +235,10 @@ static struct platform_driver imx_pgc_power_domain_driver = { }; builtin_platform_driver(imx_pgc_power_domain_driver) +#define GPC_PGC_DOMAIN_ARM 0 +#define GPC_PGC_DOMAIN_PU 1 +#define GPC_PGC_DOMAIN_DISPLAY 2 + static struct genpd_power_state imx6_pm_domain_pu_state = { .power_off_latency_ns = 25000, .power_on_latency_ns = 2000000, @@ -340,7 +344,7 @@ static int imx_gpc_old_dt_init(struct device *dev, struct regmap *regmap, genpd_err: for (i = 0; i < num_domains; i++) pm_genpd_remove(&imx_gpc_domains[i].base); - imx_pgc_put_clocks(&imx_gpc_domains[1]); + imx_pgc_put_clocks(&imx_gpc_domains[GPC_PGC_DOMAIN_PU]); clk_err: return ret; } @@ -441,12 +445,12 @@ static int imx_gpc_remove(struct platform_device *pdev) if (!of_get_child_by_name(pdev->dev.of_node, "pgc")) { of_genpd_del_provider(pdev->dev.of_node); - ret = pm_genpd_remove(&imx_gpc_domains[1].base); + ret = pm_genpd_remove(&imx_gpc_domains[GPC_PGC_DOMAIN_PU].base); if (ret) return ret; - imx_pgc_put_clocks(&imx_gpc_domains[1]); + imx_pgc_put_clocks(&imx_gpc_domains[GPC_PGC_DOMAIN_PU]); - ret = pm_genpd_remove(&imx_gpc_domains[0].base); + ret = pm_genpd_remove(&imx_gpc_domains[GPC_PGC_DOMAIN_ARM].base); if (ret) return ret; } |