Skip to content

Commit 9678bc7

Browse files
MrVanabelvesa
authored andcommitted
clk: imx95-blk-ctl: Add clock for i.MX94 LVDS/Display CSR
i.MX94 BLK CTL LVDS CSR's LVDS_PHY_CLOCK_CONTRL register controls the clock gating logic of LVDS units. Display CSR's DISPLAY_ENGINES_CLOCK_CONTROL register controls the selection of the clock feeding the display engine. Add clock gate support for the two CSRs. Reviewed-by: Abel Vesa <[email protected]> Signed-off-by: Peng Fan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Abel Vesa <[email protected]>
1 parent 88768d6 commit 9678bc7

File tree

1 file changed

+49
-1
lines changed

1 file changed

+49
-1
lines changed

drivers/clk/imx/clk-imx95-blk-ctl.c

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/*
3-
* Copyright 2024 NXP
3+
* Copyright 2024-2025 NXP
44
*/
55

6+
#include <dt-bindings/clock/nxp,imx94-clock.h>
67
#include <dt-bindings/clock/nxp,imx95-clock.h>
78
#include <linux/clk.h>
89
#include <linux/clk-provider.h>
@@ -300,6 +301,51 @@ static const struct imx95_blk_ctl_dev_data hsio_blk_ctl_dev_data = {
300301
.clk_reg_offset = 0,
301302
};
302303

304+
static const struct imx95_blk_ctl_clk_dev_data imx94_lvds_clk_dev_data[] = {
305+
[IMX94_CLK_DISPMIX_LVDS_CLK_GATE] = {
306+
.name = "lvds_clk_gate",
307+
.parent_names = (const char *[]){ "ldbpll", },
308+
.num_parents = 1,
309+
.reg = 0,
310+
.bit_idx = 1,
311+
.bit_width = 1,
312+
.type = CLK_GATE,
313+
.flags = CLK_SET_RATE_PARENT,
314+
.flags2 = CLK_GATE_SET_TO_DISABLE,
315+
},
316+
};
317+
318+
static const struct imx95_blk_ctl_dev_data imx94_lvds_csr_dev_data = {
319+
.num_clks = ARRAY_SIZE(imx94_lvds_clk_dev_data),
320+
.clk_dev_data = imx94_lvds_clk_dev_data,
321+
.clk_reg_offset = 0,
322+
.rpm_enabled = true,
323+
};
324+
325+
static const char * const imx94_disp_engine_parents[] = {
326+
"disppix", "ldb_pll_div7"
327+
};
328+
329+
static const struct imx95_blk_ctl_clk_dev_data imx94_dispmix_csr_clk_dev_data[] = {
330+
[IMX94_CLK_DISPMIX_CLK_SEL] = {
331+
.name = "disp_clk_sel",
332+
.parent_names = imx94_disp_engine_parents,
333+
.num_parents = ARRAY_SIZE(imx94_disp_engine_parents),
334+
.reg = 0,
335+
.bit_idx = 1,
336+
.bit_width = 1,
337+
.type = CLK_MUX,
338+
.flags = CLK_SET_RATE_NO_REPARENT | CLK_SET_RATE_PARENT,
339+
},
340+
};
341+
342+
static const struct imx95_blk_ctl_dev_data imx94_dispmix_csr_dev_data = {
343+
.num_clks = ARRAY_SIZE(imx94_dispmix_csr_clk_dev_data),
344+
.clk_dev_data = imx94_dispmix_csr_clk_dev_data,
345+
.clk_reg_offset = 0,
346+
.rpm_enabled = true,
347+
};
348+
303349
static int imx95_bc_probe(struct platform_device *pdev)
304350
{
305351
struct device *dev = &pdev->dev;
@@ -467,6 +513,8 @@ static const struct dev_pm_ops imx95_bc_pm_ops = {
467513
};
468514

469515
static const struct of_device_id imx95_bc_of_match[] = {
516+
{ .compatible = "nxp,imx94-display-csr", .data = &imx94_dispmix_csr_dev_data },
517+
{ .compatible = "nxp,imx94-lvds-csr", .data = &imx94_lvds_csr_dev_data },
470518
{ .compatible = "nxp,imx95-camera-csr", .data = &camblk_dev_data },
471519
{ .compatible = "nxp,imx95-display-master-csr", },
472520
{ .compatible = "nxp,imx95-display-csr", .data = &imx95_dispmix_csr_dev_data },

0 commit comments

Comments
 (0)