Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: tegra: Convert to clk_hw based provider APIs

We're removing struct clk from the clk provider API, so switch
this code to using the clk_hw based provider APIs.

Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: Thierry Reding <treding@nvidia.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

authored by

Stephen Boyd and committed by
Michael Turquette
5cdb1dc5 1b14afa6

+10 -10
+5 -5
drivers/clk/tegra/clk-emc.c
··· 103 103 * CCF wrongly assumes that the parent won't change during set_rate, 104 104 * so get the parent rate explicitly. 105 105 */ 106 - parent_rate = __clk_get_rate(__clk_get_parent(hw->clk)); 106 + parent_rate = clk_hw_get_rate(clk_hw_get_parent(hw)); 107 107 108 108 val = readl(tegra->clk_regs + CLK_SOURCE_EMC); 109 109 div = val & CLK_SOURCE_EMC_EMC_2X_CLK_DIVISOR_MASK; ··· 151 151 return 0; 152 152 } 153 153 154 - req->rate = __clk_get_rate(hw->clk); 154 + req->rate = clk_hw_get_rate(hw); 155 155 return 0; 156 156 } 157 157 ··· 314 314 315 315 tegra = container_of(hw, struct tegra_clk_emc, hw); 316 316 317 - if (__clk_get_rate(hw->clk) == rate) 317 + if (clk_hw_get_rate(hw) == rate) 318 318 return 0; 319 319 320 320 /* ··· 527 527 if (IS_ERR(clk)) 528 528 return clk; 529 529 530 - tegra->prev_parent = clk_get_parent_by_index( 531 - tegra->hw.clk, emc_get_parent(&tegra->hw)); 530 + tegra->prev_parent = clk_hw_get_parent_by_index( 531 + &tegra->hw, emc_get_parent(&tegra->hw))->clk; 532 532 tegra->changing_timing = false; 533 533 534 534 /* Allow debugging tools to see the EMC clock */
+5 -5
drivers/clk/tegra/clk-pll.c
··· 634 634 635 635 /* PLLM is used for memory; we do not change rate */ 636 636 if (pll->params->flags & TEGRA_PLLM) 637 - return __clk_get_rate(hw->clk); 637 + return clk_hw_get_rate(hw); 638 638 639 639 if (_get_table_rate(hw, &cfg, rate, *prate) && 640 640 _calc_rate(hw, &cfg, rate, *prate)) ··· 1577 1577 if (!pll_params->pdiv_tohw) 1578 1578 return ERR_PTR(-EINVAL); 1579 1579 1580 - parent_rate = __clk_get_rate(parent); 1580 + parent_rate = clk_get_rate(parent); 1581 1581 1582 1582 pll_params->vco_min = _clip_vco_min(pll_params->vco_min, parent_rate); 1583 1583 ··· 1674 1674 return ERR_PTR(-EINVAL); 1675 1675 } 1676 1676 1677 - parent_rate = __clk_get_rate(parent); 1677 + parent_rate = clk_get_rate(parent); 1678 1678 1679 1679 pll_params->vco_min = _clip_vco_min(pll_params->vco_min, parent_rate); 1680 1680 ··· 1715 1715 return ERR_PTR(-EINVAL); 1716 1716 } 1717 1717 1718 - parent_rate = __clk_get_rate(parent); 1718 + parent_rate = clk_get_rate(parent); 1719 1719 1720 1720 pll_params->vco_min = _clip_vco_min(pll_params->vco_min, parent_rate); 1721 1721 ··· 1848 1848 val &= ~PLLSS_REF_SRC_SEL_MASK; 1849 1849 pll_writel_base(val, pll); 1850 1850 1851 - parent_rate = __clk_get_rate(parent); 1851 + parent_rate = clk_get_rate(parent); 1852 1852 1853 1853 pll_params->vco_min = _clip_vco_min(pll_params->vco_min, parent_rate); 1854 1854