Lines Matching defs:par
70 static void simplefb_clocks_destroy(struct simplefb_par *par);
71 static void simplefb_regulators_destroy(struct simplefb_par *par);
75 simplefb_regulators_destroy(info->par);
76 simplefb_clocks_destroy(info->par);
205 static int simplefb_clocks_get(struct simplefb_par *par,
215 par->clk_count = of_clk_get_parent_count(np);
216 if (!par->clk_count)
219 par->clks = kcalloc(par->clk_count, sizeof(struct clk *), GFP_KERNEL);
220 if (!par->clks)
223 for (i = 0; i < par->clk_count; i++) {
228 if (par->clks[i])
229 clk_put(par->clks[i]);
231 kfree(par->clks);
238 par->clks[i] = clock;
244 static void simplefb_clocks_enable(struct simplefb_par *par,
249 for (i = 0; i < par->clk_count; i++) {
250 if (par->clks[i]) {
251 ret = clk_prepare_enable(par->clks[i]);
256 clk_put(par->clks[i]);
257 par->clks[i] = NULL;
261 par->clks_enabled = true;
264 static void simplefb_clocks_destroy(struct simplefb_par *par)
268 if (!par->clks)
271 for (i = 0; i < par->clk_count; i++) {
272 if (par->clks[i]) {
273 if (par->clks_enabled)
274 clk_disable_unprepare(par->clks[i]);
275 clk_put(par->clks[i]);
279 kfree(par->clks);
282 static int simplefb_clocks_get(struct simplefb_par *par,
284 static void simplefb_clocks_enable(struct simplefb_par *par,
286 static void simplefb_clocks_destroy(struct simplefb_par *par) { }
312 static int simplefb_regulators_get(struct simplefb_par *par,
334 par->regulators = devm_kcalloc(&pdev->dev, count,
336 if (!par->regulators)
357 par->regulators[i++] = regulator;
359 par->regulator_count = i;
364 static void simplefb_regulators_enable(struct simplefb_par *par,
370 for (i = 0; i < par->regulator_count; i++) {
371 ret = regulator_enable(par->regulators[i]);
376 devm_regulator_put(par->regulators[i]);
377 par->regulators[i] = NULL;
380 par->regulators_enabled = true;
383 static void simplefb_regulators_destroy(struct simplefb_par *par)
387 if (!par->regulators || !par->regulators_enabled)
390 for (i = 0; i < par->regulator_count; i++)
391 if (par->regulators[i])
392 regulator_disable(par->regulators[i]);
395 static int simplefb_regulators_get(struct simplefb_par *par,
397 static void simplefb_regulators_enable(struct simplefb_par *par,
399 static void simplefb_regulators_destroy(struct simplefb_par *par) { }
407 struct simplefb_par *par;
433 par = info->par;
467 info->pseudo_palette = par->palette;
469 ret = simplefb_clocks_get(par, pdev);
473 ret = simplefb_regulators_get(par, pdev);
477 simplefb_clocks_enable(par, pdev);
478 simplefb_regulators_enable(par, pdev);
499 simplefb_regulators_destroy(par);
501 simplefb_clocks_destroy(par);