Lines Matching refs:domain

130 static int imx_pgc_get_clocks(struct device *dev, struct imx_pm_domain *domain)  in imx_pgc_get_clocks()  argument
143 domain->clk[i] = clk; in imx_pgc_get_clocks()
145 domain->num_clks = i; in imx_pgc_get_clocks()
151 clk_put(domain->clk[i]); in imx_pgc_get_clocks()
156 static void imx_pgc_put_clocks(struct imx_pm_domain *domain) in imx_pgc_put_clocks() argument
160 for (i = domain->num_clks - 1; i >= 0; i--) in imx_pgc_put_clocks()
161 clk_put(domain->clk[i]); in imx_pgc_put_clocks()
164 static int imx_pgc_parse_dt(struct device *dev, struct imx_pm_domain *domain) in imx_pgc_parse_dt() argument
167 domain->supply = devm_regulator_get_optional(dev, "power"); in imx_pgc_parse_dt()
168 if (IS_ERR(domain->supply)) { in imx_pgc_parse_dt()
169 if (PTR_ERR(domain->supply) == -ENODEV) in imx_pgc_parse_dt()
170 domain->supply = NULL; in imx_pgc_parse_dt()
172 return PTR_ERR(domain->supply); in imx_pgc_parse_dt()
176 return imx_pgc_get_clocks(dev, domain); in imx_pgc_parse_dt()
181 struct imx_pm_domain *domain = pdev->dev.platform_data; in imx_pgc_power_domain_probe() local
187 ret = imx_pgc_parse_dt(dev, domain); in imx_pgc_power_domain_probe()
193 if (domain->base.power_on) in imx_pgc_power_domain_probe()
194 domain->base.power_on(&domain->base); in imx_pgc_power_domain_probe()
197 pm_genpd_init(&domain->base, NULL, false); in imx_pgc_power_domain_probe()
198 ret = of_genpd_add_provider_simple(dev->of_node, &domain->base); in imx_pgc_power_domain_probe()
208 pm_genpd_remove(&domain->base); in imx_pgc_power_domain_probe()
209 imx_pgc_put_clocks(domain); in imx_pgc_power_domain_probe()
216 struct imx_pm_domain *domain = pdev->dev.platform_data; in imx_pgc_power_domain_remove() local
220 pm_genpd_remove(&domain->base); in imx_pgc_power_domain_remove()
221 imx_pgc_put_clocks(domain); in imx_pgc_power_domain_remove()
363 struct imx_pm_domain *domain; in imx_gpc_old_dt_init() local
367 domain = &imx_gpc_domains[i]; in imx_gpc_old_dt_init()
368 domain->regmap = regmap; in imx_gpc_old_dt_init()
369 domain->ipg_rate_mhz = 66; in imx_gpc_old_dt_init()
372 domain->supply = devm_regulator_get(dev, "pu"); in imx_gpc_old_dt_init()
373 if (IS_ERR(domain->supply)) in imx_gpc_old_dt_init()
374 return PTR_ERR(domain->supply); in imx_gpc_old_dt_init()
376 ret = imx_pgc_get_clocks(dev, domain); in imx_gpc_old_dt_init()
380 domain->base.power_on(&domain->base); in imx_gpc_old_dt_init()
459 struct imx_pm_domain *domain; in imx_gpc_probe() local
495 domain = pd_pdev->dev.platform_data; in imx_gpc_probe()
496 domain->regmap = regmap; in imx_gpc_probe()
497 domain->ipg_rate_mhz = ipg_rate_mhz; in imx_gpc_probe()