diff options
author | Stephen Boyd <sboyd@codeaurora.org> | 2016-04-20 14:41:37 -0400 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2016-04-20 14:41:37 -0400 |
commit | 0f05db651dc50c2a6f45794de2567fbf64a4df75 (patch) | |
tree | 6f72791401b1cae3c9d5c6dd2be88a212ca1017f /drivers/clk/rockchip | |
parent | e708b383f4b94feca2e0d5d06e1cfc13cdfea100 (diff) | |
parent | 03ae1747869437a8e4d0d4e79d4c88c25c6df39c (diff) |
Merge tag 'v4.7-rockchip-clk2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into clk-next
Pull some checkpatch silencers from Heiko Stuebner:
Fix quite some checkpatch warnings in the newly added
rk3399 header and also in the clock code itself.
* tag 'v4.7-rockchip-clk2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip:
clk: rockchip: fix checkpatch warning in core code
clk: rockchip: drop unnecessary header comment
clk: rockchip: reign in some overly long lines in the rk3399 controller
clk: rockchip: fix checkpatch errors in rk3399 dt-binding header
Diffstat (limited to 'drivers/clk/rockchip')
-rw-r--r-- | drivers/clk/rockchip/clk-mmc-phase.c | 3 | ||||
-rw-r--r-- | drivers/clk/rockchip/clk-rk3399.c | 139 | ||||
-rw-r--r-- | drivers/clk/rockchip/clk.c | 44 | ||||
-rw-r--r-- | drivers/clk/rockchip/clk.h | 3 |
4 files changed, 108 insertions, 81 deletions
diff --git a/drivers/clk/rockchip/clk-mmc-phase.c b/drivers/clk/rockchip/clk-mmc-phase.c index e0dc7e83403a..bc856f21f6b2 100644 --- a/drivers/clk/rockchip/clk-mmc-phase.c +++ b/drivers/clk/rockchip/clk-mmc-phase.c | |||
@@ -123,7 +123,8 @@ static int rockchip_mmc_set_phase(struct clk_hw *hw, int degrees) | |||
123 | raw_value = delay_num ? ROCKCHIP_MMC_DELAY_SEL : 0; | 123 | raw_value = delay_num ? ROCKCHIP_MMC_DELAY_SEL : 0; |
124 | raw_value |= delay_num << ROCKCHIP_MMC_DELAYNUM_OFFSET; | 124 | raw_value |= delay_num << ROCKCHIP_MMC_DELAYNUM_OFFSET; |
125 | raw_value |= nineties; | 125 | raw_value |= nineties; |
126 | writel(HIWORD_UPDATE(raw_value, 0x07ff, mmc_clock->shift), mmc_clock->reg); | 126 | writel(HIWORD_UPDATE(raw_value, 0x07ff, mmc_clock->shift), |
127 | mmc_clock->reg); | ||
127 | 128 | ||
128 | pr_debug("%s->set_phase(%d) delay_nums=%u reg[0x%p]=0x%03x actual_degrees=%d\n", | 129 | pr_debug("%s->set_phase(%d) delay_nums=%u reg[0x%p]=0x%03x actual_degrees=%d\n", |
129 | clk_hw_get_name(hw), degrees, delay_num, | 130 | clk_hw_get_name(hw), degrees, delay_num, |
diff --git a/drivers/clk/rockchip/clk-rk3399.c b/drivers/clk/rockchip/clk-rk3399.c index 356e13256242..e8f040be3fea 100644 --- a/drivers/clk/rockchip/clk-rk3399.c +++ b/drivers/clk/rockchip/clk-rk3399.c | |||
@@ -117,73 +117,96 @@ PNAME(mux_aclk_cci_p) = { "cpll_aclk_cci_src", | |||
117 | "gpll_aclk_cci_src", | 117 | "gpll_aclk_cci_src", |
118 | "npll_aclk_cci_src", | 118 | "npll_aclk_cci_src", |
119 | "vpll_aclk_cci_src" }; | 119 | "vpll_aclk_cci_src" }; |
120 | PNAME(mux_cci_trace_p) = { "cpll_cci_trace", "gpll_cci_trace" }; | 120 | PNAME(mux_cci_trace_p) = { "cpll_cci_trace", |
121 | PNAME(mux_cs_p) = { "cpll_cs", "gpll_cs", "npll_cs"}; | 121 | "gpll_cci_trace" }; |
122 | PNAME(mux_aclk_perihp_p) = { "cpll_aclk_perihp_src", "gpll_aclk_perihp_src" }; | 122 | PNAME(mux_cs_p) = { "cpll_cs", "gpll_cs", |
123 | "npll_cs"}; | ||
124 | PNAME(mux_aclk_perihp_p) = { "cpll_aclk_perihp_src", | ||
125 | "gpll_aclk_perihp_src" }; | ||
123 | 126 | ||
124 | PNAME(mux_pll_src_cpll_gpll_p) = { "cpll", "gpll" }; | 127 | PNAME(mux_pll_src_cpll_gpll_p) = { "cpll", "gpll" }; |
125 | PNAME(mux_pll_src_cpll_gpll_npll_p) = { "cpll", "gpll", "npll" }; | 128 | PNAME(mux_pll_src_cpll_gpll_npll_p) = { "cpll", "gpll", "npll" }; |
126 | PNAME(mux_pll_src_cpll_gpll_ppll_p) = { "cpll", "gpll", "ppll" }; | 129 | PNAME(mux_pll_src_cpll_gpll_ppll_p) = { "cpll", "gpll", "ppll" }; |
127 | PNAME(mux_pll_src_cpll_gpll_upll_p) = { "cpll", "gpll", "upll" }; | 130 | PNAME(mux_pll_src_cpll_gpll_upll_p) = { "cpll", "gpll", "upll" }; |
128 | PNAME(mux_pll_src_npll_cpll_gpll_p) = { "npll", "cpll", "gpll" }; | 131 | PNAME(mux_pll_src_npll_cpll_gpll_p) = { "npll", "cpll", "gpll" }; |
129 | PNAME(mux_pll_src_cpll_gpll_npll_ppll_p) = { "cpll", "gpll", "npll", "ppll" }; | 132 | PNAME(mux_pll_src_cpll_gpll_npll_ppll_p) = { "cpll", "gpll", "npll", |
130 | PNAME(mux_pll_src_cpll_gpll_npll_24m_p) = { "cpll", "gpll", "npll", "xin24m" }; | 133 | "ppll" }; |
131 | PNAME(mux_pll_src_cpll_gpll_npll_usbphy480m_p) = { "cpll", "gpll", "npll", "clk_usbphy_480m" }; | 134 | PNAME(mux_pll_src_cpll_gpll_npll_24m_p) = { "cpll", "gpll", "npll", |
132 | PNAME(mux_pll_src_ppll_cpll_gpll_npll_p) = { "ppll", "cpll", "gpll", "npll", "upll" }; | 135 | "xin24m" }; |
133 | PNAME(mux_pll_src_cpll_gpll_npll_upll_24m_p) = { "cpll", "gpll", "npll", "upll", "xin24m" }; | 136 | PNAME(mux_pll_src_cpll_gpll_npll_usbphy480m_p) = { "cpll", "gpll", "npll", |
134 | PNAME(mux_pll_src_cpll_gpll_npll_ppll_upll_24m_p) = { "cpll", "gpll", "npll", "ppll", "upll", "xin24m" }; | 137 | "clk_usbphy_480m" }; |
138 | PNAME(mux_pll_src_ppll_cpll_gpll_npll_p) = { "ppll", "cpll", "gpll", | ||
139 | "npll", "upll" }; | ||
140 | PNAME(mux_pll_src_cpll_gpll_npll_upll_24m_p) = { "cpll", "gpll", "npll", | ||
141 | "upll", "xin24m" }; | ||
142 | PNAME(mux_pll_src_cpll_gpll_npll_ppll_upll_24m_p) = { "cpll", "gpll", "npll", | ||
143 | "ppll", "upll", "xin24m" }; | ||
135 | 144 | ||
136 | PNAME(mux_pll_src_vpll_cpll_gpll_p) = { "vpll", "cpll", "gpll" }; | 145 | PNAME(mux_pll_src_vpll_cpll_gpll_p) = { "vpll", "cpll", "gpll" }; |
137 | PNAME(mux_pll_src_vpll_cpll_gpll_npll_p) = { "vpll", "cpll", "gpll", "npll" }; | 146 | PNAME(mux_pll_src_vpll_cpll_gpll_npll_p) = { "vpll", "cpll", "gpll", |
138 | PNAME(mux_pll_src_vpll_cpll_gpll_24m_p) = { "vpll", "cpll", "gpll", "xin24m" }; | 147 | "npll" }; |
139 | 148 | PNAME(mux_pll_src_vpll_cpll_gpll_24m_p) = { "vpll", "cpll", "gpll", | |
140 | PNAME(mux_dclk_vop0_p) = { "dclk_vop0_div", "dclk_vop0_frac" }; | 149 | "xin24m" }; |
141 | PNAME(mux_dclk_vop1_p) = { "dclk_vop1_div", "dclk_vop1_frac" }; | 150 | |
142 | 151 | PNAME(mux_dclk_vop0_p) = { "dclk_vop0_div", | |
143 | PNAME(mux_clk_cif_p) = { "clk_cifout_div", "xin24m" }; | 152 | "dclk_vop0_frac" }; |
144 | 153 | PNAME(mux_dclk_vop1_p) = { "dclk_vop1_div", | |
145 | PNAME(mux_pll_src_24m_usbphy480m_p) = { "xin24m", "clk_usbphy_480m" }; | 154 | "dclk_vop1_frac" }; |
146 | PNAME(mux_pll_src_24m_pciephy_p) = { "xin24m", "clk_pciephy_ref100m" }; | 155 | |
147 | PNAME(mux_pll_src_24m_32k_cpll_gpll_p) = { "xin24m", "xin32k", "cpll", "gpll" }; | 156 | PNAME(mux_clk_cif_p) = { "clk_cifout_div", "xin24m" }; |
148 | PNAME(mux_pciecore_cru_phy_p) = { "clk_pcie_core_cru", "clk_pcie_core_phy" }; | 157 | |
149 | 158 | PNAME(mux_pll_src_24m_usbphy480m_p) = { "xin24m", "clk_usbphy_480m" }; | |
150 | PNAME(mux_aclk_emmc_p) = { "cpll_aclk_emmc_src", "gpll_aclk_emmc_src" }; | 159 | PNAME(mux_pll_src_24m_pciephy_p) = { "xin24m", "clk_pciephy_ref100m" }; |
151 | 160 | PNAME(mux_pll_src_24m_32k_cpll_gpll_p) = { "xin24m", "xin32k", | |
152 | PNAME(mux_aclk_perilp0_p) = { "cpll_aclk_perilp0_src", "gpll_aclk_perilp0_src" }; | 161 | "cpll", "gpll" }; |
153 | 162 | PNAME(mux_pciecore_cru_phy_p) = { "clk_pcie_core_cru", | |
154 | PNAME(mux_fclk_cm0s_p) = { "cpll_fclk_cm0s_src", "gpll_fclk_cm0s_src" }; | 163 | "clk_pcie_core_phy" }; |
155 | 164 | ||
156 | PNAME(mux_hclk_perilp1_p) = { "cpll_hclk_perilp1_src", "gpll_hclk_perilp1_src" }; | 165 | PNAME(mux_aclk_emmc_p) = { "cpll_aclk_emmc_src", |
157 | 166 | "gpll_aclk_emmc_src" }; | |
158 | PNAME(mux_clk_testout1_p) = { "clk_testout1_pll_src", "xin24m" }; | 167 | |
159 | PNAME(mux_clk_testout2_p) = { "clk_testout2_pll_src", "xin24m" }; | 168 | PNAME(mux_aclk_perilp0_p) = { "cpll_aclk_perilp0_src", |
160 | 169 | "gpll_aclk_perilp0_src" }; | |
161 | PNAME(mux_usbphy_480m_p) = { "clk_usbphy0_480m_src", "clk_usbphy1_480m_src" }; | 170 | |
162 | PNAME(mux_aclk_gmac_p) = { "cpll_aclk_gmac_src", "gpll_aclk_gmac_src" }; | 171 | PNAME(mux_fclk_cm0s_p) = { "cpll_fclk_cm0s_src", |
163 | PNAME(mux_rmii_p) = { "clk_gmac", "clkin_gmac" }; | 172 | "gpll_fclk_cm0s_src" }; |
164 | PNAME(mux_spdif_p) = { "clk_spdif_div", "clk_spdif_frac", | 173 | |
165 | "clkin_i2s", "xin12m" }; | 174 | PNAME(mux_hclk_perilp1_p) = { "cpll_hclk_perilp1_src", |
166 | PNAME(mux_i2s0_p) = { "clk_i2s0_div", "clk_i2s0_frac", | 175 | "gpll_hclk_perilp1_src" }; |
167 | "clkin_i2s", "xin12m" }; | 176 | |
168 | PNAME(mux_i2s1_p) = { "clk_i2s1_div", "clk_i2s1_frac", | 177 | PNAME(mux_clk_testout1_p) = { "clk_testout1_pll_src", "xin24m" }; |
169 | "clkin_i2s", "xin12m" }; | 178 | PNAME(mux_clk_testout2_p) = { "clk_testout2_pll_src", "xin24m" }; |
170 | PNAME(mux_i2s2_p) = { "clk_i2s2_div", "clk_i2s2_frac", | 179 | |
171 | "clkin_i2s", "xin12m" }; | 180 | PNAME(mux_usbphy_480m_p) = { "clk_usbphy0_480m_src", |
172 | PNAME(mux_i2sch_p) = { "clk_i2s0", "clk_i2s1", "clk_i2s2" }; | 181 | "clk_usbphy1_480m_src" }; |
173 | PNAME(mux_i2sout_p) = { "clk_i2sout_src", "xin12m" }; | 182 | PNAME(mux_aclk_gmac_p) = { "cpll_aclk_gmac_src", |
174 | 183 | "gpll_aclk_gmac_src" }; | |
175 | PNAME(mux_uart0_p) = { "clk_uart0_div", "clk_uart0_frac", "xin24m" }; | 184 | PNAME(mux_rmii_p) = { "clk_gmac", "clkin_gmac" }; |
176 | PNAME(mux_uart1_p) = { "clk_uart1_div", "clk_uart1_frac", "xin24m" }; | 185 | PNAME(mux_spdif_p) = { "clk_spdif_div", "clk_spdif_frac", |
177 | PNAME(mux_uart2_p) = { "clk_uart2_div", "clk_uart2_frac", "xin24m" }; | 186 | "clkin_i2s", "xin12m" }; |
178 | PNAME(mux_uart3_p) = { "clk_uart3_div", "clk_uart3_frac", "xin24m" }; | 187 | PNAME(mux_i2s0_p) = { "clk_i2s0_div", "clk_i2s0_frac", |
188 | "clkin_i2s", "xin12m" }; | ||
189 | PNAME(mux_i2s1_p) = { "clk_i2s1_div", "clk_i2s1_frac", | ||
190 | "clkin_i2s", "xin12m" }; | ||
191 | PNAME(mux_i2s2_p) = { "clk_i2s2_div", "clk_i2s2_frac", | ||
192 | "clkin_i2s", "xin12m" }; | ||
193 | PNAME(mux_i2sch_p) = { "clk_i2s0", "clk_i2s1", | ||
194 | "clk_i2s2" }; | ||
195 | PNAME(mux_i2sout_p) = { "clk_i2sout_src", "xin12m" }; | ||
196 | |||
197 | PNAME(mux_uart0_p) = { "clk_uart0_div", "clk_uart0_frac", "xin24m" }; | ||
198 | PNAME(mux_uart1_p) = { "clk_uart1_div", "clk_uart1_frac", "xin24m" }; | ||
199 | PNAME(mux_uart2_p) = { "clk_uart2_div", "clk_uart2_frac", "xin24m" }; | ||
200 | PNAME(mux_uart3_p) = { "clk_uart3_div", "clk_uart3_frac", "xin24m" }; | ||
179 | 201 | ||
180 | /* PMU CRU parents */ | 202 | /* PMU CRU parents */ |
181 | PNAME(mux_ppll_24m_p) = { "ppll", "xin24m" }; | 203 | PNAME(mux_ppll_24m_p) = { "ppll", "xin24m" }; |
182 | PNAME(mux_24m_ppll_p) = { "xin24m", "ppll" }; | 204 | PNAME(mux_24m_ppll_p) = { "xin24m", "ppll" }; |
183 | PNAME(mux_fclk_cm0s_pmu_ppll_p) = { "fclk_cm0s_pmu_ppll_src", "xin24m" }; | 205 | PNAME(mux_fclk_cm0s_pmu_ppll_p) = { "fclk_cm0s_pmu_ppll_src", "xin24m" }; |
184 | PNAME(mux_wifi_pmu_p) = { "clk_wifi_div", "clk_wifi_frac" }; | 206 | PNAME(mux_wifi_pmu_p) = { "clk_wifi_div", "clk_wifi_frac" }; |
185 | PNAME(mux_uart4_pmu_p) = { "clk_uart4_div", "clk_uart4_frac", "xin24m" }; | 207 | PNAME(mux_uart4_pmu_p) = { "clk_uart4_div", "clk_uart4_frac", |
186 | PNAME(mux_clk_testout2_2io_p) = { "clk_testout2", "clk_32k_suspend_pmu" }; | 208 | "xin24m" }; |
209 | PNAME(mux_clk_testout2_2io_p) = { "clk_testout2", "clk_32k_suspend_pmu" }; | ||
187 | 210 | ||
188 | static struct rockchip_pll_clock rk3399_pll_clks[] __initdata = { | 211 | static struct rockchip_pll_clock rk3399_pll_clks[] __initdata = { |
189 | [lpll] = PLL(pll_rk3399, PLL_APLLL, "lpll", mux_pll_p, 0, RK3399_PLL_CON(0), | 212 | [lpll] = PLL(pll_rk3399, PLL_APLLL, "lpll", mux_pll_p, 0, RK3399_PLL_CON(0), |
@@ -1530,7 +1553,7 @@ static void __init rk3399_pmu_clk_init(struct device_node *np) | |||
1530 | ARRAY_SIZE(rk3399_clk_pmu_branches)); | 1553 | ARRAY_SIZE(rk3399_clk_pmu_branches)); |
1531 | 1554 | ||
1532 | rockchip_clk_protect_critical(rk3399_pmucru_critical_clocks, | 1555 | rockchip_clk_protect_critical(rk3399_pmucru_critical_clocks, |
1533 | ARRAY_SIZE(rk3399_pmucru_critical_clocks)); | 1556 | ARRAY_SIZE(rk3399_pmucru_critical_clocks)); |
1534 | 1557 | ||
1535 | rockchip_register_softrst(np, 2, reg_base + RK3399_PMU_SOFTRST_CON(0), | 1558 | rockchip_register_softrst(np, 2, reg_base + RK3399_PMU_SOFTRST_CON(0), |
1536 | ROCKCHIP_SOFTRST_HIWORD_MASK); | 1559 | ROCKCHIP_SOFTRST_HIWORD_MASK); |
diff --git a/drivers/clk/rockchip/clk.c b/drivers/clk/rockchip/clk.c index 277f9270bf72..f0a8be1553b0 100644 --- a/drivers/clk/rockchip/clk.c +++ b/drivers/clk/rockchip/clk.c | |||
@@ -42,7 +42,8 @@ | |||
42 | * sometimes without one of those components. | 42 | * sometimes without one of those components. |
43 | */ | 43 | */ |
44 | static struct clk *rockchip_clk_register_branch(const char *name, | 44 | static struct clk *rockchip_clk_register_branch(const char *name, |
45 | const char *const *parent_names, u8 num_parents, void __iomem *base, | 45 | const char *const *parent_names, u8 num_parents, |
46 | void __iomem *base, | ||
46 | int muxdiv_offset, u8 mux_shift, u8 mux_width, u8 mux_flags, | 47 | int muxdiv_offset, u8 mux_shift, u8 mux_width, u8 mux_flags, |
47 | u8 div_shift, u8 div_width, u8 div_flags, | 48 | u8 div_shift, u8 div_width, u8 div_flags, |
48 | struct clk_div_table *div_table, int gate_offset, | 49 | struct clk_div_table *div_table, int gate_offset, |
@@ -139,9 +140,11 @@ static int rockchip_clk_frac_notifier_cb(struct notifier_block *nb, | |||
139 | pr_debug("%s: event %lu, old_rate %lu, new_rate: %lu\n", | 140 | pr_debug("%s: event %lu, old_rate %lu, new_rate: %lu\n", |
140 | __func__, event, ndata->old_rate, ndata->new_rate); | 141 | __func__, event, ndata->old_rate, ndata->new_rate); |
141 | if (event == PRE_RATE_CHANGE) { | 142 | if (event == PRE_RATE_CHANGE) { |
142 | frac->rate_change_idx = frac->mux_ops->get_parent(&frac_mux->hw); | 143 | frac->rate_change_idx = |
144 | frac->mux_ops->get_parent(&frac_mux->hw); | ||
143 | if (frac->rate_change_idx != frac->mux_frac_idx) { | 145 | if (frac->rate_change_idx != frac->mux_frac_idx) { |
144 | frac->mux_ops->set_parent(&frac_mux->hw, frac->mux_frac_idx); | 146 | frac->mux_ops->set_parent(&frac_mux->hw, |
147 | frac->mux_frac_idx); | ||
145 | frac->rate_change_remuxed = 1; | 148 | frac->rate_change_remuxed = 1; |
146 | } | 149 | } |
147 | } else if (event == POST_RATE_CHANGE) { | 150 | } else if (event == POST_RATE_CHANGE) { |
@@ -152,7 +155,8 @@ static int rockchip_clk_frac_notifier_cb(struct notifier_block *nb, | |||
152 | * reaches the mux itself. | 155 | * reaches the mux itself. |
153 | */ | 156 | */ |
154 | if (frac->rate_change_remuxed) { | 157 | if (frac->rate_change_remuxed) { |
155 | frac->mux_ops->set_parent(&frac_mux->hw, frac->rate_change_idx); | 158 | frac->mux_ops->set_parent(&frac_mux->hw, |
159 | frac->rate_change_idx); | ||
156 | frac->rate_change_remuxed = 0; | 160 | frac->rate_change_remuxed = 0; |
157 | } | 161 | } |
158 | } | 162 | } |
@@ -326,18 +330,12 @@ struct rockchip_clk_provider * __init rockchip_clk_init(struct device_node *np, | |||
326 | int i; | 330 | int i; |
327 | 331 | ||
328 | ctx = kzalloc(sizeof(struct rockchip_clk_provider), GFP_KERNEL); | 332 | ctx = kzalloc(sizeof(struct rockchip_clk_provider), GFP_KERNEL); |
329 | if (!ctx) { | 333 | if (!ctx) |
330 | pr_err("%s: Could not allocate clock provider context\n", | ||
331 | __func__); | ||
332 | return ERR_PTR(-ENOMEM); | 334 | return ERR_PTR(-ENOMEM); |
333 | } | ||
334 | 335 | ||
335 | clk_table = kcalloc(nr_clks, sizeof(struct clk *), GFP_KERNEL); | 336 | clk_table = kcalloc(nr_clks, sizeof(struct clk *), GFP_KERNEL); |
336 | if (!clk_table) { | 337 | if (!clk_table) |
337 | pr_err("%s: Could not allocate clock lookup table\n", | ||
338 | __func__); | ||
339 | goto err_free; | 338 | goto err_free; |
340 | } | ||
341 | 339 | ||
342 | for (i = 0; i < nr_clks; ++i) | 340 | for (i = 0; i < nr_clks; ++i) |
343 | clk_table[i] = ERR_PTR(-ENOENT); | 341 | clk_table[i] = ERR_PTR(-ENOENT); |
@@ -367,7 +365,8 @@ void __init rockchip_clk_of_add_provider(struct device_node *np, | |||
367 | struct regmap *rockchip_clk_get_grf(struct rockchip_clk_provider *ctx) | 365 | struct regmap *rockchip_clk_get_grf(struct rockchip_clk_provider *ctx) |
368 | { | 366 | { |
369 | if (IS_ERR(ctx->grf)) | 367 | if (IS_ERR(ctx->grf)) |
370 | ctx->grf = syscon_regmap_lookup_by_phandle(ctx->cru_node, "rockchip,grf"); | 368 | ctx->grf = syscon_regmap_lookup_by_phandle(ctx->cru_node, |
369 | "rockchip,grf"); | ||
371 | return ctx->grf; | 370 | return ctx->grf; |
372 | } | 371 | } |
373 | 372 | ||
@@ -427,7 +426,8 @@ void __init rockchip_clk_register_branches( | |||
427 | if (list->div_table) | 426 | if (list->div_table) |
428 | clk = clk_register_divider_table(NULL, | 427 | clk = clk_register_divider_table(NULL, |
429 | list->name, list->parent_names[0], | 428 | list->name, list->parent_names[0], |
430 | flags, ctx->reg_base + list->muxdiv_offset, | 429 | flags, |
430 | ctx->reg_base + list->muxdiv_offset, | ||
431 | list->div_shift, list->div_width, | 431 | list->div_shift, list->div_width, |
432 | list->div_flags, list->div_table, | 432 | list->div_flags, list->div_table, |
433 | &ctx->lock); | 433 | &ctx->lock); |
@@ -441,7 +441,8 @@ void __init rockchip_clk_register_branches( | |||
441 | case branch_fraction_divider: | 441 | case branch_fraction_divider: |
442 | clk = rockchip_clk_register_frac_branch(ctx, list->name, | 442 | clk = rockchip_clk_register_frac_branch(ctx, list->name, |
443 | list->parent_names, list->num_parents, | 443 | list->parent_names, list->num_parents, |
444 | ctx->reg_base, list->muxdiv_offset, list->div_flags, | 444 | ctx->reg_base, list->muxdiv_offset, |
445 | list->div_flags, | ||
445 | list->gate_offset, list->gate_shift, | 446 | list->gate_offset, list->gate_shift, |
446 | list->gate_flags, flags, list->child, | 447 | list->gate_flags, flags, list->child, |
447 | &ctx->lock); | 448 | &ctx->lock); |
@@ -457,7 +458,8 @@ void __init rockchip_clk_register_branches( | |||
457 | case branch_composite: | 458 | case branch_composite: |
458 | clk = rockchip_clk_register_branch(list->name, | 459 | clk = rockchip_clk_register_branch(list->name, |
459 | list->parent_names, list->num_parents, | 460 | list->parent_names, list->num_parents, |
460 | ctx->reg_base, list->muxdiv_offset, list->mux_shift, | 461 | ctx->reg_base, list->muxdiv_offset, |
462 | list->mux_shift, | ||
461 | list->mux_width, list->mux_flags, | 463 | list->mux_width, list->mux_flags, |
462 | list->div_shift, list->div_width, | 464 | list->div_shift, list->div_width, |
463 | list->div_flags, list->div_table, | 465 | list->div_flags, list->div_table, |
@@ -517,8 +519,8 @@ void __init rockchip_clk_register_armclk(struct rockchip_clk_provider *ctx, | |||
517 | struct clk *clk; | 519 | struct clk *clk; |
518 | 520 | ||
519 | clk = rockchip_clk_register_cpuclk(name, parent_names, num_parents, | 521 | clk = rockchip_clk_register_cpuclk(name, parent_names, num_parents, |
520 | reg_data, rates, nrates, ctx->reg_base, | 522 | reg_data, rates, nrates, |
521 | &ctx->lock); | 523 | ctx->reg_base, &ctx->lock); |
522 | if (IS_ERR(clk)) { | 524 | if (IS_ERR(clk)) { |
523 | pr_err("%s: failed to register clock %s: %ld\n", | 525 | pr_err("%s: failed to register clock %s: %ld\n", |
524 | __func__, name, PTR_ERR(clk)); | 526 | __func__, name, PTR_ERR(clk)); |
@@ -560,8 +562,10 @@ static struct notifier_block rockchip_restart_handler = { | |||
560 | .priority = 128, | 562 | .priority = 128, |
561 | }; | 563 | }; |
562 | 564 | ||
563 | void __init rockchip_register_restart_notifier(struct rockchip_clk_provider *ctx, | 565 | void __init |
564 | unsigned int reg, void (*cb)(void)) | 566 | rockchip_register_restart_notifier(struct rockchip_clk_provider *ctx, |
567 | unsigned int reg, | ||
568 | void (*cb)(void)) | ||
565 | { | 569 | { |
566 | int ret; | 570 | int ret; |
567 | 571 | ||
diff --git a/drivers/clk/rockchip/clk.h b/drivers/clk/rockchip/clk.h index 880349f6d3d7..1abb7d05d1c7 100644 --- a/drivers/clk/rockchip/clk.h +++ b/drivers/clk/rockchip/clk.h | |||
@@ -34,7 +34,6 @@ struct clk; | |||
34 | #define HIWORD_UPDATE(val, mask, shift) \ | 34 | #define HIWORD_UPDATE(val, mask, shift) \ |
35 | ((val) << (shift) | (mask) << ((shift) + 16)) | 35 | ((val) << (shift) | (mask) << ((shift) + 16)) |
36 | 36 | ||
37 | /* register positions shared by RK2928, RK3036, RK3066, RK3188, RK3228, RK3399 */ | ||
38 | #define RK2928_PLL_CON(x) ((x) * 0x4) | 37 | #define RK2928_PLL_CON(x) ((x) * 0x4) |
39 | #define RK2928_MODE_CON 0x40 | 38 | #define RK2928_MODE_CON 0x40 |
40 | #define RK2928_CLKSEL_CON(x) ((x) * 0x4 + 0x44) | 39 | #define RK2928_CLKSEL_CON(x) ((x) * 0x4 + 0x44) |
@@ -253,7 +252,7 @@ struct rockchip_cpuclk_rate_table { | |||
253 | }; | 252 | }; |
254 | 253 | ||
255 | /** | 254 | /** |
256 | * struct rockchip_cpuclk_reg_data - describes register offsets and masks of the cpuclock | 255 | * struct rockchip_cpuclk_reg_data - register offsets and masks of the cpuclock |
257 | * @core_reg: register offset of the core settings register | 256 | * @core_reg: register offset of the core settings register |
258 | * @div_core_shift: core divider offset used to divide the pll value | 257 | * @div_core_shift: core divider offset used to divide the pll value |
259 | * @div_core_mask: core divider mask | 258 | * @div_core_mask: core divider mask |