Lines Matching refs:pmc_data
51 struct pmc_data *pmc_data = data; in of_clk_hw_pmc_get() local
55 if (idx < pmc_data->ncore) in of_clk_hw_pmc_get()
56 return pmc_data->chws[idx]; in of_clk_hw_pmc_get()
59 if (idx < pmc_data->nsystem) in of_clk_hw_pmc_get()
60 return pmc_data->shws[idx]; in of_clk_hw_pmc_get()
63 if (idx < pmc_data->nperiph) in of_clk_hw_pmc_get()
64 return pmc_data->phws[idx]; in of_clk_hw_pmc_get()
67 if (idx < pmc_data->ngck) in of_clk_hw_pmc_get()
68 return pmc_data->ghws[idx]; in of_clk_hw_pmc_get()
79 void pmc_data_free(struct pmc_data *pmc_data) in pmc_data_free() argument
81 kfree(pmc_data->chws); in pmc_data_free()
82 kfree(pmc_data->shws); in pmc_data_free()
83 kfree(pmc_data->phws); in pmc_data_free()
84 kfree(pmc_data->ghws); in pmc_data_free()
87 struct pmc_data *pmc_data_allocate(unsigned int ncore, unsigned int nsystem, in pmc_data_allocate()
90 struct pmc_data *pmc_data = kzalloc(sizeof(*pmc_data), GFP_KERNEL); in pmc_data_allocate() local
92 if (!pmc_data) in pmc_data_allocate()
95 pmc_data->ncore = ncore; in pmc_data_allocate()
96 pmc_data->chws = kcalloc(ncore, sizeof(struct clk_hw *), GFP_KERNEL); in pmc_data_allocate()
97 if (!pmc_data->chws) in pmc_data_allocate()
100 pmc_data->nsystem = nsystem; in pmc_data_allocate()
101 pmc_data->shws = kcalloc(nsystem, sizeof(struct clk_hw *), GFP_KERNEL); in pmc_data_allocate()
102 if (!pmc_data->shws) in pmc_data_allocate()
105 pmc_data->nperiph = nperiph; in pmc_data_allocate()
106 pmc_data->phws = kcalloc(nperiph, sizeof(struct clk_hw *), GFP_KERNEL); in pmc_data_allocate()
107 if (!pmc_data->phws) in pmc_data_allocate()
110 pmc_data->ngck = ngck; in pmc_data_allocate()
111 pmc_data->ghws = kcalloc(ngck, sizeof(struct clk_hw *), GFP_KERNEL); in pmc_data_allocate()
112 if (!pmc_data->ghws) in pmc_data_allocate()
115 return pmc_data; in pmc_data_allocate()
118 pmc_data_free(pmc_data); in pmc_data_allocate()