clk: x86: Do not gate clocks enabled by the firmware

Read the enable register to determine if the clock is already in use by
the firmware. In this case avoid gating the clock.

Tested-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Andy Shevchenko <[email protected]>
Acked-by: Darren Hart (VMware) <[email protected]>
Signed-off-by: Carlo Caione <[email protected]>
Fixes: 282a4e4ce5 ("platform/x86: Enable Atom PMC platform clocks")
Signed-off-by: Stephen Boyd <[email protected]>
This commit is contained in:
Carlo Caione authored and Stephen Boyd committed 2017-07-18 16:23:13 -07:00
1 parent f905293d65
commit d31fd43c0f
1 file changed
+7
+7
View File
@@ -186,6 +186,13 @@ static struct clk_plt *plt_clk_register(struct platform_device *pdev, int id,
pclk->reg = base + PMC_CLK_CTL_OFFSET + id * PMC_CLK_CTL_SIZE;
spin_lock_init(&pclk->lock);
/*
* If the clock was already enabled by the firmware mark it as critical
* to avoid it being gated by the clock framework if no driver owns it.
*/
if (plt_clk_is_enabled(&pclk->hw))
init.flags |= CLK_IS_CRITICAL;
ret = devm_clk_hw_register(&pdev->dev, &pclk->hw);
if (ret) {
pclk = ERR_PTR(ret);