clk: tegra: Add peripheral clock registration helper

There is a common pattern that registers individual peripheral clocks
from an initialization table. Add a common implementation to remove the
duplication from various call sites.

Signed-off-by: Thierry Reding <treding@nvidia.com>
This commit is contained in:
Thierry Reding 2017-08-30 12:11:53 +02:00
parent 231ca2e583
commit 8be95190da
2 changed files with 11 additions and 0 deletions

View File

@ -203,3 +203,11 @@ struct clk *tegra_clk_register_periph_nodiv(const char *name,
return _tegra_clk_register_periph(name, parent_names, num_parents,
periph, clk_base, offset, CLK_SET_RATE_PARENT);
}
struct clk *tegra_clk_register_periph_data(void __iomem *clk_base,
struct tegra_periph_init_data *init)
{
return _tegra_clk_register_periph(init->name, init->p.parent_names,
init->num_parents, &init->periph,
clk_base, init->offset, init->flags);
}

View File

@ -662,6 +662,9 @@ struct tegra_periph_init_data {
_clk_num, _gate_flags, _clk_id,\
NULL, 0, NULL)
struct clk *tegra_clk_register_periph_data(void __iomem *clk_base,
struct tegra_periph_init_data *init);
/**
* struct clk_super_mux - super clock
*