Lines Matching refs:bc

68 	struct imx8m_blk_ctrl *bc;  member
89 struct imx8m_blk_ctrl *bc = domain->bc; in imx8m_blk_ctrl_power_on() local
93 ret = pm_runtime_get_sync(bc->bus_power_dev); in imx8m_blk_ctrl_power_on()
95 pm_runtime_put_noidle(bc->bus_power_dev); in imx8m_blk_ctrl_power_on()
96 dev_err(bc->dev, "failed to power up bus domain\n"); in imx8m_blk_ctrl_power_on()
101 regmap_clear_bits(bc->regmap, BLK_SFT_RSTN, data->rst_mask); in imx8m_blk_ctrl_power_on()
103 regmap_clear_bits(bc->regmap, BLK_MIPI_RESET_DIV, data->mipi_phy_rst_mask); in imx8m_blk_ctrl_power_on()
108 dev_err(bc->dev, "failed to enable clocks\n"); in imx8m_blk_ctrl_power_on()
111 regmap_set_bits(bc->regmap, BLK_CLK_EN, data->clk_mask); in imx8m_blk_ctrl_power_on()
116 dev_err(bc->dev, "failed to power up peripheral domain\n"); in imx8m_blk_ctrl_power_on()
124 regmap_set_bits(bc->regmap, BLK_SFT_RSTN, data->rst_mask); in imx8m_blk_ctrl_power_on()
126 regmap_set_bits(bc->regmap, BLK_MIPI_RESET_DIV, data->mipi_phy_rst_mask); in imx8m_blk_ctrl_power_on()
130 dev_err(bc->dev, "failed to set icc bw\n"); in imx8m_blk_ctrl_power_on()
140 pm_runtime_put(bc->bus_power_dev); in imx8m_blk_ctrl_power_on()
149 struct imx8m_blk_ctrl *bc = domain->bc; in imx8m_blk_ctrl_power_off() local
153 regmap_clear_bits(bc->regmap, BLK_MIPI_RESET_DIV, data->mipi_phy_rst_mask); in imx8m_blk_ctrl_power_off()
155 regmap_clear_bits(bc->regmap, BLK_SFT_RSTN, data->rst_mask); in imx8m_blk_ctrl_power_off()
156 regmap_clear_bits(bc->regmap, BLK_CLK_EN, data->clk_mask); in imx8m_blk_ctrl_power_off()
162 pm_runtime_put(bc->bus_power_dev); in imx8m_blk_ctrl_power_off()
173 struct imx8m_blk_ctrl *bc; in imx8m_blk_ctrl_probe() local
183 bc = devm_kzalloc(dev, sizeof(*bc), GFP_KERNEL); in imx8m_blk_ctrl_probe()
184 if (!bc) in imx8m_blk_ctrl_probe()
187 bc->dev = dev; in imx8m_blk_ctrl_probe()
196 bc->regmap = devm_regmap_init_mmio(dev, base, &regmap_config); in imx8m_blk_ctrl_probe()
197 if (IS_ERR(bc->regmap)) in imx8m_blk_ctrl_probe()
198 return dev_err_probe(dev, PTR_ERR(bc->regmap), in imx8m_blk_ctrl_probe()
201 bc->domains = devm_kcalloc(dev, bc_data->num_domains, in imx8m_blk_ctrl_probe()
204 if (!bc->domains) in imx8m_blk_ctrl_probe()
207 bc->onecell_data.num_domains = bc_data->num_domains; in imx8m_blk_ctrl_probe()
208 bc->onecell_data.domains = in imx8m_blk_ctrl_probe()
211 if (!bc->onecell_data.domains) in imx8m_blk_ctrl_probe()
214 bc->bus_power_dev = dev_pm_domain_attach_by_name(dev, "bus"); in imx8m_blk_ctrl_probe()
215 if (IS_ERR(bc->bus_power_dev)) { in imx8m_blk_ctrl_probe()
216 if (PTR_ERR(bc->bus_power_dev) == -ENODEV) in imx8m_blk_ctrl_probe()
220 return dev_err_probe(dev, PTR_ERR(bc->bus_power_dev), in imx8m_blk_ctrl_probe()
226 struct imx8m_blk_ctrl_domain *domain = &bc->domains[i]; in imx8m_blk_ctrl_probe()
272 domain->bc = bc; in imx8m_blk_ctrl_probe()
296 bc->onecell_data.domains[i] = &domain->genpd; in imx8m_blk_ctrl_probe()
299 ret = of_genpd_add_provider_onecell(dev->of_node, &bc->onecell_data); in imx8m_blk_ctrl_probe()
305 bc->power_nb.notifier_call = bc_data->power_notifier_fn; in imx8m_blk_ctrl_probe()
306 ret = dev_pm_genpd_add_notifier(bc->bus_power_dev, &bc->power_nb); in imx8m_blk_ctrl_probe()
312 dev_set_drvdata(dev, bc); in imx8m_blk_ctrl_probe()
324 pm_genpd_remove(&bc->domains[i].genpd); in imx8m_blk_ctrl_probe()
325 dev_pm_domain_detach(bc->domains[i].power_dev, true); in imx8m_blk_ctrl_probe()
328 dev_pm_domain_detach(bc->bus_power_dev, true); in imx8m_blk_ctrl_probe()
335 struct imx8m_blk_ctrl *bc = dev_get_drvdata(&pdev->dev); in imx8m_blk_ctrl_remove() local
340 for (i = 0; bc->onecell_data.num_domains; i++) { in imx8m_blk_ctrl_remove()
341 struct imx8m_blk_ctrl_domain *domain = &bc->domains[i]; in imx8m_blk_ctrl_remove()
347 dev_pm_genpd_remove_notifier(bc->bus_power_dev); in imx8m_blk_ctrl_remove()
349 dev_pm_domain_detach(bc->bus_power_dev, true); in imx8m_blk_ctrl_remove()
357 struct imx8m_blk_ctrl *bc = dev_get_drvdata(dev); in imx8m_blk_ctrl_suspend() local
368 ret = pm_runtime_get_sync(bc->bus_power_dev); in imx8m_blk_ctrl_suspend()
370 pm_runtime_put_noidle(bc->bus_power_dev); in imx8m_blk_ctrl_suspend()
374 for (i = 0; i < bc->onecell_data.num_domains; i++) { in imx8m_blk_ctrl_suspend()
375 struct imx8m_blk_ctrl_domain *domain = &bc->domains[i]; in imx8m_blk_ctrl_suspend()
388 pm_runtime_put(bc->domains[i].power_dev); in imx8m_blk_ctrl_suspend()
390 pm_runtime_put(bc->bus_power_dev); in imx8m_blk_ctrl_suspend()
397 struct imx8m_blk_ctrl *bc = dev_get_drvdata(dev); in imx8m_blk_ctrl_resume() local
400 for (i = 0; i < bc->onecell_data.num_domains; i++) in imx8m_blk_ctrl_resume()
401 pm_runtime_put(bc->domains[i].power_dev); in imx8m_blk_ctrl_resume()
403 pm_runtime_put(bc->bus_power_dev); in imx8m_blk_ctrl_resume()
416 struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, in imx8mm_vpu_power_notifier() local
428 regmap_clear_bits(bc->regmap, BLK_SFT_RSTN, BIT(0) | BIT(1) | BIT(2)); in imx8mm_vpu_power_notifier()
429 regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(0) | BIT(1) | BIT(2)); in imx8mm_vpu_power_notifier()
440 regmap_set_bits(bc->regmap, 0x8, 0xffffffff); in imx8mm_vpu_power_notifier()
441 regmap_set_bits(bc->regmap, 0xc, 0xffffffff); in imx8mm_vpu_power_notifier()
442 regmap_set_bits(bc->regmap, 0x10, 0xffffffff); in imx8mm_vpu_power_notifier()
443 regmap_set_bits(bc->regmap, 0x14, 0xffffffff); in imx8mm_vpu_power_notifier()
526 struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, in imx8mm_disp_power_notifier() local
533 regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(12)); in imx8mm_disp_power_notifier()
534 regmap_set_bits(bc->regmap, BLK_SFT_RSTN, BIT(6)); in imx8mm_disp_power_notifier()
596 struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, in imx8mn_disp_power_notifier() local
603 regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(8)); in imx8mn_disp_power_notifier()
604 regmap_set_bits(bc->regmap, BLK_SFT_RSTN, BIT(8)); in imx8mn_disp_power_notifier()
670 struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, in imx8mp_media_power_notifier() local
677 regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(8)); in imx8mp_media_power_notifier()
678 regmap_set_bits(bc->regmap, BLK_SFT_RSTN, BIT(8)); in imx8mp_media_power_notifier()
693 regmap_set_bits(bc->regmap, LCDIF_ARCACHE_CTRL, in imx8mp_media_power_notifier()
805 struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, in imx8mq_vpu_power_notifier() local
818 regmap_set_bits(bc->regmap, BLK_SFT_RSTN, BIT(0) | BIT(1)); in imx8mq_vpu_power_notifier()
819 regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(0) | BIT(1)); in imx8mq_vpu_power_notifier()
830 regmap_set_bits(bc->regmap, 0x8, 0xffffffff); in imx8mq_vpu_power_notifier()
831 regmap_set_bits(bc->regmap, 0xc, 0xffffffff); in imx8mq_vpu_power_notifier()
832 regmap_set_bits(bc->regmap, 0x10, 0xffffffff); in imx8mq_vpu_power_notifier()