* [PATCH v3 1/3] dt-bindings: pwm: amlogic: Add core clock for S4 like
2026-09-27 14:28 [PATCH v3 0/3] Add T7 PWM core clock support Ronald Claveau via B4 Relay
@ 2026-09-27 14:28 ` Ronald Claveau via B4 Relay
2026-09-28 16:46 ` Conor Dooley
2026-09-27 14:28 ` [PATCH v3 2/3] pwm: meson: Add optional core clock for S4 PWM Ronald Claveau via B4 Relay
2026-09-27 14:28 ` [PATCH v3 3/3] arm64: dts: amlogic: a1-c3-s4-t7: Add core clock to PWM controller nodes Ronald Claveau via B4 Relay
2 siblings, 1 reply; 5+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-09-27 14:28 UTC (permalink / raw)
To: Uwe Kleine-König, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Heiner Kallweit, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl
Cc: linux-pwm, devicetree, linux-kernel, linux-arm-kernel,
linux-amlogic, Ronald Claveau
From: Ronald Claveau <linux-kernel-dev@aliel.fr>
The T7, A1, C3, and S4 PWM controllers have a system clock in
addition to the two input clocks of channels A and B.
The channel clocks are acquired by index in the pwm driver,
where the core clock is fetched by name, with optional get
which is silent when not provided.
Require clock-names and minimum 3 items for S4, and devices
which fallback to S4, where the PWM devices do not work
without all 3 clocks.
Add an example showing T7 usage with its fallback to
amlogic,meson-s4-pwm.
Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
.../devicetree/bindings/pwm/pwm-amlogic.yaml | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml b/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml
index c337d85da40f1..e9cd5f1fdf264 100644
--- a/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml
+++ b/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml
@@ -62,7 +62,7 @@ properties:
clock-names:
minItems: 1
- maxItems: 2
+ maxItems: 3
power-domains:
maxItems: 1
@@ -143,9 +143,15 @@ allOf:
items:
- description: input clock of PWM channel A
- description: input clock of PWM channel B
- clock-names: false
+ - description: gate clock for the PWM controller
+ clock-names:
+ items:
+ - const: channel-a
+ - const: channel-b
+ - const: core
required:
- clocks
+ - clock-names
- if:
properties:
@@ -179,6 +185,15 @@ examples:
pwm@1000 {
compatible = "amlogic,meson-s4-pwm";
reg = <0x1000 0x10>;
- clocks = <&pwm_src_a>, <&pwm_src_b>;
+ clocks = <&pwm_src_a>, <&pwm_src_b>, <&pwm_src_core>;
+ clock-names = "channel-a", "channel-b", "core";
+ #pwm-cells = <3>;
+ };
+ - |
+ pwm@60000 {
+ compatible = "amlogic,t7-pwm", "amlogic,meson-s4-pwm";
+ reg = <0x60000 0x24>;
+ clocks = <&channel_a>, <&channel_b>, <&core>;
+ clock-names = "channel-a", "channel-b", "core";
#pwm-cells = <3>;
};
--
2.49.0
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH v3 3/3] arm64: dts: amlogic: a1-c3-s4-t7: Add core clock to PWM controller nodes
2026-09-27 14:28 [PATCH v3 0/3] Add T7 PWM core clock support Ronald Claveau via B4 Relay
2026-09-27 14:28 ` [PATCH v3 1/3] dt-bindings: pwm: amlogic: Add core clock for S4 like Ronald Claveau via B4 Relay
2026-09-27 14:28 ` [PATCH v3 2/3] pwm: meson: Add optional core clock for S4 PWM Ronald Claveau via B4 Relay
@ 2026-09-27 14:28 ` Ronald Claveau via B4 Relay
2 siblings, 0 replies; 5+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-09-27 14:28 UTC (permalink / raw)
To: Uwe Kleine-König, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Heiner Kallweit, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl
Cc: linux-pwm, devicetree, linux-kernel, linux-arm-kernel,
linux-amlogic, Ronald Claveau
From: Ronald Claveau <linux-kernel-dev@aliel.fr>
Describe the system clock of each PWM controller as a third clock,
and add the clock-names property expected by the updated binding:
"channel-a", "channel-b" and "core".
Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi | 28 +++++++++++++++++++++-------
arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 28 +++++++++++++++++++++-------
arch/arm64/boot/dts/amlogic/meson-a1.dtsi | 12 +++++++++---
arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 20 +++++++++++++++-----
4 files changed, 66 insertions(+), 22 deletions(-)
diff --git a/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi
index 4e6757a57fb9a..a27e9bba22e5d 100644
--- a/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi
+++ b/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi
@@ -824,7 +824,9 @@ pwm_mn: pwm@54000 {
"amlogic,meson-s4-pwm";
reg = <0x0 0x54000 0x0 0x24>;
clocks = <&clkc_periphs CLKID_PWM_M>,
- <&clkc_periphs CLKID_PWM_N>;
+ <&clkc_periphs CLKID_PWM_N>,
+ <&clkc_periphs CLKID_SYS_PWM_MN>;
+ clock-names = "channel-a", "channel-b", "core";
#pwm-cells = <3>;
status = "disabled";
};
@@ -843,7 +845,9 @@ pwm_ab: pwm@58000 {
"amlogic,meson-s4-pwm";
reg = <0x0 0x58000 0x0 0x24>;
clocks = <&clkc_periphs CLKID_PWM_A>,
- <&clkc_periphs CLKID_PWM_B>;
+ <&clkc_periphs CLKID_PWM_B>,
+ <&clkc_periphs CLKID_SYS_PWM_AB>;
+ clock-names = "channel-a", "channel-b", "core";
#pwm-cells = <3>;
status = "disabled";
};
@@ -853,7 +857,9 @@ pwm_cd: pwm@5a000 {
"amlogic,meson-s4-pwm";
reg = <0x0 0x5a000 0x0 0x24>;
clocks = <&clkc_periphs CLKID_PWM_C>,
- <&clkc_periphs CLKID_PWM_D>;
+ <&clkc_periphs CLKID_PWM_D>,
+ <&clkc_periphs CLKID_SYS_PWM_CD>;
+ clock-names = "channel-a", "channel-b", "core";
#pwm-cells = <3>;
status = "disabled";
};
@@ -863,7 +869,9 @@ pwm_ef: pwm@5c000 {
"amlogic,meson-s4-pwm";
reg = <0x0 0x5c000 0x0 0x24>;
clocks = <&clkc_periphs CLKID_PWM_E>,
- <&clkc_periphs CLKID_PWM_F>;
+ <&clkc_periphs CLKID_PWM_F>,
+ <&clkc_periphs CLKID_SYS_PWM_EF>;
+ clock-names = "channel-a", "channel-b", "core";
#pwm-cells = <3>;
status = "disabled";
};
@@ -873,7 +881,9 @@ pwm_gh: pwm@5e000 {
"amlogic,meson-s4-pwm";
reg = <0x0 0x5e000 0x0 0x24>;
clocks = <&clkc_periphs CLKID_PWM_G>,
- <&clkc_periphs CLKID_PWM_H>;
+ <&clkc_periphs CLKID_PWM_H>,
+ <&clkc_periphs CLKID_SYS_PWM_GH>;
+ clock-names = "channel-a", "channel-b", "core";
#pwm-cells = <3>;
status = "disabled";
};
@@ -883,7 +893,9 @@ pwm_ij: pwm@60000 {
"amlogic,meson-s4-pwm";
reg = <0x0 0x60000 0x0 0x24>;
clocks = <&clkc_periphs CLKID_PWM_I>,
- <&clkc_periphs CLKID_PWM_J>;
+ <&clkc_periphs CLKID_PWM_J>,
+ <&clkc_periphs CLKID_SYS_PWM_IJ>;
+ clock-names = "channel-a", "channel-b", "core";
#pwm-cells = <3>;
status = "disabled";
};
@@ -893,7 +905,9 @@ pwm_kl: pwm@62000 {
"amlogic,meson-s4-pwm";
reg = <0x0 0x62000 0x0 0x24>;
clocks = <&clkc_periphs CLKID_PWM_K>,
- <&clkc_periphs CLKID_PWM_L>;
+ <&clkc_periphs CLKID_PWM_L>,
+ <&clkc_periphs CLKID_SYS_PWM_KL>;
+ clock-names = "channel-a", "channel-b", "core";
#pwm-cells = <3>;
status = "disabled";
};
diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
index 8f3f1c0579a0f..8a148af5ed442 100644
--- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
+++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
@@ -692,7 +692,9 @@ pwm_ao_ef: pwm@30000 {
compatible = "amlogic,t7-pwm", "amlogic,meson-s4-pwm";
reg = <0x0 0x30000 0x0 0x24>;
clocks = <&clkc_periphs CLKID_PWM_AO_E>,
- <&clkc_periphs CLKID_PWM_AO_F>;
+ <&clkc_periphs CLKID_PWM_AO_F>,
+ <&clkc_periphs CLKID_SYS_PWM_AO_EF>;
+ clock-names = "channel-a", "channel-b", "core";
#pwm-cells = <3>;
status = "disabled";
};
@@ -701,7 +703,9 @@ pwm_ao_gh: pwm@32000 {
compatible = "amlogic,t7-pwm", "amlogic,meson-s4-pwm";
reg = <0x0 0x32000 0x0 0x24>;
clocks = <&clkc_periphs CLKID_PWM_AO_G>,
- <&clkc_periphs CLKID_PWM_AO_H>;
+ <&clkc_periphs CLKID_PWM_AO_H>,
+ <&clkc_periphs CLKID_SYS_PWM_AO_GH>;
+ clock-names = "channel-a", "channel-b", "core";
#pwm-cells = <3>;
status = "disabled";
};
@@ -715,7 +719,9 @@ pwm_ab: pwm@58000 {
compatible = "amlogic,t7-pwm", "amlogic,meson-s4-pwm";
reg = <0x0 0x58000 0x0 0x24>;
clocks = <&clkc_periphs CLKID_PWM_A>,
- <&clkc_periphs CLKID_PWM_B>;
+ <&clkc_periphs CLKID_PWM_B>,
+ <&clkc_periphs CLKID_SYS_PWM_AB>;
+ clock-names = "channel-a", "channel-b", "core";
#pwm-cells = <3>;
status = "disabled";
};
@@ -724,7 +730,9 @@ pwm_cd: pwm@5a000 {
compatible = "amlogic,t7-pwm", "amlogic,meson-s4-pwm";
reg = <0x0 0x5a000 0x0 0x24>;
clocks = <&clkc_periphs CLKID_PWM_C>,
- <&clkc_periphs CLKID_PWM_D>;
+ <&clkc_periphs CLKID_PWM_D>,
+ <&clkc_periphs CLKID_SYS_PWM_CD>;
+ clock-names = "channel-a", "channel-b", "core";
#pwm-cells = <3>;
status = "disabled";
};
@@ -733,7 +741,9 @@ pwm_ef: pwm@5c000 {
compatible = "amlogic,t7-pwm", "amlogic,meson-s4-pwm";
reg = <0x0 0x5c000 0x0 0x24>;
clocks = <&clkc_periphs CLKID_PWM_E>,
- <&clkc_periphs CLKID_PWM_F>;
+ <&clkc_periphs CLKID_PWM_F>,
+ <&clkc_periphs CLKID_SYS_PWM_EF>;
+ clock-names = "channel-a", "channel-b", "core";
#pwm-cells = <3>;
status = "disabled";
};
@@ -742,7 +752,9 @@ pwm_ao_ab: pwm@5e000 {
compatible = "amlogic,t7-pwm", "amlogic,meson-s4-pwm";
reg = <0x0 0x5e000 0x0 0x24>;
clocks = <&clkc_periphs CLKID_PWM_AO_A>,
- <&clkc_periphs CLKID_PWM_AO_B>;
+ <&clkc_periphs CLKID_PWM_AO_B>,
+ <&clkc_periphs CLKID_SYS_PWM_AO_AB>;
+ clock-names = "channel-a", "channel-b", "core";
#pwm-cells = <3>;
status = "disabled";
};
@@ -751,7 +763,9 @@ pwm_ao_cd: pwm@60000 {
compatible = "amlogic,t7-pwm", "amlogic,meson-s4-pwm";
reg = <0x0 0x60000 0x0 0x24>;
clocks = <&clkc_periphs CLKID_PWM_AO_C>,
- <&clkc_periphs CLKID_PWM_AO_D>;
+ <&clkc_periphs CLKID_PWM_AO_D>,
+ <&clkc_periphs CLKID_SYS_PWM_AO_CD>;
+ clock-names = "channel-a", "channel-b", "core";
#pwm-cells = <3>;
status = "disabled";
};
diff --git a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
index 6f6a6145cba12..b9761893c666d 100644
--- a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
@@ -544,7 +544,9 @@ pwm_ab: pwm@2400 {
reg = <0x0 0x2400 0x0 0x24>;
#pwm-cells = <3>;
clocks = <&clkc_periphs CLKID_PWM_A>,
- <&clkc_periphs CLKID_PWM_B>;
+ <&clkc_periphs CLKID_PWM_B>,
+ <&clkc_periphs CLKID_PWM_AB>;
+ clock-names = "channel-a", "channel-b", "core";
power-domains = <&pwrc PWRC_I2C_ID>;
status = "disabled";
};
@@ -555,7 +557,9 @@ pwm_cd: pwm@2800 {
reg = <0x0 0x2800 0x0 0x24>;
#pwm-cells = <3>;
clocks = <&clkc_periphs CLKID_PWM_C>,
- <&clkc_periphs CLKID_PWM_D>;
+ <&clkc_periphs CLKID_PWM_D>,
+ <&clkc_periphs CLKID_PWM_CD>;
+ clock-names = "channel-a", "channel-b", "core";
power-domains = <&pwrc PWRC_I2C_ID>;
status = "disabled";
};
@@ -655,7 +659,9 @@ pwm_ef: pwm@5400 {
reg = <0x0 0x5400 0x0 0x24>;
#pwm-cells = <3>;
clocks = <&clkc_periphs CLKID_PWM_E>,
- <&clkc_periphs CLKID_PWM_F>;
+ <&clkc_periphs CLKID_PWM_F>,
+ <&clkc_periphs CLKID_PWM_EF>;
+ clock-names = "channel-a", "channel-b", "core";
power-domains = <&pwrc PWRC_I2C_ID>;
status = "disabled";
};
diff --git a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
index 2a6fbd5308362..ca9abbf857178 100644
--- a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
@@ -685,7 +685,9 @@ pwm_ab: pwm@58000 {
compatible = "amlogic,meson-s4-pwm";
reg = <0x0 0x58000 0x0 0x24>;
clocks = <&clkc_periphs CLKID_PWM_A>,
- <&clkc_periphs CLKID_PWM_B>;
+ <&clkc_periphs CLKID_PWM_B>,
+ <&clkc_periphs CLKID_PWM_AB>;
+ clock-names = "channel-a", "channel-b", "core";
#pwm-cells = <3>;
status = "disabled";
};
@@ -694,7 +696,9 @@ pwm_cd: pwm@5a000 {
compatible = "amlogic,meson-s4-pwm";
reg = <0x0 0x5a000 0x0 0x24>;
clocks = <&clkc_periphs CLKID_PWM_C>,
- <&clkc_periphs CLKID_PWM_D>;
+ <&clkc_periphs CLKID_PWM_D>,
+ <&clkc_periphs CLKID_PWM_CD>;
+ clock-names = "channel-a", "channel-b", "core";
#pwm-cells = <3>;
status = "disabled";
};
@@ -703,7 +707,9 @@ pwm_ef: pwm@5c000 {
compatible = "amlogic,meson-s4-pwm";
reg = <0x0 0x5c000 0x0 0x24>;
clocks = <&clkc_periphs CLKID_PWM_E>,
- <&clkc_periphs CLKID_PWM_F>;
+ <&clkc_periphs CLKID_PWM_F>,
+ <&clkc_periphs CLKID_PWM_EF>;
+ clock-names = "channel-a", "channel-b", "core";
#pwm-cells = <3>;
status = "disabled";
};
@@ -712,7 +718,9 @@ pwm_gh: pwm@5e000 {
compatible = "amlogic,meson-s4-pwm";
reg = <0x0 0x5e000 0x0 0x24>;
clocks = <&clkc_periphs CLKID_PWM_G>,
- <&clkc_periphs CLKID_PWM_H>;
+ <&clkc_periphs CLKID_PWM_H>,
+ <&clkc_periphs CLKID_PWM_GH>;
+ clock-names = "channel-a", "channel-b", "core";
#pwm-cells = <3>;
status = "disabled";
};
@@ -721,7 +729,9 @@ pwm_ij: pwm@60000 {
compatible = "amlogic,meson-s4-pwm";
reg = <0x0 0x60000 0x0 0x24>;
clocks = <&clkc_periphs CLKID_PWM_I>,
- <&clkc_periphs CLKID_PWM_J>;
+ <&clkc_periphs CLKID_PWM_J>,
+ <&clkc_periphs CLKID_PWM_IJ>;
+ clock-names = "channel-a", "channel-b", "core";
#pwm-cells = <3>;
status = "disabled";
};
--
2.49.0
^ permalink raw reply [flat|nested] 5+ messages in thread