Skip to content

Commit 3066c52

Browse files
committed
Merge branches 'clk-samsung', 'clk-imx', 'clk-rockchip', 'clk-clkdev' and 'clk-rate-exclusive' into clk-next
- Increase dev_id len for clkdev lookups * clk-samsung: (25 commits) clk: samsung: Add CPU clock support for Exynos850 clk: samsung: Pass mask to wait_until_mux_stable() clk: samsung: Keep register offsets in chip specific structure clk: samsung: Keep CPU clock chip specific data in a dedicated struct clk: samsung: Pass register layout type explicitly to CLK_CPU() clk: samsung: Pass actual CPU clock registers base to CPU_CLK() clk: samsung: Group CPU clock functions by chip clk: samsung: Use single CPU clock notifier callback for all chips clk: samsung: Reduce params count in exynos_register_cpu_clock() clk: samsung: Pull struct exynos_cpuclk into clk-cpu.c clk: samsung: Improve clk-cpu.c style dt-bindings: clock: exynos850: Add CMU_CPUCLK0 and CMU_CPUCL1 clk: samsung: gs101: add support for cmu_peric1 clk: samsung: gs101: drop extra empty line dt-bindings: clock: google,gs101-clock: add PERIC1 clock management unit clk: samsung: exynos850: Propagate SPI IPCLK rate change clk: samsung: gs101: gpio_peric0_pclk needs to be kept on clk: samsung: exynos850: Add PDMA clocks dt-bindings: clock: tesla,fsd: Fix spelling mistake clk: samsung: gs101: add support for cmu_peric0 ... * clk-imx: clk: imx: imx8mp: Fix SAI_MCLK_SEL definition clk: imx: scu: Use common error handling code in imx_clk_scu_alloc_dev() clk: imx: composite-8m: Delete two unnecessary initialisations in __imx8m_clk_hw_composite() clk: imx: composite-8m: Less function calls in __imx8m_clk_hw_composite() after error detection * clk-rockchip: clk: rockchip: rk3399: Allow to set rate of clk_i2s0_frac's parent clk: rockchip: rk3588: use linked clock ID for GATE_LINK clk: rockchip: rk3588: fix indent clk: rockchip: rk3588: fix pclk_vo0grf and pclk_vo1grf dt-bindings: clock: rk3588: add missing PCLK_VO1GRF dt-bindings: clock: rk3588: drop CLK_NR_CLKS clk: rockchip: rk3588: fix CLK_NR_CLKS usage clk: rockchip: rk3568: Add PLL rate for 128MHz * clk-clkdev: clkdev: Update clkdev id usage to allow for longer names * clk-rate-exclusive: clk: Add a devm variant of clk_rate_exclusive_get()
6 parents 68e4ebd + d289ca7 + 79b92ba + 3e76237 + 99f4570 + b0cde62 commit 3066c52

27 files changed

+1771
-297
lines changed

Documentation/devicetree/bindings/clock/google,gs101-clock.yaml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,16 @@ properties:
3030
- google,gs101-cmu-top
3131
- google,gs101-cmu-apm
3232
- google,gs101-cmu-misc
33+
- google,gs101-cmu-peric0
34+
- google,gs101-cmu-peric1
3335

3436
clocks:
3537
minItems: 1
36-
maxItems: 2
38+
maxItems: 3
3739

3840
clock-names:
3941
minItems: 1
40-
maxItems: 2
42+
maxItems: 3
4143

4244
"#clock-cells":
4345
const: 1
@@ -85,8 +87,30 @@ allOf:
8587

8688
clock-names:
8789
items:
88-
- const: dout_cmu_misc_bus
89-
- const: dout_cmu_misc_sss
90+
- const: bus
91+
- const: sss
92+
93+
- if:
94+
properties:
95+
compatible:
96+
contains:
97+
enum:
98+
- google,gs101-cmu-peric0
99+
- google,gs101-cmu-peric1
100+
101+
then:
102+
properties:
103+
clocks:
104+
items:
105+
- description: External reference clock (24.576 MHz)
106+
- description: Connectivity Peripheral 0/1 bus clock (from CMU_TOP)
107+
- description: Connectivity Peripheral 0/1 IP clock (from CMU_TOP)
108+
109+
clock-names:
110+
items:
111+
- const: oscclk
112+
- const: bus
113+
- const: ip
90114

