Skip to content

Commit 129d9cd

Browse files
Ansuelandersson
authored andcommitted
clk: qcom: clk-rpm: convert to parent_data API
Convert clk-rpm driver to parent_data API. We keep the old pxo/cxo_board parent naming to keep compatibility with old DT and we use the new pxo/cxo for new implementation where these clock are defined in DTS. Signed-off-by: Christian Marangi <[email protected]> Signed-off-by: Bjorn Andersson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 4970f31 commit 129d9cd

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

drivers/clk/qcom/clk-rpm.c

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@
2323
#define QCOM_RPM_SCALING_ENABLE_ID 0x2
2424
#define QCOM_RPM_XO_MODE_ON 0x2
2525

26+
static const struct clk_parent_data gcc_pxo[] = {
27+
{ .fw_name = "pxo", .name = "pxo_board" },
28+
};
29+
30+
static const struct clk_parent_data gcc_cxo[] = {
31+
{ .fw_name = "cxo", .name = "cxo_board" },
32+
};
33+
2634
#define DEFINE_CLK_RPM(_platform, _name, _active, r_id) \
2735
static struct clk_rpm _platform##_##_active; \
2836
static struct clk_rpm _platform##_##_name = { \
@@ -32,8 +40,8 @@
3240
.hw.init = &(struct clk_init_data){ \
3341
.ops = &clk_rpm_ops, \
3442
.name = #_name, \
35-
.parent_names = (const char *[]){ "pxo_board" }, \
36-
.num_parents = 1, \
43+
.parent_data = gcc_pxo, \
44+
.num_parents = ARRAY_SIZE(gcc_pxo), \
3745
}, \
3846
}; \
3947
static struct clk_rpm _platform##_##_active = { \
@@ -44,8 +52,8 @@
4452
.hw.init = &(struct clk_init_data){ \
4553
.ops = &clk_rpm_ops, \
4654
.name = #_active, \
47-
.parent_names = (const char *[]){ "pxo_board" }, \
48-
.num_parents = 1, \
55+
.parent_data = gcc_pxo, \
56+
.num_parents = ARRAY_SIZE(gcc_pxo), \
4957
}, \
5058
}
5159

@@ -56,8 +64,8 @@
5664
.hw.init = &(struct clk_init_data){ \
5765
.ops = &clk_rpm_xo_ops, \
5866
.name = #_name, \
59-
.parent_names = (const char *[]){ "cxo_board" }, \
60-
.num_parents = 1, \
67+
.parent_data = gcc_cxo, \
68+
.num_parents = ARRAY_SIZE(gcc_cxo), \
6169
}, \
6270
}
6371

@@ -68,8 +76,8 @@
6876
.hw.init = &(struct clk_init_data){ \
6977
.ops = &clk_rpm_fixed_ops, \
7078
.name = #_name, \
71-
.parent_names = (const char *[]){ "pxo" }, \
72-
.num_parents = 1, \
79+
.parent_data = gcc_pxo, \
80+
.num_parents = ARRAY_SIZE(gcc_pxo), \
7381
}, \
7482
}
7583

0 commit comments

Comments
 (0)