Skip to content

Commit cf5f06c

Browse files
committed
Merge branches 'clk-renesas', 'clk-cleanup', 'clk-hisilicon', 'clk-mediatek' and 'clk-bulk' into clk-next
- Add a devm_clk_bulk_get_all_enable() API to get and enable all clks for a device - Fix some static checker errors in the hisilicon clk driver * clk-renesas: (25 commits) clk: renesas: r8a779h0: Add RPC-IF clock clk: renesas: r8a779h0: Add SYS-DMAC clocks clk: renesas: r8a779h0: Add SDHI clock clk: renesas: r8a779h0: Add EtherAVB clocks clk: renesas: r9a07g04[34]: Fix typo for sel_shdi variable clk: renesas: r9a07g04[34]: Use SEL_SDHI1_STS status configuration for SD1 mux clk: renesas: r8a779f0: Correct PFC/GPIO parent clock clk: renesas: r8a779g0: Correct PFC/GPIO parent clocks clk: renesas: r8a779h0: Add I2C clocks clk: renesas: r8a779h0: Add watchdog clock clk: renesas: r8a779h0: Add PFC/GPIO clocks clk: renesas: r8a779g0: Fix PCIe clock name clk: renesas: cpg-mssr: Add support for R-Car V4M clk: renesas: rcar-gen4: Add support for FRQCRC1 clk: renesas: r9a07g043: Add clock and reset entries for CRU clk: renesas: r9a08g045: Add clock and reset support for watchdog dt-bindings: clock: Add R8A779H0 V4M CPG Core Clock Definitions dt-bindings: clock: renesas,cpg-mssr: Document R-Car V4M support dt-bindings: power: Add r8a779h0 SYSC power domain definitions dt-bindings: power: renesas,rcar-sysc: Document R-Car V4M support ... * clk-cleanup: clk: zynq: Prevent null pointer dereference caused by kmalloc failure clk: fractional-divider: Use bit operations consistently clk: fractional-divider: Move mask calculations out of lock clk: ti: dpll3xxx: use correct function names in kernel-doc clk: clocking-wizard: Remove redundant initialization of pointer div_addr clk: keystone: sci-clk: match func name comment to actual clk: cdce925: Remove redundant assignment to variable 'rate' MAINTAINERS: drop Sekhar Nori * clk-hisilicon: clk: hisilicon: Use devm_kcalloc() instead of devm_kzalloc() clk: hisilicon: hi3559a: Fix an erroneous devm_kfree() clk: hisilicon: hi3519: Release the correct number of gates in hi3519_clk_unregister() * clk-mediatek: clk: mediatek: clk-mt8173-apmixedsys: Use common error handling code in clk_mt8173_apmixed_probe() clk: mediatek: add infracfg reset controller for mt7988 dt-bindings: reset: mediatek: add MT7988 infracfg reset IDs dt-bindings: clock: mediatek: convert SSUSBSYS to the json-schema clock dt-bindings: clock: mediatek: convert PCIESYS to the json-schema clock dt-bindings: clock: mediatek: convert hifsys to the json-schema clock clk: mediatek: mt7981-topckgen: flag SGM_REG_SEL as critical clk: mediatek: mt8183: Correct parent of CLK_INFRA_SSPM_32K_SELF clk: mediatek: mt7622-apmixedsys: Fix an error handling path in clk_mt8135_apmixed_probe() clk: mediatek: mt8135: Fix an error handling path in clk_mt8135_apmixed_probe() * clk-bulk: clk: Provide managed helper to get and enable bulk clocks
5 parents 9bd5726 + 7938e9c + 252c31a + f40056a + 265b07d commit cf5f06c

25 files changed

+262
-105
lines changed

CREDITS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2942,6 +2942,11 @@ S: 2364 Old Trail Drive
29422942
S: Reston, Virginia 20191
29432943
S: USA
29442944

2945+
N: Sekhar Nori
2946+
2947+
D: Maintainer of Texas Instruments DaVinci machine support, contributor
2948+
D: to device drivers relevant to that SoC family.
2949+
29452950
N: Fredrik Noring
29462951
29472952
W: http://www.lysator.liu.se/~noring/

Documentation/devicetree/bindings/arm/mediatek/mediatek,hifsys.txt

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

Documentation/devicetree/bindings/arm/mediatek/mediatek,pciesys.txt

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

