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

Configure Feed

Select the types of activity you want to include in your feed.

clk: qcom: lcc-msm8960: use parent_hws/_data instead of parent_names

Convert the clock driver to specify parent data rather than parent
names, to actually bind using 'clock-names' specified in the DTS rather
than global clock names. Use parent_hws where possible to refer parent
clocks directly, skipping the lookup.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: David Heidelberg <david@ixit.cz> # tested on Nexus 7 (2013)
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20220623120418.250589-7-dmitry.baryshkov@linaro.org

authored by

Dmitry Baryshkov and committed by
Bjorn Andersson
a6976f85 7026af10

+37 -32
+37 -32
drivers/clk/qcom/lcc-msm8960.c
··· 33 33 .status_bit = 16, 34 34 .clkr.hw.init = &(struct clk_init_data){ 35 35 .name = "pll4", 36 - .parent_names = (const char *[]){ "pxo" }, 36 + .parent_data = (const struct clk_parent_data[]){ 37 + { .fw_name = "pxo", .name = "pxo_board" }, 38 + }, 37 39 .num_parents = 1, 38 40 .ops = &clk_pll_ops, 39 41 }, ··· 51 49 { P_PLL4, 2 } 52 50 }; 53 51 54 - static const char * const lcc_pxo_pll4[] = { 55 - "pxo", 56 - "pll4_vote", 52 + static const struct clk_parent_data lcc_pxo_pll4[] = { 53 + { .fw_name = "pxo", .name = "pxo_board" }, 54 + { .fw_name = "pll4_vote", .name = "pll4_vote" }, 57 55 }; 58 56 59 57 static struct freq_tbl clk_tbl_aif_osr_492[] = { ··· 114 112 .enable_mask = BIT(9), \ 115 113 .hw.init = &(struct clk_init_data){ \ 116 114 .name = #prefix "_osr_src", \ 117 - .parent_names = lcc_pxo_pll4, \ 118 - .num_parents = 2, \ 115 + .parent_data = lcc_pxo_pll4, \ 116 + .num_parents = ARRAY_SIZE(lcc_pxo_pll4), \ 119 117 .ops = &clk_rcg_ops, \ 120 118 .flags = CLK_SET_RATE_GATE, \ 121 119 }, \ 122 120 }, \ 123 - }; \ 124 - \ 125 - static const char * const lcc_##prefix##_parents[] = { \ 126 - #prefix "_osr_src", \ 127 121 }; \ 128 122 129 123 #define CLK_AIF_OSR_CLK(prefix, _ns, hr, en_bit) \ ··· 132 134 .enable_mask = BIT(en_bit), \ 133 135 .hw.init = &(struct clk_init_data){ \ 134 136 .name = #prefix "_osr_clk", \ 135 - .parent_names = lcc_##prefix##_parents, \ 137 + .parent_hws = (const struct clk_hw*[]){ \ 138 + &prefix##_osr_src.clkr.hw, \ 139 + }, \ 136 140 .num_parents = 1, \ 137 141 .ops = &clk_branch_ops, \ 138 142 .flags = CLK_SET_RATE_PARENT, \ ··· 150 150 .clkr = { \ 151 151 .hw.init = &(struct clk_init_data){ \ 152 152 .name = #prefix "_div_clk", \ 153 - .parent_names = lcc_##prefix##_parents, \ 153 + .parent_hws = (const struct clk_hw*[]){ \ 154 + &prefix##_osr_src.clkr.hw, \ 155 + }, \ 154 156 .num_parents = 1, \ 155 157 .ops = &clk_regmap_div_ops, \ 156 158 }, \ ··· 169 167 .enable_mask = BIT(en_bit), \ 170 168 .hw.init = &(struct clk_init_data){ \ 171 169 .name = #prefix "_bit_div_clk", \ 172 - .parent_names = (const char *[]){ \ 173 - #prefix "_div_clk" \ 174 - }, \ 170 + .parent_hws = (const struct clk_hw*[]){ \ 171 + &prefix##_div_clk.clkr.hw, \ 172 + }, \ 175 173 .num_parents = 1, \ 176 174 .ops = &clk_branch_ops, \ 177 175 .flags = CLK_SET_RATE_PARENT, \ ··· 187 185 .clkr = { \ 188 186 .hw.init = &(struct clk_init_data){ \ 189 187 .name = #prefix "_bit_clk", \ 190 - .parent_names = (const char *[]){ \ 191 - #prefix "_bit_div_clk", \ 192 - #prefix "_codec_clk", \ 188 + .parent_data = (const struct clk_parent_data[]){ \ 189 + { .hw = &prefix##_bit_div_clk.clkr.hw, }, \ 190 + { .fw_name = #prefix "_codec_clk", \ 191 + .name = #prefix "_codec_clk", }, \ 193 192 }, \ 194 193 .num_parents = 2, \ 195 194 .ops = &clk_regmap_mux_closest_ops, \ ··· 276 273 .enable_mask = BIT(9), 277 274 .hw.init = &(struct clk_init_data){ 278 275 .name = "pcm_src", 279 - .parent_names = lcc_pxo_pll4, 280 - .num_parents = 2, 276 + .parent_data = lcc_pxo_pll4, 277 + .num_parents = ARRAY_SIZE(lcc_pxo_pll4), 281 278 .ops = &clk_rcg_ops, 282 279 .flags = CLK_SET_RATE_GATE, 283 280 }, ··· 293 290 .enable_mask = BIT(11), 294 291 .hw.init = &(struct clk_init_data){ 295 292 .name = "pcm_clk_out", 296 - .parent_names = (const char *[]){ "pcm_src" }, 293 + .parent_hws = (const struct clk_hw*[]){ 294 + &pcm_src.clkr.hw 295 + }, 297 296 .num_parents = 1, 298 297 .ops = &clk_branch_ops, 299 298 .flags = CLK_SET_RATE_PARENT, ··· 310 305 .clkr = { 311 306 .hw.init = &(struct clk_init_data){ 312 307 .name = "pcm_clk", 313 - .parent_names = (const char *[]){ 314 - "pcm_clk_out", 315 - "pcm_codec_clk", 308 + .parent_data = (const struct clk_parent_data[]){ 309 + { .hw = &pcm_clk_out.clkr.hw }, 310 + { .fw_name = "pcm_codec_clk", .name = "pcm_codec_clk" }, 316 311 }, 317 312 .num_parents = 2, 318 313 .ops = &clk_regmap_mux_closest_ops, ··· 346 341 .enable_mask = BIT(9), 347 342 .hw.init = &(struct clk_init_data){ 348 343 .name = "slimbus_src", 349 - .parent_names = lcc_pxo_pll4, 350 - .num_parents = 2, 344 + .parent_data = lcc_pxo_pll4, 345 + .num_parents = ARRAY_SIZE(lcc_pxo_pll4), 351 346 .ops = &clk_rcg_ops, 352 347 .flags = CLK_SET_RATE_GATE, 353 348 }, 354 349 }, 355 - }; 356 - 357 - static const char * const lcc_slimbus_parents[] = { 358 - "slimbus_src", 359 350 }; 360 351 361 352 static struct clk_branch audio_slimbus_clk = { ··· 363 362 .enable_mask = BIT(10), 364 363 .hw.init = &(struct clk_init_data){ 365 364 .name = "audio_slimbus_clk", 366 - .parent_names = lcc_slimbus_parents, 365 + .parent_hws = (const struct clk_hw*[]){ 366 + &slimbus_src.clkr.hw, 367 + }, 367 368 .num_parents = 1, 368 369 .ops = &clk_branch_ops, 369 370 .flags = CLK_SET_RATE_PARENT, ··· 382 379 .enable_mask = BIT(12), 383 380 .hw.init = &(struct clk_init_data){ 384 381 .name = "sps_slimbus_clk", 385 - .parent_names = lcc_slimbus_parents, 382 + .parent_hws = (const struct clk_hw*[]){ 383 + &slimbus_src.clkr.hw, 384 + }, 386 385 .num_parents = 1, 387 386 .ops = &clk_branch_ops, 388 387 .flags = CLK_SET_RATE_PARENT,