Skip to content

Commit e02cb1f

Browse files
committed
Merge branches 'clk-ti', 'clk-samsung', 'clk-imx' and 'clk-allwinner' into clk-next
* clk-ti: clk: ti: Use int to check return value from of_property_count_elems_of_size() firmware: ti_sci: extend clock identifiers from u8 to u32 clk: keystone: sci-clk: extend clock IDs to 32 bits clk: keystone: sci-clk: probe clocks from DT instead of firmware clk: keystone: sci-clk: split out the fw clock parsing to own function clk: keystone: sci-clk: cut down the clock name length * clk-samsung: clk: samsung: Add bus clock for GPU/G3D on Exynos4412 clk: samsung: add new clocks for DMC for Exynos5422 SoC clk: samsung: add BPLL rate table for Exynos 5422 SoC clk: samsung: add needed IDs for DMC clocks in Exynos5420 clk: samsung: exynos5433: Use of_clk_get_parent_count() * clk-imx: (38 commits) clk: imx8mq: Keep uart clocks on during system boot clk: imx: Remove __init for imx_register_uart_clocks() API clk: imx6q: fix section mismatch warning clk: imx8mq: Use devm_platform_ioremap_resource() instead of of_iomap() clk: imx8mq: Use imx_check_clocks() API directly clk: imx: Remove __init for imx_check_clocks() API clk: imx6sll: Switch to clk_hw based API clk: imx7d: Switch to clk_hw based API clk: imx6ul: Switch to clk_hw based API clk: imx6sx: Switch to clk_hw based API clk: imx6q: Switch to clk_hw based API clk: imx6sl: Switch to clk_hw based API clk: imx: Switch wrappers to clk_hw based API clk: imx: clk-fixup-mux: Switch to clk_hw based API clk: imx: clk-fixup-div: Switch to clk_hw based API clk: imx: clk-gate-exclusive: Switch to clk_hw based API clk: imx: clk-pfd: Switch to clk_hw based API clk: imx: clk-pllv3: Switch to clk_hw based API clk: imx: clk-gate2: Switch to clk_hw based API clk: imx: clk-cpu: Switch to clk_hw based API ... * clk-allwinner: (29 commits) clk: Simplify debugfs printing and add a newline clk: sunxi-ng: sun8i-r: Use local parent references for SUNXI_CCU_GATE clk: sunxi-ng: a80-usb: Use local parent references for SUNXI_CCU_GATE clk: sunxi-ng: gate: Add macros for referencing local clock parents clk: sunxi-ng: h6-r: Use local parent references for CLK_FIXED_FACTOR clk: sunxi-ng: h6: Use local parent references for CLK_FIXED_FACTOR clk: sunxi-ng: a64: Use local parent references for CLK_FIXED_FACTOR clk: sunxi-ng: f1c100s: Use local parent references for CLK_FIXED_FACTOR clk: sunxi-ng: sun8i-r: Use local parent references for CLK_FIXED_FACTOR clk: sunxi-ng: v3s: Use local parent references for CLK_FIXED_FACTOR clk: sunxi-ng: r40: Use local parent references for CLK_FIXED_FACTOR clk: sunxi-ng: h3: Use local parent references for CLK_FIXED_FACTOR clk: sunxi-ng: a33: Use local parent references for CLK_FIXED_FACTOR clk: sunxi-ng: a23: Use local parent references for CLK_FIXED_FACTOR clk: sunxi-ng: a31: Use local parent references for CLK_FIXED_FACTOR clk: sunxi-ng: sun5i: Use local parent references for CLK_FIXED_FACTOR clk: sunxi-ng: a10: Use local parent references for CLK_FIXED_FACTOR clk: sunxi-ng: sun8i-r: Use local parent references for CLK_HW_INIT_* clk: sunxi-ng: switch to of_clk_hw_register() for registering clks clk: fixed-factor: Add CLK_FIXED_FACTOR_FW_NAME for DT clock-names parent ...
5 parents 1f5d580 + 0b88bc9 + c0bc660 + 76b77f1 + 11f6c23 commit e02cb1f

52 files changed

