Skip to contentSkip to conversation

add available pwm for bananapi-r64

RFC In review Frank Wunderlich 4 participants 8 messages Oct 16, 2020 – Nov 27, 2020

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover add available pwm for bananapi-r64

From: Frank Wunderlich <[email protected]>

- mt7622 provides 6 pwm channels and only one is configured in dts
- pinctl-driver contains 7 pwm-channels where one is currently used.
- Mediatek confirmed that pwm7 does not exist and so dts is wrong and also the pinctrl definitions.

Frank Wunderlich (3):
dts64: mt7622: enable all pwm for bananapi r64
dts64: mt7622: disable spi1 and uart2 because pins are used by pwm
pinctl: mt7622: drop pwm ch7 as mt7622 only has 6 channels

 .../boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts   | 13 ++++++++-----
 drivers/pinctrl/mediatek/pinctrl-mt7622.c           | 13 +------------
 2 files changed, 9 insertions(+), 17 deletions(-)
Signature · 7 lines
2.25.1


_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
#1 lore raw

RFC 1/3 dts64: mt7622: enable all pwm for bananapi r64

From: Frank Wunderlich <[email protected]>

mt7622 only supports 6 pwm-channels so drop pwm7

third pwm (pwm2) is inverted and connected to fan-socket

---
 .../boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts     | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts +8 -3
index 1cc4dcb0008c..ad5b1592182d 100644
@@ -414,10 +414,15 @@ mux {
 		};
 	};
 
