|
|
@@ -165,7 +165,7 @@ static const struct clk_ops plt_clk_ops = {
|
|
|
};
|
|
|
|
|
|
static struct clk_plt *plt_clk_register(struct platform_device *pdev, int id,
|
|
|
- void __iomem *base,
|
|
|
+ const struct pmc_clk_data *pmc_data,
|
|
|
const char **parent_names,
|
|
|
int num_parents)
|
|
|
{
|
|
|
@@ -184,9 +184,17 @@ static struct clk_plt *plt_clk_register(struct platform_device *pdev, int id,
|
|
|
init.num_parents = num_parents;
|
|
|
|
|
|
pclk->hw.init = &init;
|
|
|
- pclk->reg = base + PMC_CLK_CTL_OFFSET + id * PMC_CLK_CTL_SIZE;
|
|
|
+ pclk->reg = pmc_data->base + PMC_CLK_CTL_OFFSET + id * PMC_CLK_CTL_SIZE;
|
|
|
spin_lock_init(&pclk->lock);
|
|
|
|
|
|
+ /*
|
|
|
+ * On some systems, the pmc_plt_clocks already enabled by the
|
|
|
+ * firmware are being marked as critical to avoid them being
|
|
|
+ * gated by the clock framework.
|
|
|
+ */
|
|
|
+ if (pmc_data->critical && 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);
|
|
|
@@ -332,7 +340,7 @@ static int plt_clk_probe(struct platform_device *pdev)
|
|
|
return PTR_ERR(parent_names);
|
|
|
|
|
|
for (i = 0; i < PMC_CLK_NUM; i++) {
|
|
|
- data->clks[i] = plt_clk_register(pdev, i, pmc_data->base,
|
|
|
+ data->clks[i] = plt_clk_register(pdev, i, pmc_data,
|
|
|
parent_names, data->nparents);
|
|
|
if (IS_ERR(data->clks[i])) {
|
|
|
err = PTR_ERR(data->clks[i]);
|