Lines Matching defs:data

86 static struct ccu_pll *ccu_pll_find_desc(struct ccu_pll_data *data,
93 return data->plls[idx];
101 struct ccu_pll_data *data;
103 data = kzalloc(sizeof(*data), GFP_KERNEL);
104 if (!data)
107 data->np = np;
109 return data;
112 static void ccu_pll_free_data(struct ccu_pll_data *data)
114 kfree(data);
117 static int ccu_pll_find_sys_regs(struct ccu_pll_data *data)
119 data->sys_regs = syscon_node_to_regmap(data->np->parent);
120 if (IS_ERR(data->sys_regs)) {
122 of_node_full_name(data->np));
123 return PTR_ERR(data->sys_regs);
132 struct ccu_pll_data *data = priv;
137 pll = ccu_pll_find_desc(data, clk_id);
148 static int ccu_pll_clk_register(struct ccu_pll_data *data, bool defer)
158 if (!data->plls[idx])
159 data->plls[idx] = ERR_PTR(-EPROBE_DEFER);
168 init.sys_regs = data->sys_regs;
169 init.np = data->np;
173 data->plls[idx] = ccu_pll_hw_register(&init);
174 if (IS_ERR(data->plls[idx])) {
175 ret = PTR_ERR(data->plls[idx]);
189 ccu_pll_hw_unregister(data->plls[idx]);
195 static void ccu_pll_clk_unregister(struct ccu_pll_data *data, bool defer)
204 ccu_pll_hw_unregister(data->plls[idx]);
208 static int ccu_pll_of_register(struct ccu_pll_data *data)
212 ret = of_clk_add_hw_provider(data->np, ccu_pll_of_clk_hw_get, data);
215 of_node_full_name(data->np));
223 struct ccu_pll_data *data = pll_data;
225 if (!data)
228 return ccu_pll_clk_register(data, false);
248 struct ccu_pll_data *data;
251 data = ccu_pll_create_data(np);
252 if (IS_ERR(data))
255 ret = ccu_pll_find_sys_regs(data);
259 ret = ccu_pll_clk_register(data, true);
263 ret = ccu_pll_of_register(data);
267 pll_data = data;
272 ccu_pll_clk_unregister(data, true);
275 ccu_pll_free_data(data);