diff options
Diffstat (limited to 'drivers/clk/at91/pmc.c')
-rw-r--r-- | drivers/clk/at91/pmc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c index ac8a76ca0266..20ee9dccee78 100644 --- a/drivers/clk/at91/pmc.c +++ b/drivers/clk/at91/pmc.c @@ -67,6 +67,10 @@ struct clk_hw *of_clk_hw_pmc_get(struct of_phandle_args *clkspec, void *data) if (idx < pmc_data->ngck) return pmc_data->ghws[idx]; break; + case PMC_TYPE_PROGRAMMABLE: + if (idx < pmc_data->npck) + return pmc_data->pchws[idx]; + break; default: break; } @@ -77,9 +81,10 @@ struct clk_hw *of_clk_hw_pmc_get(struct of_phandle_args *clkspec, void *data) } struct pmc_data *pmc_data_allocate(unsigned int ncore, unsigned int nsystem, - unsigned int nperiph, unsigned int ngck) + unsigned int nperiph, unsigned int ngck, + unsigned int npck) { - unsigned int num_clks = ncore + nsystem + nperiph + ngck; + unsigned int num_clks = ncore + nsystem + nperiph + ngck + npck; struct pmc_data *pmc_data; pmc_data = kzalloc(struct_size(pmc_data, hwtable, num_clks), @@ -99,6 +104,9 @@ struct pmc_data *pmc_data_allocate(unsigned int ncore, unsigned int nsystem, pmc_data->ngck = ngck; pmc_data->ghws = pmc_data->phws + nperiph; + pmc_data->npck = npck; + pmc_data->pchws = pmc_data->ghws + ngck; + return pmc_data; } |