Skip to content

Commit 239cd6a

Browse files
manikandan-m11lag-linaro
authored andcommitted
mfd: atmel-hlcdc: Fetch LVDS PLL clock for LVDS display
The XLCDC IP supports parallel RGB, MIPI DSI and LVDS Display. The LCD Generic clock (sys_clk) is used for Parallel RGB and MIPI displays, while the LVDS PLL clock (lvds_pll_clk) is used for LVDS displays.Since both the clocks cannot co-exist together in the DT for a given display, this patch tries sys_clk first (RGB/MIPI), fallback to lvds_pll_clk (LVDS). Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com> Signed-off-by: Dharma Balasubiramani <dharma.b@microchip.com> Link: https://patch.msgid.link/20260223101920.284697-2-manikandan.m@microchip.com Signed-off-by: Lee Jones <lee@kernel.org>
1 parent c2b06b1 commit 239cd6a

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

drivers/mfd/atmel-hlcdc.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,19 @@ static int atmel_hlcdc_probe(struct platform_device *pdev)
108108
return PTR_ERR(hlcdc->periph_clk);
109109
}
110110

111+
/*
112+
* Retrieve one of the primary clocks required for LCD operation:
113+
* prefer sys_clk (for RGB/MIPI), and fall back to lvds_pll_clk
114+
* (for LVDS) if needed.
115+
*/
111116
hlcdc->sys_clk = devm_clk_get(dev, "sys_clk");
112117
if (IS_ERR(hlcdc->sys_clk)) {
113-
dev_err(dev, "failed to get system clock\n");
114-
return PTR_ERR(hlcdc->sys_clk);
118+
hlcdc->sys_clk = NULL;
119+
hlcdc->lvds_pll_clk = devm_clk_get(dev, "lvds_pll_clk");
120+
if (IS_ERR(hlcdc->lvds_pll_clk)) {
121+
dev_err(dev, "Failed to obtain both the LCDC (generic) and LVDS PLL clocks\n");
122+
return PTR_ERR(hlcdc->lvds_pll_clk);
123+
}
115124
}
116125

117126
hlcdc->slow_clk = devm_clk_get(dev, "slow_clk");

include/linux/mfd/atmel-hlcdc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
*/
7676
struct atmel_hlcdc {
7777
struct regmap *regmap;
78+
struct clk *lvds_pll_clk;
7879
struct clk *periph_clk;
7980
struct clk *sys_clk;
8081
struct clk *slow_clk;

0 commit comments

Comments
 (0)