diff options
author | Marek Vasut <marek.vasut+renesas@gmail.com> | 2018-01-08 16:05:28 +0100 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2018-01-24 23:27:21 +0100 |
commit | f11c9679aba16e73136e970a6c479751d2f442a1 (patch) | |
tree | 00c80d55ab7a8ec55a548a6744f83271b09ff7a9 /drivers/clk/renesas/clk-rcar-gen3.c | |
parent | f77b5a4cd1365bdb7bb6e108db374bb1c68b6f9f (diff) |
clk: renesas: Make clk_ids per-driver
Not all drivers use the same IDs, so make those IDs per-driver.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Diffstat (limited to 'drivers/clk/renesas/clk-rcar-gen3.c')
-rw-r--r-- | drivers/clk/renesas/clk-rcar-gen3.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/clk/renesas/clk-rcar-gen3.c b/drivers/clk/renesas/clk-rcar-gen3.c index d8576a33ae..647e8e1d9c 100644 --- a/drivers/clk/renesas/clk-rcar-gen3.c +++ b/drivers/clk/renesas/clk-rcar-gen3.c @@ -192,7 +192,8 @@ static int gen3_clk_get_mod(struct clk *clk, const struct mssr_mod_clk **mssr) return -EINVAL; for (i = 0; i < info->mod_clk_size; i++) { - if (info->mod_clk[i].id != MOD_CLK_ID(clkid)) + if (info->mod_clk[i].id != + (info->mod_clk_base + MOD_CLK_PACK(clkid))) continue; *mssr = &info->mod_clk[i]; @@ -322,6 +323,7 @@ static int gen3_clk_disable(struct clk *clk) static ulong gen3_clk_get_rate(struct clk *clk) { struct gen3_clk_priv *priv = dev_get_priv(clk->dev); + struct cpg_mssr_info *info = priv->info; struct clk parent; const struct cpg_core_clk *core; const struct rcar_gen3_cpg_pll_config *pll_config = @@ -350,14 +352,14 @@ static ulong gen3_clk_get_rate(struct clk *clk) switch (core->type) { case CLK_TYPE_IN: - if (core->id == CLK_EXTAL) { + if (core->id == info->clk_extal_id) { rate = clk_get_rate(&priv->clk_extal); debug("%s[%i] EXTAL clk: rate=%u\n", __func__, __LINE__, rate); return rate; } - if (core->id == CLK_EXTALR) { + if (core->id == info->clk_extalr_id) { rate = clk_get_rate(&priv->clk_extalr); debug("%s[%i] EXTALR clk: rate=%u\n", __func__, __LINE__, rate); |