Skip to content

Commit 26208f0

Browse files
Dharma Balasubiramanimanikandan-m11
authored andcommitted
mfd: atmel-hlcdc: Obtain essential clock for LCD operation
Add checks for the presence of the essential clocks necessary for distinct display interfaces (GCK for PDA and MIPI Display, LVDS PLL for LVDS Display), as dictated by the Device Tree. The LCD controller expects one of these clocks to be present but not both, thus obtaining the required clock to enable LCD functionality. Fixes: ab9801b ("mfd: atmel-hlcdc: set prepare and enable LVDS PLL clock for LVDS display") Signed-off-by: Dharma Balasubiramani <dharma.b@microchip.com>
1 parent 42fa45a commit 26208f0

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

drivers/mfd/atmel-hlcdc.c

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

111+
/*
112+
* Obtain one of the essential clocks (GCK / LVDS PLL) necessary for
113+
* the LCD to function. GCK for PDA and MIPI Display, LVDS PLL for LVDS
114+
* Display. DT is expected to have any one of the clocks, not both.
115+
*/
116+
hlcdc->sys_clk = NULL;
117+
hlcdc->lvds_pll_clk = NULL;
111118
hlcdc->sys_clk = devm_clk_get(dev, "sys_clk");
112119
if (IS_ERR(hlcdc->sys_clk)) {
113-
dev_err(dev, "failed to get system clock\n");
114-
return PTR_ERR(hlcdc->sys_clk);
115-
}
116-
117-
/* Get the optional clock (LVDS PLL) in case if the LVDS interface is used */
118-
hlcdc->lvds_pll_clk = devm_clk_get_optional(dev, "lvds_pll_clk");
119-
if (IS_ERR(hlcdc->lvds_pll_clk)) {
120-
dev_info(dev, "failed to get lvds PLL clock\n");
121-
hlcdc->lvds_pll_clk = NULL;
120+
dev_dbg(dev, "failed to get sys_clk\n");
121+
hlcdc->lvds_pll_clk = devm_clk_get(dev, "lvds_pll_clk");
122+
if (IS_ERR(hlcdc->lvds_pll_clk)) {
123+
dev_err(dev, "failed to get GCK and LVDS_PLL\n");
124+
return PTR_ERR(hlcdc->lvds_pll_clk);
125+
}
122126
}
123127

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

0 commit comments

Comments
 (0)