Lines Matching refs:bc

84 	struct imx93_blk_ctrl *bc;  member
104 struct imx93_blk_ctrl *bc = domain->bc; in imx93_blk_ctrl_set_qos() local
117 regmap_write_bits(bc->regmap, qos->reg, mask, val); in imx93_blk_ctrl_set_qos()
119 dev_dbg(bc->dev, "data->qos[i].reg 0x%x 0x%x\n", qos->reg, val); in imx93_blk_ctrl_set_qos()
129 struct imx93_blk_ctrl *bc = domain->bc; in imx93_blk_ctrl_power_on() local
132 ret = clk_bulk_prepare_enable(bc->num_clks, bc->clks); in imx93_blk_ctrl_power_on()
134 dev_err(bc->dev, "failed to enable bus clocks\n"); in imx93_blk_ctrl_power_on()
140 clk_bulk_disable_unprepare(bc->num_clks, bc->clks); in imx93_blk_ctrl_power_on()
141 dev_err(bc->dev, "failed to enable clocks\n"); in imx93_blk_ctrl_power_on()
145 ret = pm_runtime_get_sync(bc->dev); in imx93_blk_ctrl_power_on()
147 pm_runtime_put_noidle(bc->dev); in imx93_blk_ctrl_power_on()
148 dev_err(bc->dev, "failed to power up domain\n"); in imx93_blk_ctrl_power_on()
153 regmap_clear_bits(bc->regmap, BLK_CLK_EN, data->clk_mask); in imx93_blk_ctrl_power_on()
156 regmap_set_bits(bc->regmap, BLK_SFT_RSTN, data->rst_mask); in imx93_blk_ctrl_power_on()
158 dev_dbg(bc->dev, "pd_on: name: %s\n", genpd->name); in imx93_blk_ctrl_power_on()
165 clk_bulk_disable_unprepare(bc->num_clks, bc->clks); in imx93_blk_ctrl_power_on()
174 struct imx93_blk_ctrl *bc = domain->bc; in imx93_blk_ctrl_power_off() local
176 dev_dbg(bc->dev, "pd_off: name: %s\n", genpd->name); in imx93_blk_ctrl_power_off()
178 regmap_clear_bits(bc->regmap, BLK_SFT_RSTN, data->rst_mask); in imx93_blk_ctrl_power_off()
179 regmap_set_bits(bc->regmap, BLK_CLK_EN, data->clk_mask); in imx93_blk_ctrl_power_off()
181 pm_runtime_put(bc->dev); in imx93_blk_ctrl_power_off()
185 clk_bulk_disable_unprepare(bc->num_clks, bc->clks); in imx93_blk_ctrl_power_off()
196 struct imx93_blk_ctrl *bc; in imx93_blk_ctrl_probe() local
209 bc = devm_kzalloc(dev, sizeof(*bc), GFP_KERNEL); in imx93_blk_ctrl_probe()
210 if (!bc) in imx93_blk_ctrl_probe()
213 bc->dev = dev; in imx93_blk_ctrl_probe()
219 bc->regmap = devm_regmap_init_mmio(dev, base, &regmap_config); in imx93_blk_ctrl_probe()
220 if (IS_ERR(bc->regmap)) in imx93_blk_ctrl_probe()
221 return dev_err_probe(dev, PTR_ERR(bc->regmap), in imx93_blk_ctrl_probe()
224 bc->domains = devm_kcalloc(dev, bc_data->num_domains, in imx93_blk_ctrl_probe()
227 if (!bc->domains) in imx93_blk_ctrl_probe()
230 bc->onecell_data.num_domains = bc_data->num_domains; in imx93_blk_ctrl_probe()
231 bc->onecell_data.domains = in imx93_blk_ctrl_probe()
234 if (!bc->onecell_data.domains) in imx93_blk_ctrl_probe()
238 bc->clks[i].id = bc_data->clk_names[i]; in imx93_blk_ctrl_probe()
239 bc->num_clks = bc_data->num_clks; in imx93_blk_ctrl_probe()
241 ret = devm_clk_bulk_get(dev, bc->num_clks, bc->clks); in imx93_blk_ctrl_probe()
249 struct imx93_blk_ctrl_domain *domain = &bc->domains[i]; in imx93_blk_ctrl_probe()
266 domain->bc = bc; in imx93_blk_ctrl_probe()
287 bc->onecell_data.domains[i] = &domain->genpd; in imx93_blk_ctrl_probe()
292 ret = of_genpd_add_provider_onecell(dev->of_node, &bc->onecell_data); in imx93_blk_ctrl_probe()
298 dev_set_drvdata(dev, bc); in imx93_blk_ctrl_probe()
304 pm_genpd_remove(&bc->domains[i].genpd); in imx93_blk_ctrl_probe()
311 struct imx93_blk_ctrl *bc = dev_get_drvdata(&pdev->dev); in imx93_blk_ctrl_remove() local
316 for (i = 0; bc->onecell_data.num_domains; i++) { in imx93_blk_ctrl_remove()
317 struct imx93_blk_ctrl_domain *domain = &bc->domains[i]; in imx93_blk_ctrl_remove()