Skip to content

Commit 270bbc7

Browse files
committed
Merge branches 'clk-doc', 'clk-renesas', 'clk-at91', 'clk-cleanup' and 'clk-debugfs' into clk-next
* clk-doc: clk: Gemini: fix struct name in kernel-doc clk: zynq: pll: Fix kernel-doc warnings clk: imx: pllv1: fix kernel-doc notation for struct clk_pllv1 * clk-renesas: (31 commits) clk: renesas: r9a07g044: Add GPU clock and reset entries clk: renesas: r9a07g044: Add mux and divider for G clock clk: renesas: r9a07g044: Rename CLK_PLL3_DIV4 macro clk: renesas: cpg-mssr: Add support for R-Car S4-8 clk: renesas: rcar-gen4: Introduce R-Car Gen4 CPG driver dt-bindings: clock: Add r8a779f0 CPG Core Clock Definitions dt-bindings: power: Add r8a779f0 SYSC power domain definitions clk: renesas: r9a07g044: Add TSU clock and reset entry mmc: renesas_sdhi: Simplify an expression mmc: renesas_sdhi: Use devm_clk_get_optional() to obtain CD clock dt-bindings: clock: renesas,cpg-mssr: Document r8a779f0 clk: renesas: cpg-mssr: propagate return value of_genpd_add_provider_simple() clk: renesas: cpg-mssr: Check return value of pm_genpd_init() clk: renesas: rzg2l: propagate return value of_genpd_add_provider_simple() clk: renesas: rzg2l: Check return value of pm_genpd_init() clk: renesas: r9a07g044: Add RSPI clock and reset entries clk: renesas: r9a07g044: Change core clock "I" from DEF_FIXED->DEF_DIV clk: renesas: rzg2l: Add CPG_PL1_DDIV macro mmc: renesas_sdhi: Parse DT for SDnH mmc: renesas_sdhi: Use dev_err_probe when getting clock fails ... * clk-at91: clk: lan966x: Extend lan966x clock driver for clock gating support dt-bindings: clock: lan966x: Extend includes with clock gates dt-bindings: clock: lan966x: Extend for clock gate support clk: gate: Add devm_clk_hw_register_gate() clk: lan966x: Add lan966x SoC clock driver dt-bindings: clock: lan966x: Add LAN966X Clock Controller dt-bindings: clock: lan966x: Add binding includes for lan966x SoC clock IDs * clk-cleanup: clk: stm32mp1: remove redundant assignment to pointer data clk: __clk_core_init() never takes NULL clk: clk_core_get() can also return NULL clk/ti/adpll: Make const pointer error a static const array * clk-debugfs: clk: Enable/Disable runtime PM for clk_summary clk: Emit a stern warning with writable debugfs enabled clk: Add write operation for clk_parent debugfs node
5 parents ecb64bb + a5ce1d5 + 8f6b28c + d66e4c9 + 1bb294a commit 270bbc7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1528
-609
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/clock/microchip,lan966x-gck.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Microchip LAN966X Generic Clock Controller
8+
9+
maintainers:
10+
- Kavyasree Kotagiri <kavyasree.kotagiri@microchip.com>
11+
12+
description: |
13+
The LAN966X Generic clock controller contains 3 PLLs - cpu_clk,
14+
ddr_clk and sys_clk. This clock controller generates and supplies
15+
clock to various peripherals within the SoC.
16+
17+
properties:
18+
compatible:
19+
const: microchip,lan966x-gck
20+
21+
reg:
22+
minItems: 1
23+
items:
24+
- description: Generic clock registers
25+
- description: Optional gate clock registers
26+
27+
clocks:
28+
items:
29+
- description: CPU clock source
30+
- description: DDR clock source
31+
- description: System clock source
32+
33+
clock-names:
34+
items:
35+
- const: cpu
36+
- const: ddr
37+
- const: sys
38+
39+
'#clock-cells':
40+
const: 1
41+
42+
required:
43+
- compatible
44+
- reg
45+
- clocks
46+
- clock-names
47+
- '#clock-cells'
48+
49+
additionalProperties: false
50+
51+
examples:
52+
- |
53+
clks: clock-controller@e00c00a8 {
54+
compatible = "microchip,lan966x-gck";
55+
#clock-cells = <1>;
56+
clocks = <&cpu_clk>, <&ddr_clk>, <&sys_clk>;
57+
clock-names = "cpu", "ddr", "sys";
58+
reg = <0xe00c00a8 0x38>;
59+
};
60+
...

