Lines Matching full: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, ®map_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()
275 domain->bc = bc; in imx8m_blk_ctrl_probe()
299 bc->onecell_data.domains[i] = &domain->genpd; in imx8m_blk_ctrl_probe()
302 ret = of_genpd_add_provider_onecell(dev->of_node, &bc->onecell_data); in imx8m_blk_ctrl_probe()
308 bc->power_nb.notifier_call = bc_data->power_notifier_fn; in imx8m_blk_ctrl_probe()
309 ret = dev_pm_genpd_add_notifier(bc->bus_power_dev, &bc->power_nb); in imx8m_blk_ctrl_probe()
315 dev_set_drvdata(dev, bc); in imx8m_blk_ctrl_probe()
327 pm_genpd_remove(&bc->domains[i].genpd); in imx8m_blk_ctrl_probe()
328 dev_pm_domain_detach(bc->domains[i].power_dev, true); in imx8m_blk_ctrl_probe()
331 dev_pm_domain_detach(bc->bus_power_dev, true); in imx8m_blk_ctrl_probe()
338 struct imx8m_blk_ctrl *bc = dev_get_drvdata(&pdev->dev); in imx8m_blk_ctrl_remove() local
343 for (i = 0; bc->onecell_data.num_domains; i++) { in imx8m_blk_ctrl_remove()
344 struct imx8m_blk_ctrl_domain *domain = &bc->domains[i]; in imx8m_blk_ctrl_remove()
350 dev_pm_genpd_remove_notifier(bc->bus_power_dev); in imx8m_blk_ctrl_remove()
352 dev_pm_domain_detach(bc->bus_power_dev, true); in imx8m_blk_ctrl_remove()
358 struct imx8m_blk_ctrl *bc = dev_get_drvdata(dev); in imx8m_blk_ctrl_suspend() local
369 ret = pm_runtime_get_sync(bc->bus_power_dev); in imx8m_blk_ctrl_suspend()
371 pm_runtime_put_noidle(bc->bus_power_dev); in imx8m_blk_ctrl_suspend()
375 for (i = 0; i < bc->onecell_data.num_domains; i++) { in imx8m_blk_ctrl_suspend()
376 struct imx8m_blk_ctrl_domain *domain = &bc->domains[i]; in imx8m_blk_ctrl_suspend()
389 pm_runtime_put(bc->domains[i].power_dev); in imx8m_blk_ctrl_suspend()
391 pm_runtime_put(bc->bus_power_dev); in imx8m_blk_ctrl_suspend()
398 struct imx8m_blk_ctrl *bc = dev_get_drvdata(dev); in imx8m_blk_ctrl_resume() local
401 for (i = 0; i < bc->onecell_data.num_domains; i++) in imx8m_blk_ctrl_resume()
402 pm_runtime_put(bc->domains[i].power_dev); in imx8m_blk_ctrl_resume()
404 pm_runtime_put(bc->bus_power_dev); in imx8m_blk_ctrl_resume()
417 struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, in imx8mm_vpu_power_notifier() local
429 regmap_clear_bits(bc->regmap, BLK_SFT_RSTN, BIT(0) | BIT(1) | BIT(2)); in imx8mm_vpu_power_notifier()
430 regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(0) | BIT(1) | BIT(2)); in imx8mm_vpu_power_notifier()
441 regmap_set_bits(bc->regmap, 0x8, 0xffffffff); in imx8mm_vpu_power_notifier()
442 regmap_set_bits(bc->regmap, 0xc, 0xffffffff); in imx8mm_vpu_power_notifier()
443 regmap_set_bits(bc->regmap, 0x10, 0xffffffff); in imx8mm_vpu_power_notifier()
444 regmap_set_bits(bc->regmap, 0x14, 0xffffffff); in imx8mm_vpu_power_notifier()
527 struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, in imx8mm_disp_power_notifier() local
534 regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(12)); in imx8mm_disp_power_notifier()
535 regmap_set_bits(bc->regmap, BLK_SFT_RSTN, BIT(6)); in imx8mm_disp_power_notifier()
597 struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, in imx8mn_disp_power_notifier() local
604 regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(8)); in imx8mn_disp_power_notifier()
605 regmap_set_bits(bc->regmap, BLK_SFT_RSTN, BIT(8)); in imx8mn_disp_power_notifier()
671 struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, in imx8mp_media_power_notifier() local
678 regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(8)); in imx8mp_media_power_notifier()
679 regmap_set_bits(bc->regmap, BLK_SFT_RSTN, BIT(8)); in imx8mp_media_power_notifier()
694 regmap_set_bits(bc->regmap, LCDIF_ARCACHE_CTRL, in imx8mp_media_power_notifier()
806 struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, in imx8mq_vpu_power_notifier() local
819 regmap_set_bits(bc->regmap, BLK_SFT_RSTN, BIT(0) | BIT(1)); in imx8mq_vpu_power_notifier()
820 regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(0) | BIT(1)); in imx8mq_vpu_power_notifier()
831 regmap_set_bits(bc->regmap, 0x8, 0xffffffff); in imx8mq_vpu_power_notifier()
832 regmap_set_bits(bc->regmap, 0xc, 0xffffffff); in imx8mq_vpu_power_notifier()
833 regmap_set_bits(bc->regmap, 0x10, 0xffffffff); in imx8mq_vpu_power_notifier()