Lines Matching refs:bpmp
31 struct tegra_bpmp *bpmp; member
59 static int tegra_bpmp_clk_transfer(struct tegra_bpmp *bpmp, in tegra_bpmp_clk_transfer() argument
86 err = tegra_bpmp_transfer(bpmp, &msg); in tegra_bpmp_clk_transfer()
104 return tegra_bpmp_clk_transfer(clk->bpmp, &msg); in tegra_bpmp_clk_prepare()
117 err = tegra_bpmp_clk_transfer(clk->bpmp, &msg); in tegra_bpmp_clk_unprepare()
119 dev_err(clk->bpmp->dev, "failed to disable clock %s: %d\n", in tegra_bpmp_clk_unprepare()
136 err = tegra_bpmp_clk_transfer(clk->bpmp, &msg); in tegra_bpmp_clk_is_prepared()
160 err = tegra_bpmp_clk_transfer(clk->bpmp, &msg); in tegra_bpmp_clk_recalc_rate()
187 err = tegra_bpmp_clk_transfer(clk->bpmp, &msg); in tegra_bpmp_clk_round_rate()
213 err = tegra_bpmp_clk_transfer(clk->bpmp, &msg); in tegra_bpmp_clk_set_parent()
236 err = tegra_bpmp_clk_transfer(clk->bpmp, &msg); in tegra_bpmp_clk_get_parent()
238 dev_err(clk->bpmp->dev, "failed to get parent for %s: %d\n", in tegra_bpmp_clk_get_parent()
269 return tegra_bpmp_clk_transfer(clk->bpmp, &msg); in tegra_bpmp_clk_set_rate()
308 static int tegra_bpmp_clk_get_max_id(struct tegra_bpmp *bpmp) in tegra_bpmp_clk_get_max_id() argument
319 err = tegra_bpmp_clk_transfer(bpmp, &msg); in tegra_bpmp_clk_get_max_id()
329 static int tegra_bpmp_clk_get_info(struct tegra_bpmp *bpmp, unsigned int id, in tegra_bpmp_clk_get_info() argument
343 err = tegra_bpmp_clk_transfer(bpmp, &msg); in tegra_bpmp_clk_get_info()
358 static void tegra_bpmp_clk_info_dump(struct tegra_bpmp *bpmp, in tegra_bpmp_clk_info_dump() argument
390 dev_printk(level, bpmp->dev, "%03u: %s\n", info->id, info->name); in tegra_bpmp_clk_info_dump()
391 dev_printk(level, bpmp->dev, " flags: %lx %s\n", info->flags, flags); in tegra_bpmp_clk_info_dump()
392 dev_printk(level, bpmp->dev, " parents: %u\n", info->num_parents); in tegra_bpmp_clk_info_dump()
395 dev_printk(level, bpmp->dev, " %03u\n", info->parents[i]); in tegra_bpmp_clk_info_dump()
398 static int tegra_bpmp_probe_clocks(struct tegra_bpmp *bpmp, in tegra_bpmp_probe_clocks() argument
406 err = tegra_bpmp_clk_get_max_id(bpmp); in tegra_bpmp_probe_clocks()
412 dev_dbg(bpmp->dev, "maximum clock ID: %u\n", max_id); in tegra_bpmp_probe_clocks()
421 err = tegra_bpmp_clk_get_info(bpmp, id, info); in tegra_bpmp_probe_clocks()
426 dev_err(bpmp->dev, in tegra_bpmp_probe_clocks()
442 tegra_bpmp_clk_info_dump(bpmp, KERN_DEBUG, info); in tegra_bpmp_probe_clocks()
445 dev_dbg(bpmp->dev, "holes: %u\n", holes); in tegra_bpmp_probe_clocks()
465 tegra_bpmp_clk_register(struct tegra_bpmp *bpmp, in tegra_bpmp_clk_register() argument
476 clk = devm_kzalloc(bpmp->dev, sizeof(*clk), GFP_KERNEL); in tegra_bpmp_clk_register()
481 clk->bpmp = bpmp; in tegra_bpmp_clk_register()
483 clk->parents = devm_kcalloc(bpmp->dev, info->num_parents, in tegra_bpmp_clk_register()
522 dev_err(bpmp->dev, "no parent %u found for %u\n", in tegra_bpmp_clk_register()
532 err = devm_clk_hw_register(bpmp->dev, &clk->hw); in tegra_bpmp_clk_register()
542 static int tegra_bpmp_register_clocks(struct tegra_bpmp *bpmp, in tegra_bpmp_register_clocks() argument
549 bpmp->num_clocks = count; in tegra_bpmp_register_clocks()
551 bpmp->clocks = devm_kcalloc(bpmp->dev, count, sizeof(clk), GFP_KERNEL); in tegra_bpmp_register_clocks()
552 if (!bpmp->clocks) in tegra_bpmp_register_clocks()
558 clk = tegra_bpmp_clk_register(bpmp, info, infos, count); in tegra_bpmp_register_clocks()
560 dev_err(bpmp->dev, in tegra_bpmp_register_clocks()
566 bpmp->clocks[i] = clk; in tegra_bpmp_register_clocks()
572 static void tegra_bpmp_unregister_clocks(struct tegra_bpmp *bpmp) in tegra_bpmp_unregister_clocks() argument
576 for (i = 0; i < bpmp->num_clocks; i++) in tegra_bpmp_unregister_clocks()
577 clk_hw_unregister(&bpmp->clocks[i]->hw); in tegra_bpmp_unregister_clocks()
584 struct tegra_bpmp *bpmp = data; in tegra_bpmp_clk_of_xlate() local
586 for (i = 0; i < bpmp->num_clocks; i++) { in tegra_bpmp_clk_of_xlate()
587 struct tegra_bpmp_clk *clk = bpmp->clocks[i]; in tegra_bpmp_clk_of_xlate()
599 int tegra_bpmp_init_clocks(struct tegra_bpmp *bpmp) in tegra_bpmp_init_clocks() argument
605 err = tegra_bpmp_probe_clocks(bpmp, &clocks); in tegra_bpmp_init_clocks()
611 dev_dbg(bpmp->dev, "%u clocks probed\n", count); in tegra_bpmp_init_clocks()
613 err = tegra_bpmp_register_clocks(bpmp, clocks, count); in tegra_bpmp_init_clocks()
617 err = of_clk_add_hw_provider(bpmp->dev->of_node, in tegra_bpmp_init_clocks()
619 bpmp); in tegra_bpmp_init_clocks()
621 tegra_bpmp_unregister_clocks(bpmp); in tegra_bpmp_init_clocks()