diff options
Diffstat (limited to 'drivers/clk/x86')
-rw-r--r-- | drivers/clk/x86/clk-pmc-atom.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/clk/x86/clk-pmc-atom.c b/drivers/clk/x86/clk-pmc-atom.c index d977193842df..19174835693b 100644 --- a/drivers/clk/x86/clk-pmc-atom.c +++ b/drivers/clk/x86/clk-pmc-atom.c | |||
@@ -165,7 +165,7 @@ static const struct clk_ops plt_clk_ops = { | |||
165 | }; | 165 | }; |
166 | 166 | ||
167 | static struct clk_plt *plt_clk_register(struct platform_device *pdev, int id, | 167 | static struct clk_plt *plt_clk_register(struct platform_device *pdev, int id, |
168 | void __iomem *base, | 168 | const struct pmc_clk_data *pmc_data, |
169 | const char **parent_names, | 169 | const char **parent_names, |
170 | int num_parents) | 170 | int num_parents) |
171 | { | 171 | { |
@@ -184,9 +184,17 @@ static struct clk_plt *plt_clk_register(struct platform_device *pdev, int id, | |||
184 | init.num_parents = num_parents; | 184 | init.num_parents = num_parents; |
185 | 185 | ||
186 | pclk->hw.init = &init; | 186 | pclk->hw.init = &init; |
187 | pclk->reg = base + PMC_CLK_CTL_OFFSET + id * PMC_CLK_CTL_SIZE; | 187 | pclk->reg = pmc_data->base + PMC_CLK_CTL_OFFSET + id * PMC_CLK_CTL_SIZE; |
188 | spin_lock_init(&pclk->lock); | 188 | spin_lock_init(&pclk->lock); |
189 | 189 | ||
190 | /* | ||
191 | * On some systems, the pmc_plt_clocks already enabled by the | ||
192 | * firmware are being marked as critical to avoid them being | ||
193 | * gated by the clock framework. | ||
194 | */ | ||
195 | if (pmc_data->critical && plt_clk_is_enabled(&pclk->hw)) | ||
196 | init.flags |= CLK_IS_CRITICAL; | ||
197 | |||
190 | ret = devm_clk_hw_register(&pdev->dev, &pclk->hw); | 198 | ret = devm_clk_hw_register(&pdev->dev, &pclk->hw); |
191 | if (ret) { | 199 | if (ret) { |
192 | pclk = ERR_PTR(ret); | 200 | pclk = ERR_PTR(ret); |
@@ -332,7 +340,7 @@ static int plt_clk_probe(struct platform_device *pdev) | |||
332 | return PTR_ERR(parent_names); | 340 | return PTR_ERR(parent_names); |
333 | 341 | ||
334 | for (i = 0; i < PMC_CLK_NUM; i++) { | 342 | for (i = 0; i < PMC_CLK_NUM; i++) { |
335 | data->clks[i] = plt_clk_register(pdev, i, pmc_data->base, | 343 | data->clks[i] = plt_clk_register(pdev, i, pmc_data, |
336 | parent_names, data->nparents); | 344 | parent_names, data->nparents); |
337 | if (IS_ERR(data->clks[i])) { | 345 | if (IS_ERR(data->clks[i])) { |
338 | err = PTR_ERR(data->clks[i]); | 346 | err = PTR_ERR(data->clks[i]); |