Lines changed: 3349 additions & 2387 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/phy/allwinner,sun4i-a10-ccu.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Allwinner Clock Control Unit Device Tree Bindings
8+
9+
maintainers:
10+
- Chen-Yu Tsai <wens@csie.org>
11+
- Maxime Ripard <maxime.ripard@bootlin.com>
12+
13+
properties:
14+
"#clock-cells":
15+
const: 1
16+
17+
"#reset-cells":
18+
const: 1
19+
20+
compatible:
21+
enum:
22+
- allwinner,sun4i-a10-ccu
23+
- allwinner,sun5i-a10s-ccu
24+
- allwinner,sun5i-a13-ccu
25+
- allwinner,sun6i-a31-ccu
26+
- allwinner,sun7i-a20-ccu
27+
- allwinner,sun8i-a23-ccu
28+
- allwinner,sun8i-a33-ccu
29+
- allwinner,sun8i-a83t-ccu
30+
- allwinner,sun8i-a83t-r-ccu
31+
- allwinner,sun8i-h3-ccu
32+
- allwinner,sun8i-h3-r-ccu
33+
- allwinner,sun8i-r40-ccu
34+
- allwinner,sun8i-v3s-ccu
35+
- allwinner,sun9i-a80-ccu
36+
- allwinner,sun50i-a64-ccu
37+
- allwinner,sun50i-a64-r-ccu
38+
- allwinner,sun50i-h5-ccu
39+
- allwinner,sun50i-h6-ccu
40+
- allwinner,sun50i-h6-r-ccu
41+
- allwinner,suniv-f1c100s-ccu
42+
- nextthing,gr8-ccu
43+
44+
reg:
45+
maxItems: 1
46+
47+
clocks:
48+
minItems: 2
49+
maxItems: 4
50+
items:
51+
- description: High Frequency Oscillator (usually at 24MHz)
52+
- description: Low Frequency Oscillator (usually at 32kHz)
53+
- description: Internal Oscillator
54+
- description: Peripherals PLL
55+
56+
clock-names:
57+
minItems: 2
58+
maxItems: 4
59+
items:
60+
- const: hosc
61+
- const: losc
62+
- const: iosc
63+
- const: pll-periph
64+
65+
required:
66+
- "#clock-cells"
67+
- "#reset-cells"
68+
- compatible
69+
- reg
70+
- clocks
71+
- clock-names
72+
73+
if:
74+
properties:
75+
compatible:
76+
enum:
77+
- allwinner,sun8i-a83t-r-ccu
78+
- allwinner,sun8i-h3-r-ccu
79+
- allwinner,sun50i-a64-r-ccu
80+
- allwinner,sun50i-h6-r-ccu
81+
82+
then:
83+
properties:
84+
clocks:
85+
minItems: 4
86+
maxItems: 4
87+
88+
clock-names:
89+
minItems: 4
90+
maxItems: 4
91+
92+
else:
93+
if:
94+
properties:
95+
compatible:
96+
const: allwinner,sun50i-h6-ccu
97+
98+
then:
99+
properties:
100+
clocks:
101+
minItems: 3
102+
maxItems: 3
103+
104+
clock-names:
105+
minItems: 3
106+
maxItems: 3
107+
108+
else:
109+
properties:
110+
clocks:
111+
minItems: 2
112+
maxItems: 2
113+
114+
clock-names:
115+
minItems: 2
116+
maxItems: 2
117+
118+
additionalProperties: false
119+
120+
examples:
121+
- |
122+
ccu: clock@1c20000 {
123+
compatible = "allwinner,sun8i-h3-ccu";
124+
reg = <0x01c20000 0x400>;
125+
clocks = <&osc24M>, <&osc32k>;
126+
clock-names = "hosc", "losc";
127+
#clock-cells = <1>;
128+
#reset-cells = <1>;
129+
};
130+
131+
- |
132+
r_ccu: clock@1f01400 {
133+
compatible = "allwinner,sun50i-a64-r-ccu";
134+
reg = <0x01f01400 0x100>;
135+
clocks = <&osc24M>, <&osc32k>, <&iosc>, <&ccu 11>;
136+
clock-names = "hosc", "losc", "iosc", "pll-periph";
137+
#clock-cells = <1>;
138+
#reset-cells = <1>;
139+
};
140+
141+
...

