Skip to contentSkip to conversation

ARM64: dts: meson-gx: use specific compatible for the AO pwms

PATCH Superseded Jerome Brunet 3 participants 4 messages Jun 7, 2017 – Jul 21, 2017

Subsystems (2)
lore
Share & tools
lore

Jerome Brunet

author reviewer
#0 lore raw

PATCH 1/1 ARM64: dts: meson-gx: use specific compatible for the AO pwms

Use the specific compatiable for AO pwms so the pwms input can be correctly set

FDIV4 is not present on the pwm A0, so change kadhas vim input clocks to xtal.

---
This patch depends on the pwm patchset available here [0]

On the Khadas Vim I chose to replace FDIV4 with the crytal. Only PWM_AO_B is actually used and It is used for led dimming. The frequency, as long as it is high enough, does not matter. Only the duty cycle does. After testing, xtal seems to be fast enough.

PWM_AO_A is outputed on the general purpose header, but no usage is defined for it.

It might be bit late for that but I wonder why it defined and enabled ? Same goes for the other peripherals activated on this general purpose header.

I know that's what shows the schematics but one could choose to do anything else possible with it ? like use in GPIO mode, or another function. In addition, we never which setting will be required ? (eg which clock source ?).

Should we keep those ? or remove them ?

[0]: https://lkml.kernel.org/r/20170607133013.4766-1-jbrunet at baylibre.com

 arch/arm64/boot/dts/amlogic/meson-gx.dtsi                  | 2 +-
 arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +1 -1
