Lines Matching +full:imx8qxp +full:- +full:lpcg +full:- +full:conn
1 // SPDX-License-Identifier: GPL-2.0+
7 #include <linux/clk-provider.h>
16 #include "clk-scu.h"
17 #include "clk-imx8qxp-lpcg.h"
19 #include <dt-bindings/clock/imx8-clock.h>
22 * struct imx8qxp_lpcg_data - Description of one LPCG clock
27 * @offset: offset of this LPCG clock
28 * @bit_idx: bit index of this LPCG clock
31 * This structure describes one LPCG clock
44 * struct imx8qxp_ss_lpcg - Description of one subsystem LPCG clocks
45 * @lpcg: LPCG clocks array of one subsystem
46 * @num_lpcg: the number of LPCG clocks
47 * @num_max: the maximum number of LPCG clocks
49 * This structure describes each subsystem LPCG clocks information
53 const struct imx8qxp_lpcg_data *lpcg; member
83 .lpcg = imx8qxp_lpcg_adma,
111 .lpcg = imx8qxp_lpcg_conn,
155 .lpcg = imx8qxp_lpcg_lsio,
162 struct device *dev = &pdev->dev; in imx8qxp_lpcg_clk_probe()
163 struct device_node *np = dev->of_node; in imx8qxp_lpcg_clk_probe()
166 const struct imx8qxp_lpcg_data *lpcg; in imx8qxp_lpcg_clk_probe() local
174 return -ENODEV; in imx8qxp_lpcg_clk_probe()
183 * On imx8 the LPCG nodes map entire subsystems and overlap in imx8qxp_lpcg_clk_probe()
189 return -EINVAL; in imx8qxp_lpcg_clk_probe()
190 base = devm_ioremap(dev, res->start, resource_size(res)); in imx8qxp_lpcg_clk_probe()
192 return -ENOMEM; in imx8qxp_lpcg_clk_probe()
194 clk_data = devm_kzalloc(&pdev->dev, struct_size(clk_data, hws, in imx8qxp_lpcg_clk_probe()
195 ss_lpcg->num_max), GFP_KERNEL); in imx8qxp_lpcg_clk_probe()
197 return -ENOMEM; in imx8qxp_lpcg_clk_probe()
199 clk_data->num = ss_lpcg->num_max; in imx8qxp_lpcg_clk_probe()
200 clks = clk_data->hws; in imx8qxp_lpcg_clk_probe()
202 for (i = 0; i < ss_lpcg->num_lpcg; i++) { in imx8qxp_lpcg_clk_probe()
203 lpcg = ss_lpcg->lpcg + i; in imx8qxp_lpcg_clk_probe()
204 clks[lpcg->id] = imx_clk_lpcg_scu(lpcg->name, lpcg->parent, in imx8qxp_lpcg_clk_probe()
205 lpcg->flags, base + lpcg->offset, in imx8qxp_lpcg_clk_probe()
206 lpcg->bit_idx, lpcg->hw_gate); in imx8qxp_lpcg_clk_probe()
209 for (i = 0; i < clk_data->num; i++) { in imx8qxp_lpcg_clk_probe()
219 { .compatible = "fsl,imx8qxp-lpcg-adma", &imx8qxp_ss_adma, },
220 { .compatible = "fsl,imx8qxp-lpcg-conn", &imx8qxp_ss_conn, },
221 { .compatible = "fsl,imx8qxp-lpcg-lsio", &imx8qxp_ss_lsio, },
227 .name = "imx8qxp-lpcg-clk",
237 MODULE_DESCRIPTION("NXP i.MX8QXP LPCG clock driver");