Skip to content

Commit 3887775

Browse files
author
Dharma Balasubiramani
committed
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 2962ef8 commit 3887775

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
@@ -110,17 +110,21 @@ static int atmel_hlcdc_probe(struct platform_device *pdev)
110110
return PTR_ERR(hlcdc->periph_clk);
111111
}
112112

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

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

0 commit comments

Comments
 (0)