index 436b875060e7..fbaa6b598fca 100644
@@ -391,7 +391,7 @@
 			};
 
 			pwm_AO_ab: pwm at 550 {
-				compatible = "amlogic,meson-gx-pwm", "amlogic,meson-gxbb-pwm";
+				compatible = "amlogic,meson-gx-ao-pwm", "amlogic,meson-gxbb-ao-pwm";
 				reg = <0x0 0x00550 0x0 0x10>;
 				#pwm-cells = <3>;
 				status = "disabled";
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts +2 -2
index 6a81f0168da5..371f43cdd3ab 100644
@@ -86,8 +86,8 @@
 	status = "okay";
 	pinctrl-0 = <&pwm_ao_a_3_pins>, <&pwm_ao_b_pins>;
 	pinctrl-names = "default";
-	clocks = <&clkc CLKID_FCLK_DIV4>;
-	clock-names = "clkin0";
+	clocks = <&xtal> , <&xtal>;
+	clock-names = "clkin0", "clkin1" ;
 };
 
 &pwm_ef {
Signature · 1 line
2.9.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 1 line · Jerome Brunet

Use the specific compatiable for AO pwms so the pwms input can

-----------------------/\
s/compatiable/compatible/

Quoted 9 lines

be correctly set

FDIV4 is not present on the pwm A0, so change kadhas vim input clocks to xtal.

---
This patch depends on the pwm patchset available here [0]

Quoted 8 lines

On the Khadas Vim I chose to replace FDIV4 with the crytal. Only PWM_AO_B is actually used and It is used for led dimming. The frequency, as long as it is high enough, does not matter. Only the duty cycle does. After testing, xtal seems to be fast enough.

PWM_AO_A is outputed on the general purpose header, but no usage is defined for it.

Seems we will need to define what to enable by default on these SBC headers somehow, and leave future out-of-tree DT overlays do the work.

Quoted 37 lines

It might be bit late for that but I wonder why it defined and enabled ? Same goes for the other peripherals activated on this general purpose header.

I know that's what shows the schematics but one could choose to do anything else possible with it ? like use in GPIO mode, or another function. In addition, we never which setting will be required ? (eg which clock source ?).

Should we keep those ? or remove them ?

[0]: https://lkml.kernel.org/r/20170607133013.4766-1-jbrunet at baylibre.com

 arch/arm64/boot/dts/amlogic/meson-gx.dtsi                  | 2 +-
 arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +1 -1
index 436b875060e7..fbaa6b598fca 100644
@@ -391,7 +391,7 @@
 			};
 
 			pwm_AO_ab: pwm at 550 {
-				compatible = "amlogic,meson-gx-pwm", "amlogic,meson-gxbb-pwm";
+				compatible = "amlogic,meson-gx-ao-pwm", "amlogic,meson-gxbb-ao-pwm";
 				reg = <0x0 0x00550 0x0 0x10>;
 				#pwm-cells = <3>;
 				status = "disabled";
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts +0 -0
index 6a81f0168da5..371f43cdd3ab 100644

arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts line 93

Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts +2 -2
@@ -86,8 +86,8 @@
 	status = "okay";
 	pinctrl-0 = <&pwm_ao_a_3_pins>, <&pwm_ao_b_pins>;
 	pinctrl-names = "default";
-	clocks = <&clkc CLKID_FCLK_DIV4>;
-	clock-names = "clkin0";
+	clocks = <&xtal> , <&xtal>;
+	clock-names = "clkin0", "clkin1" ;
 };
 
 &pwm_ef {
author reviewer
#2 lore raw

PATCH RESEND 1/1 ARM64: dts: meson-gx: use specific compatible for the AO pwms

Use the specific compatible for AO pwms so the pwms input can be correctly set

FDIV4 is not present on the pwm A0, so change kadhas vim input clocks to xtal.

---
This patch depends on the pwm patchset available here [0]

On the Khadas Vim I chose to replace FDIV4 with the crytal. Only PWM_AO_B is actually used and It is used for led dimming. The frequency, as long as it is high enough, does not matter. Only the duty cycle does. After testing, xtal seems to be fast enough.

PWM_AO_A is outputed on the general purpose header, but no usage is defined for it.

It might be bit late for that but I wonder why it defined and enabled ? Same goes for the other peripherals activated on this general purpose header.

I know that's what shows the schematics but one could choose to do anything else possible with it ? like use in GPIO mode, or another function. In addition, we never which setting will be required ? (eg which clock source ?).

Should we keep those ? or remove them ?

Resend to correct the typo reported by Neil and update the dependency to the v2 of the pwm series.

[0]: https://lkml.kernel.org/r/20170608122416.1993-1-jbrunet at baylibre.com

 arch/arm64/boot/dts/amlogic/meson-gx.dtsi                  | 2 +-
 arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +1 -1
index 436b875060e7..fbaa6b598fca 100644
@@ -391,7 +391,7 @@
 			};
 
 			pwm_AO_ab: pwm at 550 {
-				compatible = "amlogic,meson-gx-pwm", "amlogic,meson-gxbb-pwm";
+				compatible = "amlogic,meson-gx-ao-pwm", "amlogic,meson-gxbb-ao-pwm";
 				reg = <0x0 0x00550 0x0 0x10>;
 				#pwm-cells = <3>;
 				status = "disabled";
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts +2 -2
index 6a81f0168da5..371f43cdd3ab 100644
@@ -86,8 +86,8 @@
 	status = "okay";
 	pinctrl-0 = <&pwm_ao_a_3_pins>, <&pwm_ao_b_pins>;
 	pinctrl-names = "default";
-	clocks = <&clkc CLKID_FCLK_DIV4>;
-	clock-names = "clkin0";
+	clocks = <&xtal> , <&xtal>;
+	clock-names = "clkin0", "clkin1" ;
 };
 
 &pwm_ef {
Signature · 1 line
2.9.4
maintainer
#3 lore raw
Quoted 7 lines · Jerome Brunet

Use the specific compatible for AO pwms so the pwms input can be correctly set

FDIV4 is not present on the pwm A0, so change kadhas vim input clocks to xtal.

Adding this to fixes v4.13-rc since the PWM driver is now merged.

Kevin