Lines Matching defs:bc

68 	struct imx8m_blk_ctrl *bc;
89 struct imx8m_blk_ctrl *bc = domain->bc;
93 ret = pm_runtime_get_sync(bc->bus_power_dev);
95 pm_runtime_put_noidle(bc->bus_power_dev);
96 dev_err(bc->dev, "failed to power up bus domain\n");
101 regmap_clear_bits(bc->regmap, BLK_SFT_RSTN, data->rst_mask);
103 regmap_clear_bits(bc->regmap, BLK_MIPI_RESET_DIV, data->mipi_phy_rst_mask);
108 dev_err(bc->dev, "failed to enable clocks\n");
111 regmap_set_bits(bc->regmap, BLK_CLK_EN, data->clk_mask);
116 dev_err(bc->dev, "failed to power up peripheral domain\n");
124 regmap_set_bits(bc->regmap, BLK_SFT_RSTN, data->rst_mask);
126 regmap_set_bits(bc->regmap, BLK_MIPI_RESET_DIV, data->mipi_phy_rst_mask);
130 dev_err(bc->dev, "failed to set icc bw\n");
140 pm_runtime_put(bc->bus_power_dev);
149 struct imx8m_blk_ctrl *bc = domain->bc;
153 regmap_clear_bits(bc->regmap, BLK_MIPI_RESET_DIV, data->mipi_phy_rst_mask);
155 regmap_clear_bits(bc->regmap, BLK_SFT_RSTN, data->rst_mask);
156 regmap_clear_bits(bc->regmap, BLK_CLK_EN, data->clk_mask);
162 pm_runtime_put(bc->bus_power_dev);
173 struct imx8m_blk_ctrl *bc;
183 bc = devm_kzalloc(dev, sizeof(*bc), GFP_KERNEL);
184 if (!bc)
187 bc->dev = dev;
196 bc->regmap = devm_regmap_init_mmio(dev, base, &regmap_config);
197 if (IS_ERR(bc->regmap))
198 return dev_err_probe(dev, PTR_ERR(bc->regmap),
201 bc->domains = devm_kcalloc(dev, bc_data->num_domains,
204 if (!bc->domains)
207 bc->onecell_data.num_domains = bc_data->num_domains;
208 bc->onecell_data.domains =
211 if (!bc->onecell_data.domains)
214 bc->bus_power_dev = dev_pm_domain_attach_by_name(dev, "bus");
215 if (IS_ERR(bc->bus_power_dev)) {
216 if (PTR_ERR(bc->bus_power_dev) == -ENODEV)
220 return dev_err_probe(dev, PTR_ERR(bc->bus_power_dev),
226 struct imx8m_blk_ctrl_domain *domain = &bc->domains[i];
275 domain->bc = bc;
299 bc->onecell_data.domains[i] = &domain->genpd;
302 ret = of_genpd_add_provider_onecell(dev->of_node, &bc->onecell_data);
308 bc->power_nb.notifier_call = bc_data->power_notifier_fn;
309 ret = dev_pm_genpd_add_notifier(bc->bus_power_dev, &bc->power_nb);
315 dev_set_drvdata(dev, bc);
327 pm_genpd_remove(&bc->domains[i].genpd);
328 dev_pm_domain_detach(bc->domains[i].power_dev, true);
331 dev_pm_domain_detach(bc->bus_power_dev, true);
338 struct imx8m_blk_ctrl *bc = dev_get_drvdata(&pdev->dev);
343 for (i = 0; bc->onecell_data.num_domains; i++) {
344 struct imx8m_blk_ctrl_domain *domain = &bc->domains[i];
350 dev_pm_genpd_remove_notifier(bc->bus_power_dev);
352 dev_pm_domain_detach(bc->bus_power_dev, true);
358 struct imx8m_blk_ctrl *bc = dev_get_drvdata(dev);
369 ret = pm_runtime_get_sync(bc->bus_power_dev);
371 pm_runtime_put_noidle(bc->bus_power_dev);
375 for (i = 0; i < bc->onecell_data.num_domains; i++) {
376 struct imx8m_blk_ctrl_domain *domain = &bc->domains[i];
389 pm_runtime_put(bc->domains[i].power_dev);
391 pm_runtime_put(bc->bus_power_dev);
398 struct imx8m_blk_ctrl *bc = dev_get_drvdata(dev);
401 for (i = 0; i < bc->onecell_data.num_domains; i++)
402 pm_runtime_put(bc->domains[i].power_dev);
404 pm_runtime_put(bc->bus_power_dev);
417 struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl,
429 regmap_clear_bits(bc->regmap, BLK_SFT_RSTN, BIT(0) | BIT(1) | BIT(2));
430 regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(0) | BIT(1) | BIT(2));
441 regmap_set_bits(bc->regmap, 0x8, 0xffffffff);
442 regmap_set_bits(bc->regmap, 0xc, 0xffffffff);
443 regmap_set_bits(bc->regmap, 0x10, 0xffffffff);
444 regmap_set_bits(bc->regmap, 0x14, 0xffffffff);
527 struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl,
534 regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(12));
535 regmap_set_bits(bc->regmap, BLK_SFT_RSTN, BIT(6));
597 struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl,
604 regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(8));
605 regmap_set_bits(bc->regmap, BLK_SFT_RSTN, BIT(8));
671 struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl,
678 regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(8));
679 regmap_set_bits(bc->regmap, BLK_SFT_RSTN, BIT(8));
694 regmap_set_bits(bc->regmap, LCDIF_ARCACHE_CTRL,
806 struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl,
819 regmap_set_bits(bc->regmap, BLK_SFT_RSTN, BIT(0) | BIT(1));
820 regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(0) | BIT(1));
831 regmap_set_bits(bc->regmap, 0x8, 0xffffffff);
832 regmap_set_bits(bc->regmap, 0xc, 0xffffffff);
833 regmap_set_bits(bc->regmap, 0x10, 0xffffffff);