91115
additionalProperties: false
92116

Documentation/devicetree/bindings/clock/samsung,exynos850-clock.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ properties:
3636
- samsung,exynos850-cmu-aud
3737
- samsung,exynos850-cmu-cmgp
3838
- samsung,exynos850-cmu-core
39+
- samsung,exynos850-cmu-cpucl0
40+
- samsung,exynos850-cmu-cpucl1
3941
- samsung,exynos850-cmu-dpu
4042
- samsung,exynos850-cmu-g3d
4143
- samsung,exynos850-cmu-hsi
@@ -152,6 +154,46 @@ allOf:
152154
- const: dout_core_mmc_embd
153155
- const: dout_core_sss
154156

157+
- if:
158+
properties:
159+
compatible:
160+
contains:
161+
const: samsung,exynos850-cmu-cpucl0
162+
163+
then:
164+
properties:
165+
clocks:
166+
items:
167+
- description: External reference clock (26 MHz)
168+
- description: CPUCL0 switch clock (from CMU_TOP)
169+
- description: CPUCL0 debug clock (from CMU_TOP)
170+
171+
clock-names:
172+
items:
173+
- const: oscclk
174+
- const: dout_cpucl0_switch
175+
- const: dout_cpucl0_dbg
176+
177+
- if:
178+
properties:
179+
compatible:
180+
contains:
181+
const: samsung,exynos850-cmu-cpucl1
182+
183+
then:
184+
properties:
185+
clocks:
186+
items:
187+
- description: External reference clock (26 MHz)
188+
- description: CPUCL1 switch clock (from CMU_TOP)
189+
- description: CPUCL1 debug clock (from CMU_TOP)
190+
191+
clock-names:
192+
items:
193+
- const: oscclk
194+
- const: dout_cpucl1_switch
195+
- const: dout_cpucl1_dbg
196+
155197
- if:
156198
properties:
157199
compatible:

Documentation/devicetree/bindings/clock/tesla,fsd-clock.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ maintainers:
1212

1313
description: |
1414
FSD clock controller consist of several clock management unit
15-
(CMU), which generates clocks for various inteernal SoC blocks.
15+
(CMU), which generates clocks for various internal SoC blocks.
1616
The root clock comes from external OSC clock (24 MHz).
1717
1818
All available clocks are defined as preprocessor macros in

drivers/clk/clk.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,25 @@ int clk_rate_exclusive_get(struct clk *clk)
942942
}
943943
EXPORT_SYMBOL_GPL(clk_rate_exclusive_get);
944944

945+
static void devm_clk_rate_exclusive_put(void *data)
946+
{
947+
struct clk *clk = data;
948+
949+
clk_rate_exclusive_put(clk);
950+
}
951+
952+
int devm_clk_rate_exclusive_get(struct device *dev, struct clk *clk)
953+
{
954+
int ret;
955+
956+
ret = clk_rate_exclusive_get(clk);
957+
if (ret)
958+
return ret;
959+
960+
return devm_add_action_or_reset(dev, devm_clk_rate_exclusive_put, clk);
961+
}
962+
EXPORT_SYMBOL_GPL(devm_clk_rate_exclusive_get);
963+
945964
static void clk_core_unprepare(struct clk_core *core)
946965
{
947966
lockdep_assert_held(&prepare_lock);

drivers/clk/clkdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ void clkdev_add_table(struct clk_lookup *cl, size_t num)
144144
mutex_unlock(&clocks_mutex);
145145
}
146146

147-
#define MAX_DEV_ID 20
147+
#define MAX_DEV_ID 24
148148
#define MAX_CON_ID 16
149149

