ipq806x: 6.1: copy patches, files and config from 5.15
[openwrt/staging/jow.git] / target / linux / ipq806x / patches-6.1 / 119-v6.0-03-clk-qcom-clk-rpm-convert-to-parent_data-API.patch
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
5
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.
10
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
14 ---
15 drivers/clk/qcom/clk-rpm.c | 24 ++++++++++++++++--------
16 1 file changed, 16 insertions(+), 8 deletions(-)
17
18 --- a/drivers/clk/qcom/clk-rpm.c
19 +++ b/drivers/clk/qcom/clk-rpm.c
20 @@ -23,6 +23,14 @@
21 #define QCOM_RPM_SCALING_ENABLE_ID 0x2
22 #define QCOM_RPM_XO_MODE_ON 0x2
23
24 +static const struct clk_parent_data gcc_pxo[] = {
25 + { .fw_name = "pxo", .name = "pxo_board" },
26 +};
27 +
28 +static const struct clk_parent_data gcc_cxo[] = {
29 + { .fw_name = "cxo", .name = "cxo_board" },
30 +};
31 +
32 #define DEFINE_CLK_RPM(_platform, _name, _active, r_id) \
33 static struct clk_rpm _platform##_##_active; \
34 static struct clk_rpm _platform##_##_name = { \
35 @@ -32,8 +40,8 @@
36 .hw.init = &(struct clk_init_data){ \
37 .ops = &clk_rpm_ops, \
38 .name = #_name, \
39 - .parent_names = (const char *[]){ "pxo_board" }, \
40 - .num_parents = 1, \
41 + .parent_data = gcc_pxo, \
42 + .num_parents = ARRAY_SIZE(gcc_pxo), \
43 }, \
44 }; \
45 static struct clk_rpm _platform##_##_active = { \
46 @@ -44,8 +52,8 @@
47 .hw.init = &(struct clk_init_data){ \
48 .ops = &clk_rpm_ops, \
49 .name = #_active, \
50 - .parent_names = (const char *[]){ "pxo_board" }, \
51 - .num_parents = 1, \
52 + .parent_data = gcc_pxo, \
53 + .num_parents = ARRAY_SIZE(gcc_pxo), \
54 }, \
55 }
56
57 @@ -56,8 +64,8 @@
58 .hw.init = &(struct clk_init_data){ \
59 .ops = &clk_rpm_xo_ops, \
60 .name = #_name, \
61 - .parent_names = (const char *[]){ "cxo_board" }, \
62 - .num_parents = 1, \
63 + .parent_data = gcc_cxo, \
64 + .num_parents = ARRAY_SIZE(gcc_cxo), \
65 }, \
66 }
67
68 @@ -68,8 +76,8 @@
69 .hw.init = &(struct clk_init_data){ \
70 .ops = &clk_rpm_fixed_ops, \
71 .name = #_name, \
72 - .parent_names = (const char *[]){ "pxo" }, \
73 - .num_parents = 1, \
74 + .parent_data = gcc_pxo, \
75 + .num_parents = ARRAY_SIZE(gcc_pxo), \
76 }, \
77 }
78