-	pwm7_pins: pwm1-2-pins {
+	pwm_pins: pwm-pins {
 		mux {
 			function = "pwm";
-			groups = "pwm_ch7_2";
+			groups = "pwm_ch1_0", /* mt7622_pwm_ch1_0_pins[] = { 51, }; */
+				 "pwm_ch2_0", /* mt7622_pwm_ch2_0_pins[] = { 52, }; */
+				 "pwm_ch3_2", /* mt7622_pwm_ch3_2_pins[] = { 97, }; */
+				 "pwm_ch4_1", /* mt7622_pwm_ch4_1_pins[] = { 67, }; */
+				 "pwm_ch5_0", /* mt7622_pwm_ch5_0_pins[] = { 68, }; */
+				 "pwm_ch6_0"; /* mt7622_pwm_ch6_0_pins[] = { 69, }; */
 		};
 	};
 
@@ -537,7 +542,7 @@ mux {
 
 &pwm {
 	pinctrl-names = "default";
-	pinctrl-0 = <&pwm7_pins>;
+	pinctrl-0 = <&pwm_pins>;
 	status = "okay";
 };
 
Signature · 7 lines
2.25.1


_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
maintainer
#2 lore raw

Re: [RFC 1/3] dts64: mt7622: enable all pwm for bananapi r64

Quoted 7 lines · Frank Wunderlich

From: Frank Wunderlich <[email protected]>

mt7622 only supports 6 pwm-channels so drop pwm7

third pwm (pwm2) is inverted and connected to fan-socket

Patch 1 and 2 now pushed to v5.10-next/dts64

Thanks!

Quoted 28 lines
---
  .../boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts     | 11 ++++++++---
  1 file changed, 8 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts +7 -2
index 1cc4dcb0008c..ad5b1592182d 100644
@@ -414,10 +414,15 @@ mux {
  		};
  	};
 
-	pwm7_pins: pwm1-2-pins {
+	pwm_pins: pwm-pins {
  		mux {
  			function = "pwm";
-			groups = "pwm_ch7_2";
+			groups = "pwm_ch1_0", /* mt7622_pwm_ch1_0_pins[] = { 51, }; */
+				 "pwm_ch2_0", /* mt7622_pwm_ch2_0_pins[] = { 52, }; */
+				 "pwm_ch3_2", /* mt7622_pwm_ch3_2_pins[] = { 97, }; */
+				 "pwm_ch4_1", /* mt7622_pwm_ch4_1_pins[] = { 67, }; */
+				 "pwm_ch5_0", /* mt7622_pwm_ch5_0_pins[] = { 68, }; */
+				 "pwm_ch6_0"; /* mt7622_pwm_ch6_0_pins[] = { 69, }; */
  		};
  	};
 

arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts mux { · line 548

Quoted 8 lines
arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts +1 -1
@@ -537,7 +542,7 @@ mux {
 
  &pwm {
  	pinctrl-names = "default";
-	pinctrl-0 = <&pwm7_pins>;
+	pinctrl-0 = <&pwm_pins>;
  	status = "okay";
  };
 

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

#3 lore raw

RFC 2/3 dts64: mt7622: disable spi1 and uart2 because pins are used by pwm

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

MDI_TP_P0 (gpio51) is used by pwm1 and uart2 (uart1 on gpio-header) MDI_RP_P4 (gpio67) is used by pwm4 and spi1

---
 arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts | 2 --
 1 file changed, 2 deletions(-)
arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts +0 -2
index ad5b1592182d..74a843e6d107 100644
@@ -570,7 +570,6 @@ &spi0 {
 &spi1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&spic1_pins>;
-	status = "okay";
 };
 
 &ssusb {
@@ -592,7 +591,6 @@ &uart0 {
 &uart2 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart2_pins>;
-	status = "okay";
 };
 
 &watchdog {
Signature · 7 lines
2.25.1


_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
#4 lore raw

RFC 3/3 pinctl: mt7622: drop pwm ch7 as mt7622 only has 6 channels

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

mt7622 is reported by mediatek to have only 6 pwm channels so drop pindefines for 7th channel

---
 drivers/pinctrl/mediatek/pinctrl-mt7622.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/pinctrl/mediatek/pinctrl-mt7622.c +1 -12
index ce4a8a0cc19c..260ffadd24e4 100644
@@ -439,12 +439,6 @@ static int mt7622_pwm_ch6_2_pins[] = { 81, };
 static int mt7622_pwm_ch6_2_funcs[] = { 4, };
 static int mt7622_pwm_ch6_3_pins[] = { 100, };
 static int mt7622_pwm_ch6_3_funcs[] = { 0, };
-static int mt7622_pwm_ch7_0_pins[] = { 70, };
-static int mt7622_pwm_ch7_0_funcs[] = { 3, };
-static int mt7622_pwm_ch7_1_pins[] = { 82, };
-static int mt7622_pwm_ch7_1_funcs[] = { 4, };
-static int mt7622_pwm_ch7_2_pins[] = { 101, };
-static int mt7622_pwm_ch7_2_funcs[] = { 0, };
 
 /* SD */
 static int mt7622_sd_0_pins[] = { 16, 17, 18, 19, 20, 21, };
@@ -611,9 +605,6 @@ static const struct group_desc mt7622_groups[] = {
 	PINCTRL_PIN_GROUP("pwm_ch6_1", mt7622_pwm_ch6_1),
 	PINCTRL_PIN_GROUP("pwm_ch6_2", mt7622_pwm_ch6_2),
 	PINCTRL_PIN_GROUP("pwm_ch6_3", mt7622_pwm_ch6_3),
-	PINCTRL_PIN_GROUP("pwm_ch7_0", mt7622_pwm_ch7_0),
-	PINCTRL_PIN_GROUP("pwm_ch7_1", mt7622_pwm_ch7_1),
-	PINCTRL_PIN_GROUP("pwm_ch7_2", mt7622_pwm_ch7_2),
 	PINCTRL_PIN_GROUP("sd_0", mt7622_sd_0),
 	PINCTRL_PIN_GROUP("sd_1", mt7622_sd_1),
 	PINCTRL_PIN_GROUP("snfi", mt7622_snfi),
@@ -700,9 +691,7 @@ static const char *mt7622_pwm_groups[] = { "pwm_ch1_0", "pwm_ch1_1",
 					   "pwm_ch4_3", "pwm_ch5_0",
 					   "pwm_ch5_1", "pwm_ch5_2",
 					   "pwm_ch6_0", "pwm_ch6_1",
-					   "pwm_ch6_2", "pwm_ch6_3",
-					   "pwm_ch7_0", "pwm_ch7_1",
-					   "pwm_ch7_2", };
+					   "pwm_ch6_2", "pwm_ch6_3", };
 static const char *mt7622_sd_groups[] = { "sd_0", "sd_1", };
 static const char *mt7622_spic_groups[] = { "spic0_0", "spic0_1", "spic1_0",
 					    "spic1_1", "spic2_0",
Signature · 7 lines
2.25.1


_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
#5 lore raw

Re: [RFC 3/3] pinctl: mt7622: drop pwm ch7 as mt7622 only has 6 channels

Quoted 6 lines · Frank Wunderlich

From: Frank Wunderlich <[email protected]>

mt7622 is reported by mediatek to have only 6 pwm channels so drop pindefines for 7th channel

I can merge this patch to the pinctrl tree if I get some kind of review response from one of the Mediatek maintainers.

The rest should probably go through ARM SoC.

Yours,
Linus Walleij

maintainer Acked-by
#6 lore raw

Re: [RFC 3/3] pinctl: mt7622: drop pwm ch7 as mt7622 only has 6 channels

Quoted 8 lines
Quoted 4 lines

mt7622 is reported by mediatek to have only 6 pwm channels so drop pindefines for 7th channel

I can merge this patch to the pinctrl tree if I get some kind of review response from one of the Mediatek maintainers.

After confirming with the internal team, MT7622 actually does not have the 7th channel. Thanks for Frank's catchup and patch.

Quoted 4 lines

The rest should probably go through ARM SoC.

Yours,
Linus Walleij