Lines Matching refs:domain
38 struct imx93_power_domain *domain = to_imx93_pd(genpd); in imx93_pd_on() local
39 void __iomem *addr = domain->addr; in imx93_pd_on()
43 ret = clk_bulk_prepare_enable(domain->num_clks, domain->clks); in imx93_pd_on()
45 dev_err(domain->dev, "failed to enable clocks for domain: %s\n", genpd->name); in imx93_pd_on()
56 dev_err(domain->dev, "pd_on timeout: name: %s, stat: %x\n", genpd->name, val); in imx93_pd_on()
65 struct imx93_power_domain *domain = to_imx93_pd(genpd); in imx93_pd_off() local
66 void __iomem *addr = domain->addr; in imx93_pd_off()
78 dev_err(domain->dev, "pd_off timeout: name: %s, stat: %x\n", genpd->name, val); in imx93_pd_off()
82 clk_bulk_disable_unprepare(domain->num_clks, domain->clks); in imx93_pd_off()
89 struct imx93_power_domain *domain = platform_get_drvdata(pdev); in imx93_pd_remove() local
93 if (!domain->init_off) in imx93_pd_remove()
94 clk_bulk_disable_unprepare(domain->num_clks, domain->clks); in imx93_pd_remove()
97 pm_genpd_remove(&domain->genpd); in imx93_pd_remove()
106 struct imx93_power_domain *domain; in imx93_pd_probe() local
109 domain = devm_kzalloc(dev, sizeof(*domain), GFP_KERNEL); in imx93_pd_probe()
110 if (!domain) in imx93_pd_probe()
113 domain->addr = devm_platform_ioremap_resource(pdev, 0); in imx93_pd_probe()
114 if (IS_ERR(domain->addr)) in imx93_pd_probe()
115 return PTR_ERR(domain->addr); in imx93_pd_probe()
117 domain->num_clks = devm_clk_bulk_get_all(dev, &domain->clks); in imx93_pd_probe()
118 if (domain->num_clks < 0) in imx93_pd_probe()
119 return dev_err_probe(dev, domain->num_clks, "Failed to get domain's clocks\n"); in imx93_pd_probe()
121 domain->genpd.name = dev_name(dev); in imx93_pd_probe()
122 domain->genpd.power_off = imx93_pd_off; in imx93_pd_probe()
123 domain->genpd.power_on = imx93_pd_on; in imx93_pd_probe()
124 domain->dev = dev; in imx93_pd_probe()
126 domain->init_off = readl(domain->addr + MIX_FUNC_STAT_OFF) & FUNC_STAT_ISO_STAT_MASK; in imx93_pd_probe()
128 if (!domain->init_off) { in imx93_pd_probe()
129 ret = clk_bulk_prepare_enable(domain->num_clks, domain->clks); in imx93_pd_probe()
131 dev_err(domain->dev, "failed to enable clocks for domain: %s\n", in imx93_pd_probe()
132 domain->genpd.name); in imx93_pd_probe()
137 ret = pm_genpd_init(&domain->genpd, NULL, domain->init_off); in imx93_pd_probe()
141 platform_set_drvdata(pdev, domain); in imx93_pd_probe()
143 ret = of_genpd_add_provider_simple(np, &domain->genpd); in imx93_pd_probe()
150 pm_genpd_remove(&domain->genpd); in imx93_pd_probe()
153 if (!domain->init_off) in imx93_pd_probe()
154 clk_bulk_disable_unprepare(domain->num_clks, domain->clks); in imx93_pd_probe()