150150
struct clk_lookup_alloc {

drivers/clk/imx/clk-composite-8m.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,15 +212,15 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name,
212212
{
213213
struct clk_hw *hw = ERR_PTR(-ENOMEM), *mux_hw;
214214
struct clk_hw *div_hw, *gate_hw = NULL;
215-
struct clk_divider *div = NULL;
215+
struct clk_divider *div;
216216
struct clk_gate *gate = NULL;
217-
struct clk_mux *mux = NULL;
217+
struct clk_mux *mux;
218218
const struct clk_ops *divider_ops;
219219
const struct clk_ops *mux_ops;
220220

221221
mux = kzalloc(sizeof(*mux), GFP_KERNEL);
222222
if (!mux)
223-
goto fail;
223+
return ERR_CAST(hw);
224224

225225
mux_hw = &mux->hw;
226226
mux->reg = reg;
@@ -230,7 +230,7 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name,
230230

231231
div = kzalloc(sizeof(*div), GFP_KERNEL);
232232
if (!div)
233-
goto fail;
233+
goto free_mux;
234234

235235
div_hw = &div->hw;
236236
div->reg = reg;
@@ -260,7 +260,7 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name,
260260
if (!mcore_booted) {
261261
gate = kzalloc(sizeof(*gate), GFP_KERNEL);
262262
if (!gate)
263-
goto fail;
263+
goto free_div;
264264

265265
gate_hw = &gate->hw;
266266
gate->reg = reg;
@@ -272,13 +272,15 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name,
272272
mux_hw, mux_ops, div_hw,
273273
divider_ops, gate_hw, &clk_gate_ops, flags);
274274
if (IS_ERR(hw))
275-
goto fail;
275+
goto free_gate;
276276

277277
return hw;
278278

279-
fail:
279+
free_gate:
280280
kfree(gate);
281+
free_div:
281282
kfree(div);
283+
free_mux:
282284
kfree(mux);
283285
return ERR_CAST(hw);
284286
}

drivers/clk/imx/clk-imx8mp-audiomix.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818

1919
#define CLKEN0 0x000
2020
#define CLKEN1 0x004
21-
#define SAI_MCLK_SEL(n) (0x300 + 4 * (n)) /* n in 0..5 */
21+
#define SAI1_MCLK_SEL 0x300
22+
#define SAI2_MCLK_SEL 0x304
23+
#define SAI3_MCLK_SEL 0x308
24+
#define SAI5_MCLK_SEL 0x30C
25+
#define SAI6_MCLK_SEL 0x310
26+
#define SAI7_MCLK_SEL 0x314
2227
#define PDM_SEL 0x318
2328
#define SAI_PLL_GNRL_CTL 0x400
2429

@@ -95,13 +100,13 @@ static const struct clk_parent_data clk_imx8mp_audiomix_pll_bypass_sels[] = {
95100
IMX8MP_CLK_AUDIOMIX_SAI##n##_MCLK1_SEL, {}, \
96101
clk_imx8mp_audiomix_sai##n##_mclk1_parents, \
97102
ARRAY_SIZE(clk_imx8mp_audiomix_sai##n##_mclk1_parents), \
98-
SAI_MCLK_SEL(n), 1, 0 \
103+
SAI##n##_MCLK_SEL, 1, 0 \
99104
}, { \
100105
"sai"__stringify(n)"_mclk2_sel", \
101106
IMX8MP_CLK_AUDIOMIX_SAI##n##_MCLK2_SEL, {}, \
102107
clk_imx8mp_audiomix_sai_mclk2_parents, \
103108
ARRAY_SIZE(clk_imx8mp_audiomix_sai_mclk2_parents), \
104-
SAI_MCLK_SEL(n), 4, 1 \
109+
SAI##n##_MCLK_SEL, 4, 1 \
105110
}, { \
106111
"sai"__stringify(n)"_ipg_cg", \
107112
IMX8MP_CLK_AUDIOMIX_SAI##n##_IPG, \

drivers/clk/imx/clk-scu.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -712,31 +712,29 @@ struct clk_hw *imx_clk_scu_alloc_dev(const char *name,
712712
}
713713

714714
ret = platform_device_add_data(pdev, &clk, sizeof(clk));
715-
if (ret) {
716-
platform_device_put(pdev);
717-
return ERR_PTR(ret);
718-
}
715+
if (ret)
716+
goto put_device;
719717

720718
ret = driver_set_override(&pdev->dev, &pdev->driver_override,
721719
"imx-scu-clk", strlen("imx-scu-clk"));
722-
if (ret) {
723-
platform_device_put(pdev);
724-
return ERR_PTR(ret);
725-
}
720+
if (ret)
721+
goto put_device;
726722

727723
ret = imx_clk_scu_attach_pd(&pdev->dev, rsrc_id);
728724
if (ret)
729725
pr_warn("%s: failed to attached the power domain %d\n",
730726
name, ret);
731727

732728
ret = platform_device_add(pdev);
733-
if (ret) {
734-
platform_device_put(pdev);
735-
return ERR_PTR(ret);
736-
}
729+
if (ret)
730+
goto put_device;
737731

738732
/* For API backwards compatiblilty, simply return NULL for success */
739733
return NULL;
734+
735+
put_device:
736+
platform_device_put(pdev);
737+
return ERR_PTR(ret);
740738
}
741739

742740
void imx_clk_scu_unregister(void)

drivers/clk/rockchip/clk-rk3399.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ static struct rockchip_clk_branch rk3399_clk_branches[] __initdata = {
597597
COMPOSITE(0, "clk_i2s0_div", mux_pll_src_cpll_gpll_p, 0,
598598
RK3399_CLKSEL_CON(28), 7, 1, MFLAGS, 0, 7, DFLAGS,
599599
RK3399_CLKGATE_CON(8), 3, GFLAGS),
600-
COMPOSITE_FRACMUX(0, "clk_i2s0_frac", "clk_i2s0_div", 0,
600+
COMPOSITE_FRACMUX(0, "clk_i2s0_frac", "clk_i2s0_div", CLK_SET_RATE_PARENT,
601601
RK3399_CLKSEL_CON(96), 0,
602602
RK3399_CLKGATE_CON(8), 4, GFLAGS,
603603
&rk3399_i2s0_fracmux),
@@ -607,7 +607,7 @@ static struct rockchip_clk_branch rk3399_clk_branches[] __initdata = {
607607
COMPOSITE(0, "clk_i2s1_div", mux_pll_src_cpll_gpll_p, 0,
608608
RK3399_CLKSEL_CON(29), 7, 1, MFLAGS, 0, 7, DFLAGS,
609609
RK3399_CLKGATE_CON(8), 6, GFLAGS),
610-
COMPOSITE_FRACMUX(0, "clk_i2s1_frac", "clk_i2s1_div", 0,
610+
COMPOSITE_FRACMUX(0, "clk_i2s1_frac", "clk_i2s1_div", CLK_SET_RATE_PARENT,
611611
RK3399_CLKSEL_CON(97), 0,
612612
RK3399_CLKGATE_CON(8), 7, GFLAGS,
613613
&rk3399_i2s1_fracmux),
@@ -617,7 +617,7 @@ static struct rockchip_clk_branch rk3399_clk_branches[] __initdata = {
617617
COMPOSITE(0, "clk_i2s2_div", mux_pll_src_cpll_gpll_p, 0,
618618
RK3399_CLKSEL_CON(30), 7, 1, MFLAGS, 0, 7, DFLAGS,
619619
RK3399_CLKGATE_CON(8), 9, GFLAGS),
620-
COMPOSITE_FRACMUX(0, "clk_i2s2_frac", "clk_i2s2_div", 0,
620+
COMPOSITE_FRACMUX(0, "clk_i2s2_frac", "clk_i2s2_div", CLK_SET_RATE_PARENT,
621621
RK3399_CLKSEL_CON(98), 0,
622622
RK3399_CLKGATE_CON(8), 10, GFLAGS,
623623
&rk3399_i2s2_fracmux),

drivers/clk/rockchip/clk-rk3568.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ static struct rockchip_pll_rate_table rk3568_pll_rates[] = {
7878
RK3036_PLL_RATE(200000000, 1, 100, 3, 4, 1, 0),
7979
RK3036_PLL_RATE(148500000, 1, 99, 4, 4, 1, 0),
8080
RK3036_PLL_RATE(135000000, 2, 45, 4, 1, 1, 0),
81+
RK3036_PLL_RATE(128000000, 1, 16, 3, 1, 1, 0),
8182
RK3036_PLL_RATE(126400000, 1, 79, 5, 3, 1, 0),
8283
RK3036_PLL_RATE(119000000, 3, 119, 4, 2, 1, 0),
8384
RK3036_PLL_RATE(115200000, 1, 24, 5, 1, 1, 0),

0 commit comments

Comments
 (0)