‎Documentation/devicetree/bindings/clock/sunxi-ccu.txt‎

Lines changed: 0 additions & 62 deletions
This file was deleted.

‎drivers/clk/clk.c‎

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2997,15 +2997,49 @@ static int clk_flags_show(struct seq_file *s, void *data)
29972997
}
29982998
DEFINE_SHOW_ATTRIBUTE(clk_flags);
29992999

3000+
static void possible_parent_show(struct seq_file *s, struct clk_core *core,
3001+
unsigned int i, char terminator)
3002+
{
3003+
struct clk_core *parent;
3004+
3005+
/*
3006+
* Go through the following options to fetch a parent's name.
3007+
*
3008+
* 1. Fetch the registered parent clock and use its name
3009+
* 2. Use the global (fallback) name if specified
3010+
* 3. Use the local fw_name if provided
3011+
* 4. Fetch parent clock's clock-output-name if DT index was set
3012+
*
3013+
* This may still fail in some cases, such as when the parent is
3014+
* specified directly via a struct clk_hw pointer, but it isn't
3015+
* registered (yet).
3016+
*/
3017+
parent = clk_core_get_parent_by_index(core, i);
3018+
if (parent)
3019+
seq_printf(s, "%s", parent->name);
3020+
else if (core->parents[i].name)
3021+
seq_printf(s, "%s", core->parents[i].name);
3022+
else if (core->parents[i].fw_name)
3023+
seq_printf(s, "<%s>(fw)", core->parents[i].fw_name);
3024+
else if (core->parents[i].index >= 0)
3025+
seq_printf(s, "%s",
3026+
of_clk_get_parent_name(core->of_node,
3027+
core->parents[i].index));
3028+
else
3029+
seq_puts(s, "(missing)");
3030+
3031+
seq_putc(s, terminator);
3032+
}
3033+
30003034
static int possible_parents_show(struct seq_file *s, void *data)
30013035
{
30023036
struct clk_core *core = s->private;
30033037
int i;
30043038

30053039
for (i = 0; i < core->num_parents - 1; i++)
3006-
seq_printf(s, "%s ", core->parents[i].name);
3040+
possible_parent_show(s, core, i, ' ');
30073041

3008-
seq_printf(s, "%s\n", core->parents[i].name);
3042+
possible_parent_show(s, core, i, '\n');
30093043

30103044
return 0;
30113045
}

‎drivers/clk/imx/clk-busy.c‎

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,14 @@ static const struct clk_ops clk_busy_divider_ops = {
7878
.set_rate = clk_busy_divider_set_rate,
7979
};
8080

