mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
* [PATCH 0/2] Add PWM support for Meson8
@ 2017-07-11 22:20 Martin Blumenstingl
  2017-07-11 22:20 ` [PATCH 1/2] ARM: dts: move the pwm_ab and pwm_cd nodes to meson.dtsi Martin Blumenstingl
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Martin Blumenstingl @ 2017-07-11 22:20 UTC (permalink / raw)
  To: linus-amlogic

This series moves the pwm_ab and pwm_cd nodes to the common meson.dtsi.
According to Amlogic's GPL kernel sources Meson6 contains the same PWM
IP blocks for pwm_ab and pwm_cd (at the same register offsets) as Meson8
and Meson8b.

pwm_ef on the other hand does not exist on Meson6, so it stays in
meson8b.dtsi (and is added to meson8b.dtsi).

Known usages of the PWM controllers:
- controlling the brightness of the system LED
- generating the 32.768kHz wifi LPO clock
- controlling the VDDEE (CPU) voltage


Martin Blumenstingl (2):
  ARM: dts: move the pwm_ab and pwm_cd nodes to meson.dtsi
  ARM: dts: meson8: add the PWM controller nodes

 arch/arm/boot/dts/meson.dtsi   | 14 ++++++++++++++
 arch/arm/boot/dts/meson8.dtsi  | 15 +++++++++++++++
 arch/arm/boot/dts/meson8b.dtsi | 22 ++++++++--------------
 3 files changed, 37 insertions(+), 14 deletions(-)

-- 
2.13.2

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] ARM: dts: move the pwm_ab and pwm_cd nodes to meson.dtsi
  2017-07-11 22:20 [PATCH 0/2] Add PWM support for Meson8 Martin Blumenstingl
@ 2017-07-11 22:20 ` Martin Blumenstingl
  2017-07-11 22:20 ` [PATCH 2/2] ARM: dts: meson8: add the PWM controller nodes Martin Blumenstingl
  2017-07-28 16:43 ` [PATCH 0/2] Add PWM support for Meson8 Kevin Hilman
  2 siblings, 0 replies; 4+ messages in thread
From: Martin Blumenstingl @ 2017-07-11 22:20 UTC (permalink / raw)
  To: linus-amlogic

According to the vendor kernel sources these also exist (at the same
address) on Meson6 and Meson8. This can be found by running
$ grep -R "define PWM_PWM_[A-D]" arch/arm/
in the Amlogic GPL kernel tree (arm-src-kernel-2015-01-15-321cfb5a46).
pwm_ef does not seem to exist on older SoCs, so we keep it in
meson8b.dtsi for now.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 arch/arm/boot/dts/meson.dtsi   | 14 ++++++++++++++
 arch/arm/boot/dts/meson8b.dtsi | 22 ++++++++--------------
 2 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/arch/arm/boot/dts/meson.dtsi b/arch/arm/boot/dts/meson.dtsi
index 15204e44161d..4c27ca083afb 100644
--- a/arch/arm/boot/dts/meson.dtsi
+++ b/arch/arm/boot/dts/meson.dtsi
@@ -108,6 +108,20 @@
 				status = "disabled";
 			};
 
+			pwm_ab: pwm at 8550 {
+				compatible = "amlogic,meson-pwm";
+				reg = <0x8550 0x10>;
+				#pwm-cells = <3>;
+				status = "disabled";
+			};
+
+			pwm_cd: pwm at 8650 {
+				compatible = "amlogic,meson-pwm";
+				reg = <0x8650 0x10>;
+				#pwm-cells = <3>;
+				status = "disabled";
+			};
+
 			saradc: adc at 8680 {
 				compatible = "amlogic,meson-saradc";
 				reg = <0x8680 0x34>;
diff --git a/arch/arm/boot/dts/meson8b.dtsi b/arch/arm/boot/dts/meson8b.dtsi
index 72e4f425f190..65b36c944b45 100644
--- a/arch/arm/boot/dts/meson8b.dtsi
+++ b/arch/arm/boot/dts/meson8b.dtsi
@@ -129,20 +129,6 @@
 		#reset-cells = <1>;
 	};
 
-	pwm_ab: pwm at 8550 {
-		compatible = "amlogic,meson8b-pwm";
-		reg = <0x8550 0x10>;
-		#pwm-cells = <3>;
-		status = "disabled";
-	};
-
-	pwm_cd: pwm at 8650 {
-		compatible = "amlogic,meson8b-pwm";
-		reg = <0x8650 0x10>;
-		#pwm-cells = <3>;
-		status = "disabled";
-	};
-
 	pwm_ef: pwm at 86c0 {
 		compatible = "amlogic,meson8b-pwm";
 		reg = <0x86c0 0x10>;
@@ -193,6 +179,14 @@
 	arm,filter-ranges = <0x100000 0xc0000000>;
 };
 