Documentation/devicetree/bindings/arm/mediatek/mediatek,ssusbsys.txt

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/clock/mediatek,mt2701-hifsys.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: MediaTek HIFSYS clock and reset controller
8+
9+
description:
10+
The MediaTek HIFSYS controller provides various clocks and reset outputs to
11+
the system.
12+
13+
maintainers:
14+
- Matthias Brugger <[email protected]>
15+
16+
properties:
17+
compatible:
18+
oneOf:
19+
- enum:
20+
- mediatek,mt2701-hifsys
21+
- mediatek,mt7622-hifsys
22+
- items:
23+
- enum:
24+
- mediatek,mt7623-hifsys
25+
- const: mediatek,mt2701-hifsys
26+
27+
reg:
28+
maxItems: 1
29+
30+
"#clock-cells":
31+
const: 1
32+
description: The available clocks are defined in dt-bindings/clock/mt*-clk.h
33+
34+
"#reset-cells":
35+
const: 1
36+
37+
required:
38+
- reg
39+
- "#clock-cells"
40+
41+
additionalProperties: false
42+
43+
examples:
44+
- |
45+
clock-controller@1a000000 {
46+
compatible = "mediatek,mt2701-hifsys";
47+
reg = <0x1a000000 0x1000>;
48+
#clock-cells = <1>;
49+
#reset-cells = <1>;
50+
};
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/clock/mediatek,mt7622-pciesys.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: MediaTek PCIESYS clock and reset controller
8+
9+
description:
10+
The MediaTek PCIESYS controller provides various clocks to the system.
11+
12+
maintainers:
13+
- Matthias Brugger <[email protected]>
14+
15+
properties:
16+
compatible:
17+
enum:
18+
- mediatek,mt7622-pciesys
19+
- mediatek,mt7629-pciesys
20+
21+
reg:
22+
maxItems: 1
23+
24+
"#clock-cells":
25+
const: 1
26+
description: The available clocks are defined in dt-bindings/clock/mt*-clk.h
27+
28+
"#reset-cells":
29+
const: 1
30+
31+
required:
32+
- reg
33+
- "#clock-cells"
34+
- "#reset-cells"
35+
36+
additionalProperties: false
37+
38+
examples:
39+
- |
40+
clock-controller@1a100800 {
41+
compatible = "mediatek,mt7622-pciesys";
42+
reg = <0x1a100800 0x1000>;
43+
#clock-cells = <1>;
44+
#reset-cells = <1>;
45+
};
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/clock/mediatek,mt7622-ssusbsys.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: MediaTek SSUSBSYS clock and reset controller
8+
9+
description:
10+
The MediaTek SSUSBSYS controller provides various clocks to the system.
11+
12+
maintainers:
13+
- Matthias Brugger <[email protected]>
14+
15+
properties:
16+
compatible:
17+
enum:
18+
- mediatek,mt7622-ssusbsys
19+
- mediatek,mt7629-ssusbsys
20+
21+
reg:
22+
maxItems: 1
23+
24+
"#clock-cells":
25+
const: 1
26+
description: The available clocks are defined in dt-bindings/clock/mt*-clk.h
27+
28+
"#reset-cells":
29+
const: 1
30+
31+
required:
32+
- reg
33+
- "#clock-cells"
34+
- "#reset-cells"
35+
36+
additionalProperties: false
37+
38+
examples:
39+
- |
40+
clock-controller@1a000000 {
41+
compatible = "mediatek,mt7622-ssusbsys";
42+
reg = <0x1a000000 0x1000>;
43+
#clock-cells = <1>;
44+
#reset-cells = <1>;
45+
};

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21940,7 +21940,6 @@ F: drivers/i2c/busses/i2c-davinci.c
2194021940

2194121941
TI DAVINCI SERIES CLOCK DRIVER
2194221942
M: David Lechner <[email protected]>
21943-
R: Sekhar Nori <[email protected]>
2194421943
S: Maintained
2194521944
F: Documentation/devicetree/bindings/clock/ti/davinci/
2194621945
F: drivers/clk/davinci/

drivers/clk/clk-cdce925.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ static void cdce925_pll_find_rate(unsigned long rate,
101101

102102
if (rate <= parent_rate) {
103103
/* Can always deliver parent_rate in bypass mode */
104-
rate = parent_rate;
105104
*n = 0;
106105
*m = 0;
107106
} else {

drivers/clk/clk-devres.c

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,46 @@ int __must_check devm_clk_bulk_get_all(struct device *dev,
182182
}
183183
EXPORT_SYMBOL_GPL(devm_clk_bulk_get_all);
184184

185+
static void devm_clk_bulk_release_all_enable(struct device *dev, void *res)
186+
{
187+
struct clk_bulk_devres *devres = res;
188+
189+
clk_bulk_disable_unprepare(devres->num_clks, devres->clks);
190+
clk_bulk_put_all(devres->num_clks, devres->clks);
191+
}
192+
193+
int __must_check devm_clk_bulk_get_all_enable(struct device *dev,
194+
struct clk_bulk_data **clks)
195+
{
196+
struct clk_bulk_devres *devres;
197+
int ret;
198+
199+
devres = devres_alloc(devm_clk_bulk_release_all_enable,
200+
sizeof(*devres), GFP_KERNEL);
201+
if (!devres)
202+
return -ENOMEM;
203+
204+
ret = clk_bulk_get_all(dev, &devres->clks);
205+
if (ret > 0) {
206+
*clks = devres->clks;
207+
devres->num_clks = ret;
208+
} else {
209+
devres_free(devres);
210+
return ret;
211+
}
212+
213+
ret = clk_bulk_prepare_enable(devres->num_clks, *clks);
214+
if (!ret) {
215+
devres_add(dev, devres);
216+
} else {
217+
clk_bulk_put_all(devres->num_clks, devres->clks);
218+
devres_free(devres);
219+
}
220+
221+
return ret;
222+
}
223+
EXPORT_SYMBOL_GPL(devm_clk_bulk_get_all_enable);
224+
185225
static int devm_clk_match(struct device *dev, void *res, void *data)
186226
{
187227
struct clk **c = res;

0 commit comments

Comments
 (0)