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

sh: clkfwk: clock-sh7724: all div6_clks use SH_CLK_DIV6_EXT()

Current div6 clocks can specify their current parent clocks
from its register value if it is registered
by sh_clk_div6_reparent_register().
This patch modifies all div6 clocks into SH_CLK_DIV6_EXT().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>

authored by

Kuninori Morimoto and committed by
Paul Mundt
171f1bc7 7e28c7bb

+28 -17
+1
arch/sh/include/cpu-sh4/cpu/sh7724.h
··· 314 314 315 315 extern struct clk sh7724_fsimcka_clk; 316 316 extern struct clk sh7724_fsimckb_clk; 317 + extern struct clk sh7724_dv_clki; 317 318 318 319 #endif /* __ASM_SH7724_H__ */
+27 -17
arch/sh/kernel/cpu/sh4a/clock-sh7724.c
··· 111 111 .parent = &pll_clk, 112 112 }; 113 113 114 - /* External input clock (pin name: FSIMCKA/FSIMCKB ) */ 114 + /* External input clock (pin name: FSIMCKA/FSIMCKB/DV_CLKI ) */ 115 115 struct clk sh7724_fsimcka_clk = { 116 116 }; 117 117 118 118 struct clk sh7724_fsimckb_clk = { 119 + }; 120 + 121 + struct clk sh7724_dv_clki = { 119 122 }; 120 123 121 124 static struct clk *main_clks[] = { ··· 129 126 &div3_clk, 130 127 &sh7724_fsimcka_clk, 131 128 &sh7724_fsimckb_clk, 129 + &sh7724_dv_clki, 132 130 }; 133 131 134 132 static void div4_kick(struct clk *clk) ··· 167 163 [DIV4_M1] = DIV4(FRQCRB, 4, 0x2f7c, CLK_ENABLE_ON_INIT), 168 164 }; 169 165 170 - enum { DIV6_V, DIV6_I, DIV6_S, DIV6_NR }; 171 - 172 - static struct clk div6_clks[DIV6_NR] = { 173 - [DIV6_V] = SH_CLK_DIV6(&div3_clk, VCLKCR, 0), 174 - [DIV6_I] = SH_CLK_DIV6(&div3_clk, IRDACLKCR, 0), 175 - [DIV6_S] = SH_CLK_DIV6(&div3_clk, SPUCLKCR, CLK_ENABLE_ON_INIT), 176 - }; 177 - 178 - enum { DIV6_FA, DIV6_FB, DIV6_REPARENT_NR }; 166 + enum { DIV6_V, DIV6_I, DIV6_S, DIV6_FA, DIV6_FB, DIV6_NR }; 179 167 180 168 /* Indices are important - they are the actual src selecting values */ 169 + static struct clk *common_parent[] = { 170 + [0] = &div3_clk, 171 + [1] = NULL, 172 + }; 173 + 174 + static struct clk *vclkcr_parent[8] = { 175 + [0] = &div3_clk, 176 + [2] = &sh7724_dv_clki, 177 + [4] = &extal_clk, 178 + }; 179 + 181 180 static struct clk *fclkacr_parent[] = { 182 181 [0] = &div3_clk, 183 182 [1] = NULL, ··· 195 188 [3] = NULL, 196 189 }; 197 190 198 - static struct clk div6_reparent_clks[DIV6_REPARENT_NR] = { 191 + static struct clk div6_clks[DIV6_NR] = { 192 + [DIV6_V] = SH_CLK_DIV6_EXT(VCLKCR, 0, 193 + vclkcr_parent, ARRAY_SIZE(vclkcr_parent), 12, 3), 194 + [DIV6_I] = SH_CLK_DIV6_EXT(IRDACLKCR, 0, 195 + common_parent, ARRAY_SIZE(common_parent), 6, 1), 196 + [DIV6_S] = SH_CLK_DIV6_EXT(SPUCLKCR, CLK_ENABLE_ON_INIT, 197 + common_parent, ARRAY_SIZE(common_parent), 6, 1), 199 198 [DIV6_FA] = SH_CLK_DIV6_EXT(FCLKACR, 0, 200 199 fclkacr_parent, ARRAY_SIZE(fclkacr_parent), 6, 2), 201 200 [DIV6_FB] = SH_CLK_DIV6_EXT(FCLKBCR, 0, ··· 282 269 283 270 /* DIV6 clocks */ 284 271 CLKDEV_CON_ID("video_clk", &div6_clks[DIV6_V]), 285 - CLKDEV_CON_ID("fsia_clk", &div6_reparent_clks[DIV6_FA]), 286 - CLKDEV_CON_ID("fsib_clk", &div6_reparent_clks[DIV6_FB]), 272 + CLKDEV_CON_ID("fsia_clk", &div6_clks[DIV6_FA]), 273 + CLKDEV_CON_ID("fsib_clk", &div6_clks[DIV6_FB]), 287 274 CLKDEV_CON_ID("irda_clk", &div6_clks[DIV6_I]), 288 275 CLKDEV_CON_ID("spu_clk", &div6_clks[DIV6_S]), 289 276 ··· 369 356 ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table); 370 357 371 358 if (!ret) 372 - ret = sh_clk_div6_register(div6_clks, DIV6_NR); 373 - 374 - if (!ret) 375 - ret = sh_clk_div6_reparent_register(div6_reparent_clks, DIV6_REPARENT_NR); 359 + ret = sh_clk_div6_reparent_register(div6_clks, DIV6_NR); 376 360 377 361 if (!ret) 378 362 ret = sh_hwblk_clk_register(mstp_clks, HWBLK_NR);