Lines Matching refs:domain
131 static int imx_pgc_get_clocks(struct device *dev, struct imx_pm_domain *domain) in imx_pgc_get_clocks() argument
144 domain->clk[i] = clk; in imx_pgc_get_clocks()
146 domain->num_clks = i; in imx_pgc_get_clocks()
152 clk_put(domain->clk[i]); in imx_pgc_get_clocks()
157 static void imx_pgc_put_clocks(struct imx_pm_domain *domain) in imx_pgc_put_clocks() argument
161 for (i = domain->num_clks - 1; i >= 0; i--) in imx_pgc_put_clocks()
162 clk_put(domain->clk[i]); in imx_pgc_put_clocks()
165 static int imx_pgc_parse_dt(struct device *dev, struct imx_pm_domain *domain) in imx_pgc_parse_dt() argument
168 domain->supply = devm_regulator_get_optional(dev, "power"); in imx_pgc_parse_dt()
169 if (IS_ERR(domain->supply)) { in imx_pgc_parse_dt()
170 if (PTR_ERR(domain->supply) == -ENODEV) in imx_pgc_parse_dt()
171 domain->supply = NULL; in imx_pgc_parse_dt()
173 return PTR_ERR(domain->supply); in imx_pgc_parse_dt()
177 return imx_pgc_get_clocks(dev, domain); in imx_pgc_parse_dt()
182 struct imx_pm_domain *domain = pdev->dev.platform_data; in imx_pgc_power_domain_probe() local
188 ret = imx_pgc_parse_dt(dev, domain); in imx_pgc_power_domain_probe()
194 if (domain->base.power_on) in imx_pgc_power_domain_probe()
195 domain->base.power_on(&domain->base); in imx_pgc_power_domain_probe()
198 pm_genpd_init(&domain->base, NULL, false); in imx_pgc_power_domain_probe()
199 ret = of_genpd_add_provider_simple(dev->of_node, &domain->base); in imx_pgc_power_domain_probe()
209 pm_genpd_remove(&domain->base); in imx_pgc_power_domain_probe()
210 imx_pgc_put_clocks(domain); in imx_pgc_power_domain_probe()
217 struct imx_pm_domain *domain = pdev->dev.platform_data; in imx_pgc_power_domain_remove() local
221 pm_genpd_remove(&domain->base); in imx_pgc_power_domain_remove()
222 imx_pgc_put_clocks(domain); in imx_pgc_power_domain_remove()
362 struct imx_pm_domain *domain; in imx_gpc_old_dt_init() local
366 domain = &imx_gpc_domains[i]; in imx_gpc_old_dt_init()
367 domain->regmap = regmap; in imx_gpc_old_dt_init()
368 domain->ipg_rate_mhz = 66; in imx_gpc_old_dt_init()
371 domain->supply = devm_regulator_get(dev, "pu"); in imx_gpc_old_dt_init()
372 if (IS_ERR(domain->supply)) in imx_gpc_old_dt_init()
373 return PTR_ERR(domain->supply); in imx_gpc_old_dt_init()
375 ret = imx_pgc_get_clocks(dev, domain); in imx_gpc_old_dt_init()
379 domain->base.power_on(&domain->base); in imx_gpc_old_dt_init()
456 struct imx_pm_domain *domain; in imx_gpc_probe() local
487 domain = pd_pdev->dev.platform_data; in imx_gpc_probe()
488 domain->regmap = regmap; in imx_gpc_probe()
489 domain->ipg_rate_mhz = ipg_rate_mhz; in imx_gpc_probe()