* [PATCH v2 0/3] Add T7 PWM core clock support
@ 2026-09-25 15:13 Ronald Claveau via B4 Relay
2026-09-25 15:13 ` [PATCH v2 1/3] dt-bindings: pwm: amlogic: Add core clock for T7 Ronald Claveau via B4 Relay
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-09-25 15:13 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
The PWM controllers on the Amlogic T7 SoC have a system clock that
controls access to the controller, in addition to the two input
clocks of channels A and B.
It is currently not described in the device tree, so it is neither
referenced nor enabled by the driver.
This series adds support for it:
- patch 1 extends the binding with a third "core" clock for
amlogic,t7-pwm, and makes clocks/clock-names required for it;
- patch 2 makes the driver get and enable the optional "core"
clock, leaving other SoCs unaffected;
- patch 3 describes the system clock (CLKID_SYS_PWM_*) in the T7
device tree for all the PWM controllers.
`dt_binding_check DT_SCHEMA_FILES=pwm-amlogic.yaml` test is ok
CHKDT ./Documentation/devicetree/bindings
warning: python package 'yamllint' not installed, skipping
STYLE ./Documentation/devicetree/bindings
DTEX Documentation/devicetree/bindings/pwm/pwm-amlogic.example.dts
DTC [C] Documentation/devicetree/bindings/pwm/pwm-amlogic.example.dtb
Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
Changes in v2:
- PATCH 1: Permits to use "core" clock on S4 SoC and all the ones that fallback to it.
Rename "clk_a" and "clk_b" to "channel-a" and "channel-b". Thx to Conor's feedback.
- PATCH 3: Rename channel clock-names as done on patch 1.
- Link to v1: https://lore.kernel.org/r/20260924-add-t7-sys-pwm-clk-v1-0-05b91e87f0a9@aliel.fr
---
Ronald Claveau (3):
dt-bindings: pwm: amlogic: Add core clock for T7
pwm: meson: Add optional core clock for S4 PWM
arm64: dts: amlogic: t7: Add core clock to PWM controller nodes
.../devicetree/bindings/pwm/pwm-amlogic.yaml | 33 ++++++++++++++++++++--
arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 28 +++++++++++++-----
drivers/pwm/pwm-meson.c | 5 ++++
3 files changed, 57 insertions(+), 9 deletions(-)
---
base-commit: a8c591ed6b672915e0be57843f943a2a723aff40
change-id: 20260924-add-t7-sys-pwm-clk-f0eff81bee21
Best regards,
--
Ronald Claveau <linux-kernel-dev@aliel.fr>
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 1/3] dt-bindings: pwm: amlogic: Add core clock for T7
2026-09-25 15:13 [PATCH v2 0/3] Add T7 PWM core clock support Ronald Claveau via B4 Relay
@ 2026-09-25 15:13 ` Ronald Claveau via B4 Relay
2026-09-25 16:41 ` Conor Dooley
2026-09-25 15:13 ` [PATCH v2 2/3] pwm: meson: Add optional core clock for S4 PWM Ronald Claveau via B4 Relay
2026-09-25 15:13 ` [PATCH v2 3/3] arm64: dts: amlogic: t7: Add core clock to PWM controller nodes Ronald Claveau via B4 Relay
2 siblings, 1 reply; 7+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-09-25 15:13 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 T7, 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 | 33 ++++++++++++++++++++--
1 file changed, 31 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml b/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml
index c337d85da40f1..59320f288552b 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
@@ -140,13 +140,34 @@ allOf:
then:
properties:
clocks:
+ minItems: 2
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:
+ minItems: 2
+ items:
+ - const: channel-a
+ - const: channel-b
+ - const: core
required:
- clocks
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: amlogic,t7-pwm
+ then:
+ properties:
+ clocks:
+ minItems: 3
+ clock-names:
+ minItems: 3
+ required:
+ - clock-names
+
- if:
properties:
compatible:
@@ -182,3 +203,11 @@ examples:
clocks = <&pwm_src_a>, <&pwm_src_b>;
#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
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 2/3] pwm: meson: Add optional core clock for S4 PWM
2026-09-25 15:13 [PATCH v2 0/3] Add T7 PWM core clock support Ronald Claveau via B4 Relay
2026-09-25 15:13 ` [PATCH v2 1/3] dt-bindings: pwm: amlogic: Add core clock for T7 Ronald Claveau via B4 Relay
@ 2026-09-25 15:13 ` Ronald Claveau via B4 Relay
2026-09-25 15:13 ` [PATCH v2 3/3] arm64: dts: amlogic: t7: Add core clock to PWM controller nodes Ronald Claveau via B4 Relay
2 siblings, 0 replies; 7+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-09-25 15:13 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>
On some SoCs (e.g. T7), the PWM controller has a system clock that must
be enabled to access its registers, in addition to the per-channel
input clocks.
Get and enable it with devm_clk_get_optional_enabled() using the
"core" name. The clock is optional, so existing SoCs and device trees
that do not provide it keep working unchanged.
Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
---
drivers/pwm/pwm-meson.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c
index 20e6cd07127c4..5ab07322e8d15 100644
--- a/drivers/pwm/pwm-meson.c
+++ b/drivers/pwm/pwm-meson.c
@@ -508,8 +508,13 @@ static int meson_pwm_init_channels_s4(struct pwm_chip *chip)
struct device *dev = pwmchip_parent(chip);
struct device_node *np = dev->of_node;
struct meson_pwm *meson = to_meson_pwm(chip);
+ struct clk *core_clk;
int i, ret;
+ core_clk = devm_clk_get_optional_enabled(dev, "core");
+ if (IS_ERR(core_clk))
+ return dev_err_probe(dev, PTR_ERR(core_clk), "Failed to get core clock\n");
+
for (i = 0; i < MESON_NUM_PWMS; i++) {
meson->channels[i].clk = of_clk_get(np, i);
if (IS_ERR(meson->channels[i].clk))
--
2.49.0
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 3/3] arm64: dts: amlogic: t7: Add core clock to PWM controller nodes
2026-09-25 15:13 [PATCH v2 0/3] Add T7 PWM core clock support Ronald Claveau via B4 Relay
2026-09-25 15:13 ` [PATCH v2 1/3] dt-bindings: pwm: amlogic: Add core clock for T7 Ronald Claveau via B4 Relay
2026-09-25 15:13 ` [PATCH v2 2/3] pwm: meson: Add optional core clock for S4 PWM Ronald Claveau via B4 Relay
@ 2026-09-25 15:13 ` Ronald Claveau via B4 Relay
2 siblings, 0 replies; 7+ messages in thread
From: Ronald Claveau via B4 Relay @ 2026-09-25 15:13 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 (CLKID_SYS_PWM_*) 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-t7.dtsi | 28 +++++++++++++++++++++-------
1 file changed, 21 insertions(+), 7 deletions(-)
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";
};
--
2.49.0
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/3] dt-bindings: pwm: amlogic: Add core clock for T7
2026-09-25 15:13 ` [PATCH v2 1/3] dt-bindings: pwm: amlogic: Add core clock for T7 Ronald Claveau via B4 Relay
@ 2026-09-25 16:41 ` Conor Dooley
2026-09-26 9:43 ` linux-kernel-dev
0 siblings, 1 reply; 7+ messages in thread
From: Conor Dooley @ 2026-09-25 16:41 UTC (permalink / raw)
To: linux-kernel-dev
Cc: Uwe Kleine-König, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Heiner Kallweit, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, linux-pwm, devicetree,
linux-kernel, linux-arm-kernel, linux-amlogic
[-- Attachment #1.1: Type: text/plain, Size: 2731 bytes --]
On Fri, Sep 25, 2026 at 05:13:28PM +0200, Ronald Claveau via B4 Relay wrote:
> 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 T7, 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 | 33 ++++++++++++++++++++--
> 1 file changed, 31 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml b/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml
> index c337d85da40f1..59320f288552b 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
> @@ -140,13 +140,34 @@ allOf:
> then:
> properties:
> clocks:
> + minItems: 2
> 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:
> + minItems: 2
> + items:
> + - const: channel-a
> + - const: channel-b
> + - const: core
> required:
> - clocks
>
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: amlogic,t7-pwm
Shouldn't this (based on your reply on the previous version) be s4?
> + then:
> + properties:
> + clocks:
> + minItems: 3
> + clock-names:
> + minItems: 3
> + required:
> + - clock-names
> +
> - if:
> properties:
> compatible:
> @@ -182,3 +203,11 @@ examples:
> clocks = <&pwm_src_a>, <&pwm_src_b>;
> #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
>
>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/3] dt-bindings: pwm: amlogic: Add core clock for T7
2026-09-25 16:41 ` Conor Dooley
@ 2026-09-26 9:43 ` linux-kernel-dev
2026-09-26 18:06 ` Conor Dooley
0 siblings, 1 reply; 7+ messages in thread
From: linux-kernel-dev @ 2026-09-26 9:43 UTC (permalink / raw)
To: Conor Dooley
Cc: Uwe Kleine-König, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Heiner Kallweit, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, linux-pwm, devicetree,
linux-kernel, linux-arm-kernel, linux-amlogic
On 9/25/26 6:41 PM, Conor Dooley wrote:
> On Fri, Sep 25, 2026 at 05:13:28PM +0200, Ronald Claveau via B4 Relay wrote:
>> 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 T7, 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 | 33 ++++++++++++++++++++--
>> 1 file changed, 31 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml b/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml
>> index c337d85da40f1..59320f288552b 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
>> @@ -140,13 +140,34 @@ allOf:
>> then:
>> properties:
>> clocks:
>> + minItems: 2
>> 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:
>> + minItems: 2
>> + items:
>> + - const: channel-a
>> + - const: channel-b
>> + - const: core
>> required:
>> - clocks
>>
>> + - if:
>> + properties:
>> + compatible:
>> + contains:
>> + const: amlogic,t7-pwm
>
> Shouldn't this (based on your reply on the previous version) be s4?
>
The change above is for S4 and SOCs which fallback to S4. It allows the
third clock but let the schema validation compatible with two clocks
existing DTS. Here for the T7, I add requirement for the exact 3 clocks.
Do you recommend to require the 3 clocks for all S4 and S4 fallback, and
update the associated dtsi files ?
>> + then:
>> + properties:
>> + clocks:
>> + minItems: 3
>> + clock-names:
>> + minItems: 3
>> + required:
>> + - clock-names
>> +
>> - if:
>> properties:
>> compatible:
>> @@ -182,3 +203,11 @@ examples:
>> clocks = <&pwm_src_a>, <&pwm_src_b>;
>> #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
>>
>>
--
Best regards,
Ronald
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/3] dt-bindings: pwm: amlogic: Add core clock for T7
2026-09-26 9:43 ` linux-kernel-dev
@ 2026-09-26 18:06 ` Conor Dooley
0 siblings, 0 replies; 7+ messages in thread
From: Conor Dooley @ 2026-09-26 18:06 UTC (permalink / raw)
To: linux-kernel-dev
Cc: Uwe Kleine-König, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Heiner Kallweit, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, linux-pwm, devicetree,
linux-kernel, linux-arm-kernel, linux-amlogic
[-- Attachment #1.1: Type: text/plain, Size: 3720 bytes --]
On Sat, Sep 26, 2026 at 11:43:20AM +0200, linux-kernel-dev@aliel.fr wrote:
> On 9/25/26 6:41 PM, Conor Dooley wrote:
> > On Fri, Sep 25, 2026 at 05:13:28PM +0200, Ronald Claveau via B4 Relay wrote:
> >> 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 T7, 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 | 33 ++++++++++++++++++++--
> >> 1 file changed, 31 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml b/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml
> >> index c337d85da40f1..59320f288552b 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
> >> @@ -140,13 +140,34 @@ allOf:
> >> then:
> >> properties:
> >> clocks:
> >> + minItems: 2
> >> 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:
> >> + minItems: 2
> >> + items:
> >> + - const: channel-a
> >> + - const: channel-b
> >> + - const: core
> >> required:
> >> - clocks
> >>
> >> + - if:
> >> + properties:
> >> + compatible:
> >> + contains:
> >> + const: amlogic,t7-pwm
> >
> > Shouldn't this (based on your reply on the previous version) be s4?
> >
>
> The change above is for S4 and SOCs which fallback to S4. It allows the
> third clock but let the schema validation compatible with two clocks
> existing DTS. Here for the T7, I add requirement for the exact 3 clocks.
>
> Do you recommend to require the 3 clocks for all S4 and S4 fallback, and
> update the associated dtsi files ?
Yes, I think so. Sounds to me like they only work because of the
CLK_IGNORE_UNUSED set in their clock controller drivers, so the correct
thing to do is make them all require the third clock.
Chers,
Conor.
>
> >> + then:
> >> + properties:
> >> + clocks:
> >> + minItems: 3
> >> + clock-names:
> >> + minItems: 3
> >> + required:
> >> + - clock-names
> >> +
> >> - if:
> >> properties:
> >> compatible:
> >> @@ -182,3 +203,11 @@ examples:
> >> clocks = <&pwm_src_a>, <&pwm_src_b>;
> >> #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
> >>
> >>
>
>
> --
> Best regards,
> Ronald
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-09-26 18:06 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-25 15:13 [PATCH v2 0/3] Add T7 PWM core clock support Ronald Claveau via B4 Relay
2026-09-25 15:13 ` [PATCH v2 1/3] dt-bindings: pwm: amlogic: Add core clock for T7 Ronald Claveau via B4 Relay
2026-09-25 16:41 ` Conor Dooley
2026-09-26 9:43 ` linux-kernel-dev
2026-09-26 18:06 ` Conor Dooley
2026-09-25 15:13 ` [PATCH v2 2/3] pwm: meson: Add optional core clock for S4 PWM Ronald Claveau via B4 Relay
2026-09-25 15:13 ` [PATCH v2 3/3] arm64: dts: amlogic: t7: Add core clock to PWM controller nodes Ronald Claveau via B4 Relay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®