Lines Matching +full:lcdif +full:- +full:axi
1 // SPDX-License-Identifier: GPL-2.0
16 #include <dt-bindings/power/fsl,imx93-power.h>
103 const struct imx93_blk_ctrl_domain_data *data = domain->data; in imx93_blk_ctrl_set_qos()
104 struct imx93_blk_ctrl *bc = domain->bc; in imx93_blk_ctrl_set_qos()
109 for (i = 0; i < data->num_qos; i++) { in imx93_blk_ctrl_set_qos()
110 qos = &data->qos[i]; in imx93_blk_ctrl_set_qos()
112 mask = PRIO_MASK << qos->cfg_off; in imx93_blk_ctrl_set_qos()
113 mask |= PRIO_MASK << (qos->cfg_off + 4); in imx93_blk_ctrl_set_qos()
114 val = qos->cfg_prio << qos->cfg_off; in imx93_blk_ctrl_set_qos()
115 val |= qos->default_prio << (qos->cfg_off + 4); in imx93_blk_ctrl_set_qos()
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()
128 const struct imx93_blk_ctrl_domain_data *data = domain->data; in imx93_blk_ctrl_power_on()
129 struct imx93_blk_ctrl *bc = domain->bc; in imx93_blk_ctrl_power_on()
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()
138 ret = clk_bulk_prepare_enable(data->num_clks, domain->clks); 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()
163 clk_bulk_disable_unprepare(data->num_clks, domain->clks); in imx93_blk_ctrl_power_on()
165 clk_bulk_disable_unprepare(bc->num_clks, bc->clks); in imx93_blk_ctrl_power_on()
173 const struct imx93_blk_ctrl_domain_data *data = domain->data; in imx93_blk_ctrl_power_off()
174 struct imx93_blk_ctrl *bc = domain->bc; in imx93_blk_ctrl_power_off()
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()
183 clk_bulk_disable_unprepare(data->num_clks, domain->clks); in imx93_blk_ctrl_power_off()
185 clk_bulk_disable_unprepare(bc->num_clks, bc->clks); in imx93_blk_ctrl_power_off()
192 struct device *dev = &pdev->dev; in imx93_blk_ctrl_probe()
202 .rd_table = bc_data->reg_access_table, in imx93_blk_ctrl_probe()
203 .wr_table = bc_data->reg_access_table, in imx93_blk_ctrl_probe()
209 return -ENOMEM; in imx93_blk_ctrl_probe()
211 bc->dev = dev; in imx93_blk_ctrl_probe()
217 bc->regmap = devm_regmap_init_mmio(dev, base, ®map_config); in imx93_blk_ctrl_probe()
218 if (IS_ERR(bc->regmap)) in imx93_blk_ctrl_probe()
219 return dev_err_probe(dev, PTR_ERR(bc->regmap), in imx93_blk_ctrl_probe()
222 bc->domains = devm_kcalloc(dev, bc_data->num_domains, in imx93_blk_ctrl_probe()
225 if (!bc->domains) in imx93_blk_ctrl_probe()
226 return -ENOMEM; in imx93_blk_ctrl_probe()
228 bc->onecell_data.num_domains = bc_data->num_domains; in imx93_blk_ctrl_probe()
229 bc->onecell_data.domains = in imx93_blk_ctrl_probe()
230 devm_kcalloc(dev, bc_data->num_domains, in imx93_blk_ctrl_probe()
232 if (!bc->onecell_data.domains) in imx93_blk_ctrl_probe()
233 return -ENOMEM; in imx93_blk_ctrl_probe()
235 for (i = 0; i < bc_data->num_clks; i++) in imx93_blk_ctrl_probe()
236 bc->clks[i].id = bc_data->clk_names[i]; in imx93_blk_ctrl_probe()
237 bc->num_clks = bc_data->num_clks; in imx93_blk_ctrl_probe()
239 ret = devm_clk_bulk_get(dev, bc->num_clks, bc->clks); in imx93_blk_ctrl_probe()
245 for (i = 0; i < bc_data->num_domains; i++) { in imx93_blk_ctrl_probe()
246 const struct imx93_blk_ctrl_domain_data *data = &bc_data->domains[i]; in imx93_blk_ctrl_probe()
247 struct imx93_blk_ctrl_domain *domain = &bc->domains[i]; in imx93_blk_ctrl_probe()
250 domain->data = data; in imx93_blk_ctrl_probe()
252 for (j = 0; j < data->num_clks; j++) in imx93_blk_ctrl_probe()
253 domain->clks[j].id = data->clk_names[j]; in imx93_blk_ctrl_probe()
255 ret = devm_clk_bulk_get(dev, data->num_clks, domain->clks); in imx93_blk_ctrl_probe()
261 domain->genpd.name = data->name; in imx93_blk_ctrl_probe()
262 domain->genpd.power_on = imx93_blk_ctrl_power_on; in imx93_blk_ctrl_probe()
263 domain->genpd.power_off = imx93_blk_ctrl_power_off; in imx93_blk_ctrl_probe()
264 domain->bc = bc; in imx93_blk_ctrl_probe()
266 ret = pm_genpd_init(&domain->genpd, NULL, true); in imx93_blk_ctrl_probe()
272 bc->onecell_data.domains[i] = &domain->genpd; in imx93_blk_ctrl_probe()
277 ret = of_genpd_add_provider_onecell(dev->of_node, &bc->onecell_data); in imx93_blk_ctrl_probe()
288 for (i--; i >= 0; i--) in imx93_blk_ctrl_probe()
289 pm_genpd_remove(&bc->domains[i].genpd); in imx93_blk_ctrl_probe()
296 struct imx93_blk_ctrl *bc = dev_get_drvdata(&pdev->dev); in imx93_blk_ctrl_remove()
299 of_genpd_del_provider(pdev->dev.of_node); in imx93_blk_ctrl_remove()
301 for (i = 0; bc->onecell_data.num_domains; i++) { in imx93_blk_ctrl_remove()
302 struct imx93_blk_ctrl_domain *domain = &bc->domains[i]; in imx93_blk_ctrl_remove()
304 pm_genpd_remove(&domain->genpd); in imx93_blk_ctrl_remove()
312 .name = "mediablk-mipi-dsi",
319 .name = "mediablk-mipi-csi",
326 .name = "mediablk-pxp",
347 .name = "mediablk-lcdif",
348 .clk_names = (const char *[]){ "disp", "lcdif" },
363 .name = "mediablk-isi",
409 .clk_names = (const char *[]){ "axi", "apb", "nic", },
416 .compatible = "fsl,imx93-media-blk-ctrl",
428 .name = "imx93-blk-ctrl",