+&pwm_ab {
+	compatible = "amlogic,meson8b-pwm";
+};
+
+&pwm_cd {
+	compatible = "amlogic,meson8b-pwm";
+};
+
 &saradc {
 	compatible = "amlogic,meson8b-saradc", "amlogic,meson-saradc";
 	clocks = <&clkc CLKID_XTAL>,
-- 
2.13.2

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] ARM: dts: meson8: add the PWM controller nodes
  2017-07-11 22:20 [PATCH 0/2] Add PWM support for Meson8 Martin Blumenstingl
  2017-07-11 22:20 ` [PATCH 1/2] ARM: dts: move the pwm_ab and pwm_cd nodes to meson.dtsi Martin Blumenstingl
@ 2017-07-11 22:20 ` Martin Blumenstingl
  2017-07-28 16:43 ` [PATCH 0/2] Add PWM support for Meson8 Kevin Hilman
  2 siblings, 0 replies; 4+ messages in thread
From: Martin Blumenstingl @ 2017-07-11 22:20 UTC (permalink / raw)
  To: linus-amlogic

pwm_ab and pwm_cd are already inherited from meson.dtsi, we only need to
define the correct "compatible" string so the pwm-meson driver can
choose the parent clocks correctly.
pwm_ef is added to meson8.dtsi directly (similar to how it's done in
meson8b.dtsi) as this controller only exists on Meson8 and Meson8b.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 arch/arm/boot/dts/meson8.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm/boot/dts/meson8.dtsi b/arch/arm/boot/dts/meson8.dtsi
index cada35828931..6fe6a159e960 100644
--- a/arch/arm/boot/dts/meson8.dtsi
+++ b/arch/arm/boot/dts/meson8.dtsi
@@ -172,6 +172,13 @@
 		reg = <0x8000 0x4>, <0x4000 0x460>;
 	};
 
+	pwm_ef: pwm at 86c0 {
+		compatible = "amlogic,meson8-pwm", "amlogic,meson8b-pwm";
+		reg = <0x86c0 0x10>;
+		#pwm-cells = <3>;
+		status = "disabled";
+	};
+
 	pinctrl_cbus: pinctrl at 9880 {
 		compatible = "amlogic,meson8-cbus-pinctrl";
 		reg = <0x9880 0x10>;
@@ -270,6 +277,14 @@
 	arm,filter-ranges = <0x100000 0xc0000000>;
 };
 
+&pwm_ab {
+	compatible = "amlogic,meson8-pwm", "amlogic,meson8b-pwm";
+};
+
+&pwm_cd {
+	compatible = "amlogic,meson8-pwm", "amlogic,meson8b-pwm";
+};
+
 &saradc {
 	compatible = "amlogic,meson8-saradc", "amlogic,meson-saradc";
 	clocks = <&clkc CLKID_XTAL>,
-- 
2.13.2

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 0/2] Add PWM support for Meson8
  2017-07-11 22:20 [PATCH 0/2] Add PWM support for Meson8 Martin Blumenstingl
  2017-07-11 22:20 ` [PATCH 1/2] ARM: dts: move the pwm_ab and pwm_cd nodes to meson.dtsi Martin Blumenstingl
  2017-07-11 22:20 ` [PATCH 2/2] ARM: dts: meson8: add the PWM controller nodes Martin Blumenstingl
@ 2017-07-28 16:43 ` Kevin Hilman
  2 siblings, 0 replies; 4+ messages in thread
From: Kevin Hilman @ 2017-07-28 16:43 UTC (permalink / raw)
  To: linus-amlogic

Martin Blumenstingl <martin.blumenstingl@googlemail.com> writes:

> This series moves the pwm_ab and pwm_cd nodes to the common meson.dtsi.
> According to Amlogic's GPL kernel sources Meson6 contains the same PWM
> IP blocks for pwm_ab and pwm_cd (at the same register offsets) as Meson8
> and Meson8b.
>
> pwm_ef on the other hand does not exist on Meson6, so it stays in
> meson8b.dtsi (and is added to meson8b.dtsi).
>
> Known usages of the PWM controllers:
> - controlling the brightness of the system LED
> - generating the 32.768kHz wifi LPO clock
> - controlling the VDDEE (CPU) voltage

Applied to v4.14/dt,

Thanks,

Kevin

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-07-28 16:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-11 22:20 [PATCH 0/2] Add PWM support for Meson8 Martin Blumenstingl
2017-07-11 22:20 ` [PATCH 1/2] ARM: dts: move the pwm_ab and pwm_cd nodes to meson.dtsi Martin Blumenstingl
2017-07-11 22:20 ` [PATCH 2/2] ARM: dts: meson8: add the PWM controller nodes Martin Blumenstingl
2017-07-28 16:43 ` [PATCH 0/2] Add PWM support for Meson8 Kevin Hilman

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®