1 From 129d9cd9c25041f8b8681fd6e8584fa47c385f3b Mon Sep 17 00:00:00 2001
2 From: Christian Marangi <ansuelsmth@gmail.com>
3 Date: Thu, 7 Jul 2022 00:53:20 +0200
4 Subject: [PATCH] clk: qcom: clk-rpm: convert to parent_data API
6 Convert clk-rpm driver to parent_data API.
7 We keep the old pxo/cxo_board parent naming to keep compatibility with
8 old DT and we use the new pxo/cxo for new implementation where these
9 clock are defined in DTS.
11 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
12 Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
13 Link: https://lore.kernel.org/r/20220706225321.26215-4-ansuelsmth@gmail.com
15 drivers/clk/qcom/clk-rpm.c | 24 ++++++++++++++++--------
16 1 file changed, 16 insertions(+), 8 deletions(-)
18 --- a/drivers/clk/qcom/clk-rpm.c
19 +++ b/drivers/clk/qcom/clk-rpm.c
21 #define QCOM_RPM_SCALING_ENABLE_ID 0x2
22 #define QCOM_RPM_XO_MODE_ON 0x2
24 +static const struct clk_parent_data gcc_pxo[] = {
25 + { .fw_name = "pxo", .name = "pxo_board" },
28 +static const struct clk_parent_data gcc_cxo[] = {
29 + { .fw_name = "cxo", .name = "cxo_board" },
32 #define DEFINE_CLK_RPM(_platform, _name, _active, r_id) \
33 static struct clk_rpm _platform##_##_active; \
34 static struct clk_rpm _platform##_##_name = { \
36 .hw.init = &(struct clk_init_data){ \
37 .ops = &clk_rpm_ops, \
39 - .parent_names = (const char *[]){ "pxo_board" }, \
41 + .parent_data = gcc_pxo, \
42 + .num_parents = ARRAY_SIZE(gcc_pxo), \
45 static struct clk_rpm _platform##_##_active = { \
47 .hw.init = &(struct clk_init_data){ \
48 .ops = &clk_rpm_ops, \
50 - .parent_names = (const char *[]){ "pxo_board" }, \
52 + .parent_data = gcc_pxo, \
53 + .num_parents = ARRAY_SIZE(gcc_pxo), \
58 .hw.init = &(struct clk_init_data){ \
59 .ops = &clk_rpm_xo_ops, \
61 - .parent_names = (const char *[]){ "cxo_board" }, \
63 + .parent_data = gcc_cxo, \
64 + .num_parents = ARRAY_SIZE(gcc_cxo), \
69 .hw.init = &(struct clk_init_data){ \
70 .ops = &clk_rpm_fixed_ops, \
72 - .parent_names = (const char *[]){ "pxo" }, \
74 + .parent_data = gcc_pxo, \
75 + .num_parents = ARRAY_SIZE(gcc_pxo), \