Lines Matching refs:bc
66 struct imx8m_blk_ctrl *bc; member
87 struct imx8m_blk_ctrl *bc = domain->bc; in imx8m_blk_ctrl_power_on() local
91 ret = pm_runtime_get_sync(bc->bus_power_dev); in imx8m_blk_ctrl_power_on()
93 pm_runtime_put_noidle(bc->bus_power_dev); in imx8m_blk_ctrl_power_on()
94 dev_err(bc->dev, "failed to power up bus domain\n"); in imx8m_blk_ctrl_power_on()
99 regmap_clear_bits(bc->regmap, BLK_SFT_RSTN, data->rst_mask); in imx8m_blk_ctrl_power_on()
101 regmap_clear_bits(bc->regmap, BLK_MIPI_RESET_DIV, data->mipi_phy_rst_mask); in imx8m_blk_ctrl_power_on()
106 dev_err(bc->dev, "failed to enable clocks\n"); in imx8m_blk_ctrl_power_on()
109 regmap_set_bits(bc->regmap, BLK_CLK_EN, data->clk_mask); in imx8m_blk_ctrl_power_on()
114 dev_err(bc->dev, "failed to power up peripheral domain\n"); in imx8m_blk_ctrl_power_on()
122 regmap_set_bits(bc->regmap, BLK_SFT_RSTN, data->rst_mask); in imx8m_blk_ctrl_power_on()
124 regmap_set_bits(bc->regmap, BLK_MIPI_RESET_DIV, data->mipi_phy_rst_mask); in imx8m_blk_ctrl_power_on()
128 dev_err(bc->dev, "failed to set icc bw\n"); in imx8m_blk_ctrl_power_on()
138 pm_runtime_put(bc->bus_power_dev); in imx8m_blk_ctrl_power_on()
147 struct imx8m_blk_ctrl *bc = domain->bc; in imx8m_blk_ctrl_power_off() local
151 regmap_clear_bits(bc->regmap, BLK_MIPI_RESET_DIV, data->mipi_phy_rst_mask); in imx8m_blk_ctrl_power_off()
153 regmap_clear_bits(bc->regmap, BLK_SFT_RSTN, data->rst_mask); in imx8m_blk_ctrl_power_off()
154 regmap_clear_bits(bc->regmap, BLK_CLK_EN, data->clk_mask); in imx8m_blk_ctrl_power_off()
160 pm_runtime_put(bc->bus_power_dev); in imx8m_blk_ctrl_power_off()
171 struct imx8m_blk_ctrl *bc; in imx8m_blk_ctrl_probe() local
181 bc = devm_kzalloc(dev, sizeof(*bc), GFP_KERNEL); in imx8m_blk_ctrl_probe()
182 if (!bc) in imx8m_blk_ctrl_probe()
185 bc->dev = dev; in imx8m_blk_ctrl_probe()
194 bc->regmap = devm_regmap_init_mmio(dev, base, ®map_config); in imx8m_blk_ctrl_probe()
195 if (IS_ERR(bc->regmap)) in imx8m_blk_ctrl_probe()
196 return dev_err_probe(dev, PTR_ERR(bc->regmap), in imx8m_blk_ctrl_probe()
199 bc->domains = devm_kcalloc(dev, bc_data->num_domains, in imx8m_blk_ctrl_probe()
202 if (!bc->domains) in imx8m_blk_ctrl_probe()
205 bc->onecell_data.num_domains = bc_data->num_domains; in imx8m_blk_ctrl_probe()
206 bc->onecell_data.domains = in imx8m_blk_ctrl_probe()
209 if (!bc->onecell_data.domains) in imx8m_blk_ctrl_probe()
212 bc->bus_power_dev = genpd_dev_pm_attach_by_name(dev, "bus"); in imx8m_blk_ctrl_probe()
213 if (IS_ERR(bc->bus_power_dev)) in imx8m_blk_ctrl_probe()
214 return dev_err_probe(dev, PTR_ERR(bc->bus_power_dev), in imx8m_blk_ctrl_probe()
219 struct imx8m_blk_ctrl_domain *domain = &bc->domains[i]; in imx8m_blk_ctrl_probe()
265 domain->bc = bc; in imx8m_blk_ctrl_probe()
289 bc->onecell_data.domains[i] = &domain->genpd; in imx8m_blk_ctrl_probe()
292 ret = of_genpd_add_provider_onecell(dev->of_node, &bc->onecell_data); in imx8m_blk_ctrl_probe()
298 bc->power_nb.notifier_call = bc_data->power_notifier_fn; in imx8m_blk_ctrl_probe()
299 ret = dev_pm_genpd_add_notifier(bc->bus_power_dev, &bc->power_nb); in imx8m_blk_ctrl_probe()
305 dev_set_drvdata(dev, bc); in imx8m_blk_ctrl_probe()
313 pm_genpd_remove(&bc->domains[i].genpd); in imx8m_blk_ctrl_probe()
314 dev_pm_domain_detach(bc->domains[i].power_dev, true); in imx8m_blk_ctrl_probe()
317 dev_pm_domain_detach(bc->bus_power_dev, true); in imx8m_blk_ctrl_probe()
324 struct imx8m_blk_ctrl *bc = dev_get_drvdata(&pdev->dev); in imx8m_blk_ctrl_remove() local
329 for (i = 0; bc->onecell_data.num_domains; i++) { in imx8m_blk_ctrl_remove()
330 struct imx8m_blk_ctrl_domain *domain = &bc->domains[i]; in imx8m_blk_ctrl_remove()
336 dev_pm_genpd_remove_notifier(bc->bus_power_dev); in imx8m_blk_ctrl_remove()
338 dev_pm_domain_detach(bc->bus_power_dev, true); in imx8m_blk_ctrl_remove()
346 struct imx8m_blk_ctrl *bc = dev_get_drvdata(dev); in imx8m_blk_ctrl_suspend() local
357 ret = pm_runtime_get_sync(bc->bus_power_dev); in imx8m_blk_ctrl_suspend()
359 pm_runtime_put_noidle(bc->bus_power_dev); in imx8m_blk_ctrl_suspend()
363 for (i = 0; i < bc->onecell_data.num_domains; i++) { in imx8m_blk_ctrl_suspend()
364 struct imx8m_blk_ctrl_domain *domain = &bc->domains[i]; in imx8m_blk_ctrl_suspend()
377 pm_runtime_put(bc->domains[i].power_dev); in imx8m_blk_ctrl_suspend()
379 pm_runtime_put(bc->bus_power_dev); in imx8m_blk_ctrl_suspend()
386 struct imx8m_blk_ctrl *bc = dev_get_drvdata(dev); in imx8m_blk_ctrl_resume() local
389 for (i = 0; i < bc->onecell_data.num_domains; i++) in imx8m_blk_ctrl_resume()
390 pm_runtime_put(bc->domains[i].power_dev); in imx8m_blk_ctrl_resume()
392 pm_runtime_put(bc->bus_power_dev); in imx8m_blk_ctrl_resume()
405 struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, in imx8mm_vpu_power_notifier() local
417 regmap_clear_bits(bc->regmap, BLK_SFT_RSTN, BIT(0) | BIT(1) | BIT(2)); in imx8mm_vpu_power_notifier()
418 regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(0) | BIT(1) | BIT(2)); in imx8mm_vpu_power_notifier()
429 regmap_set_bits(bc->regmap, 0x8, 0xffffffff); in imx8mm_vpu_power_notifier()
430 regmap_set_bits(bc->regmap, 0xc, 0xffffffff); in imx8mm_vpu_power_notifier()
431 regmap_set_bits(bc->regmap, 0x10, 0xffffffff); in imx8mm_vpu_power_notifier()
432 regmap_set_bits(bc->regmap, 0x14, 0xffffffff); in imx8mm_vpu_power_notifier()
515 struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, in imx8mm_disp_power_notifier() local
522 regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(12)); in imx8mm_disp_power_notifier()
523 regmap_set_bits(bc->regmap, BLK_SFT_RSTN, BIT(6)); in imx8mm_disp_power_notifier()
585 struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, in imx8mn_disp_power_notifier() local
592 regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(8)); in imx8mn_disp_power_notifier()
593 regmap_set_bits(bc->regmap, BLK_SFT_RSTN, BIT(8)); in imx8mn_disp_power_notifier()
655 struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, in imx8mp_media_power_notifier() local
662 regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(8)); in imx8mp_media_power_notifier()
663 regmap_set_bits(bc->regmap, BLK_SFT_RSTN, BIT(8)); in imx8mp_media_power_notifier()
780 struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, in imx8mq_vpu_power_notifier() local
793 regmap_set_bits(bc->regmap, BLK_SFT_RSTN, BIT(0) | BIT(1)); in imx8mq_vpu_power_notifier()
794 regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(0) | BIT(1)); in imx8mq_vpu_power_notifier()
805 regmap_set_bits(bc->regmap, 0x8, 0xffffffff); in imx8mq_vpu_power_notifier()
806 regmap_set_bits(bc->regmap, 0xc, 0xffffffff); in imx8mq_vpu_power_notifier()
807 regmap_set_bits(bc->regmap, 0x10, 0xffffffff); in imx8mq_vpu_power_notifier()