Documentation/devicetree/bindings/clock/renesas,cpg-mssr.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ properties:
4848
- renesas,r8a77990-cpg-mssr # R-Car E3
4949
- renesas,r8a77995-cpg-mssr # R-Car D3
5050
- renesas,r8a779a0-cpg-mssr # R-Car V3U
51+
- renesas,r8a779f0-cpg-mssr # R-Car S4-8
5152

5253
reg:
5354
maxItems: 1

drivers/clk/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,13 @@ config COMMON_CLK_GEMINI
221221
This driver supports the SoC clocks on the Cortina Systems Gemini
222222
platform, also known as SL3516 or CS3516.
223223

224+
config COMMON_CLK_LAN966X
225+
bool "Generic Clock Controller driver for LAN966X SoC"
226+
help
227+
This driver provides support for Generic Clock Controller(GCK) on
228+
LAN966X SoC. GCK generates and supplies clock to various peripherals
229+
within the SoC.
230+
224231
config COMMON_CLK_ASPEED
225232
bool "Clock driver for Aspeed BMC SoCs"
226233
depends on ARCH_ASPEED || COMPILE_TEST

drivers/clk/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ obj-$(CONFIG_ARCH_HIGHBANK) += clk-highbank.o
3737
obj-$(CONFIG_CLK_HSDK) += clk-hsdk-pll.o
3838
obj-$(CONFIG_COMMON_CLK_K210) += clk-k210.o
3939
obj-$(CONFIG_LMK04832) += clk-lmk04832.o
40+
obj-$(CONFIG_COMMON_CLK_LAN966X) += clk-lan966x.o
4041
obj-$(CONFIG_COMMON_CLK_LOCHNAGAR) += clk-lochnagar.o
4142
obj-$(CONFIG_COMMON_CLK_MAX77686) += clk-max77686.o
4243
obj-$(CONFIG_COMMON_CLK_MAX9485) += clk-max9485.o

drivers/clk/clk-gate.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88

99
#include <linux/clk-provider.h>
10+
#include <linux/device.h>
1011
#include <linux/module.h>
1112
#include <linux/slab.h>
1213
#include <linux/io.h>
@@ -222,3 +223,37 @@ void clk_hw_unregister_gate(struct clk_hw *hw)
222223
kfree(gate);
223224
}
224225
EXPORT_SYMBOL_GPL(clk_hw_unregister_gate);
226+
227+
static void devm_clk_hw_release_gate(struct device *dev, void *res)
228+
{
229+
clk_hw_unregister_gate(*(struct clk_hw **)res);
230+
}
231+
232+
struct clk_hw *__devm_clk_hw_register_gate(struct device *dev,
233+
struct device_node *np, const char *name,
234+
const char *parent_name, const struct clk_hw *parent_hw,
235+
const struct clk_parent_data *parent_data,
236+
unsigned long flags,
237+
void __iomem *reg, u8 bit_idx,
238+
u8 clk_gate_flags, spinlock_t *lock)
239+
{
240+
struct clk_hw **ptr, *hw;
241+
242+
ptr = devres_alloc(devm_clk_hw_release_gate, sizeof(*ptr), GFP_KERNEL);
243+
if (!ptr)
244+
return ERR_PTR(-ENOMEM);
245+
246+
hw = __clk_hw_register_gate(dev, np, name, parent_name, parent_hw,
247+
parent_data, flags, reg, bit_idx,
248+
clk_gate_flags, lock);
249+
250+
if (!IS_ERR(hw)) {
251+
*ptr = hw;
252+
devres_add(dev, ptr);
253+
} else {
254+
devres_free(ptr);
255+
}
256+
257+
return hw;
258+
}
259+
EXPORT_SYMBOL_GPL(__devm_clk_hw_register_gate);

0 commit comments

Comments
 (0)