81-
struct clk *imx_clk_busy_divider(const char *name, const char *parent_name,
81+
struct clk_hw *imx_clk_hw_busy_divider(const char *name, const char *parent_name,
8282
void __iomem *reg, u8 shift, u8 width,
8383
void __iomem *busy_reg, u8 busy_shift)
8484
{
8585
struct clk_busy_divider *busy;
86-
struct clk *clk;
86+
struct clk_hw *hw;
8787
struct clk_init_data init;
88+
int ret;
8889

8990
busy = kzalloc(sizeof(*busy), GFP_KERNEL);
9091
if (!busy)
@@ -107,11 +108,15 @@ struct clk *imx_clk_busy_divider(const char *name, const char *parent_name,
107108

108109
busy->div.hw.init = &init;
109110

110-
clk = clk_register(NULL, &busy->div.hw);
111-
if (IS_ERR(clk))
111+
hw = &busy->div.hw;
112+
113+
ret = clk_hw_register(NULL, hw);
114+
if (ret) {
112115
kfree(busy);
116+
return ERR_PTR(ret);
117+
}
113118

114-
return clk;
119+
return hw;
115120
}
116121

117122
struct clk_busy_mux {
@@ -152,13 +157,14 @@ static const struct clk_ops clk_busy_mux_ops = {
152157
.set_parent = clk_busy_mux_set_parent,
153158
};
154159

155-
struct clk *imx_clk_busy_mux(const char *name, void __iomem *reg, u8 shift,
160+
struct clk_hw *imx_clk_hw_busy_mux(const char *name, void __iomem *reg, u8 shift,
156161
u8 width, void __iomem *busy_reg, u8 busy_shift,
157162
const char * const *parent_names, int num_parents)
158163
{
159164
struct clk_busy_mux *busy;
160-
struct clk *clk;
165+
struct clk_hw *hw;
161166
struct clk_init_data init;
167+
int ret;
162168

163169
busy = kzalloc(sizeof(*busy), GFP_KERNEL);
164170
if (!busy)
@@ -181,9 +187,13 @@ struct clk *imx_clk_busy_mux(const char *name, void __iomem *reg, u8 shift,
181187

182188
busy->mux.hw.init = &init;
183189

184-
clk = clk_register(NULL, &busy->mux.hw);
185-
if (IS_ERR(clk))
190+
hw = &busy->mux.hw;
191+
192+
ret = clk_hw_register(NULL, hw);
193+
if (ret) {
186194
kfree(busy);
195+
return ERR_PTR(ret);
196+
}
187197

188-
return clk;
198+
return hw;
189199
}

‎drivers/clk/imx/clk-cpu.c‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,14 @@ static const struct clk_ops clk_cpu_ops = {
7575
.set_rate = clk_cpu_set_rate,
7676
};
7777

78-
struct clk *imx_clk_cpu(const char *name, const char *parent_name,
78+
struct clk_hw *imx_clk_hw_cpu(const char *name, const char *parent_name,
7979
struct clk *div, struct clk *mux, struct clk *pll,
8080
struct clk *step)
8181
{
8282
struct clk_cpu *cpu;
83-
struct clk *clk;
83+
struct clk_hw *hw;
8484
struct clk_init_data init;
85+
int ret;
8586

8687
cpu = kzalloc(sizeof(*cpu), GFP_KERNEL);
8788
if (!cpu)
@@ -99,10 +100,13 @@ struct clk *imx_clk_cpu(const char *name, const char *parent_name,
99100
init.num_parents = 1;
100101

101102
cpu->hw.init = &init;
103+
hw = &cpu->hw;
102104

103-
clk = clk_register(NULL, &cpu->hw);
104-
if (IS_ERR(clk))
105+
ret = clk_hw_register(NULL, hw);
106+
if (ret) {
105107
kfree(cpu);
108+
return ERR_PTR(ret);
109+
}
106110

107-
return clk;
111+
return hw;
108112
}

‎drivers/clk/imx/clk-fixup-div.c‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,14 @@ static const struct clk_ops clk_fixup_div_ops = {
9191
.set_rate = clk_fixup_div_set_rate,
9292
};
9393

94-
struct clk *imx_clk_fixup_divider(const char *name, const char *parent,
94+
struct clk_hw *imx_clk_hw_fixup_divider(const char *name, const char *parent,
9595
void __iomem *reg, u8 shift, u8 width,
9696
void (*fixup)(u32 *val))
9797
{
9898
struct clk_fixup_div *fixup_div;
99-
struct clk *clk;
99+
struct clk_hw *hw;
100100
struct clk_init_data init;
101+
int ret;
101102

102103
if (!fixup)
103104
return ERR_PTR(-EINVAL);
@@ -120,9 +121,13 @@ struct clk *imx_clk_fixup_divider(const char *name, const char *parent,
120121
fixup_div->ops = &clk_divider_ops;
121122
fixup_div->fixup = fixup;
122123

123-
clk = clk_register(NULL, &fixup_div->divider.hw);
124-
if (IS_ERR(clk))
124+
hw = &fixup_div->divider.hw;
125+
126+
ret = clk_hw_register(NULL, hw);
127+
if (ret) {
125128
kfree(fixup_div);
129+
return ERR_PTR(ret);
130+
}
126131

127-
return clk;
132+
return hw;
128133
}

0 commit comments

Comments
 (0)