ath79: add gpio4 pinmux on TL-WR841N/ND v8, WR842N v2, MR3420 v2
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Thu, 30 Jan 2020 13:59:25 +0000 (14:59 +0100)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Fri, 21 Feb 2020 13:12:30 +0000 (14:12 +0100)
This adds a pinmux to the shared DTSI for TP-Link TL-WR841N/ND v8,
TL-WR842N v2 and TL-MR3420 v2. It is supposed to be the equivalent
of:

/* config gpio4 as normal gpio function */
ath79_gpio_output_select(TL_MR3420V2_GPIO_USB_POWER,AR934X_GPIO_OUT_GPIO);

This allows to enable USB power on these devices.

While at it, move the jtag_disable_pins to &gpio node and remove the
redundant status=okay there.

Tested on TP-Link TL-WR842N v2.

Fixes: FS#2753
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Armin Fuerst <armin@fuerst.priv.at>
[backport: change individual DTS files, no mr3420-v2 present]
(backported from commit 18c95c9d6ebea5cef1254ee917bff8aba993666d)

target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts
target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts

index ec89be531887926587347d72da6d09ad1bb73cbc..ccc0c195ca44233da44290636e3b3ef625f313dc 100644 (file)
@@ -22,9 +22,6 @@
                compatible = "gpio-keys-polled";
                poll-interval = <20>;
 
-               pinctrl-names = "default";
-               pinctrl-0 = <&jtag_disable_pins>;
-
                reset {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
 };
 
 &gpio {
-       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&jtag_disable_pins &pmx_usb_power>;
+};
+
+&pinmux {
+       pmx_usb_power: usb_power {
+               pinctrl-single,bits = <0x4 0x0 0xff>;
+       };
 };
 
 &spi {
index c7a251cbf1a4eace856f7d5cf150e3d28fa66107..e64a822078b15669dce8bf8dbde4cdb9bfae216a 100644 (file)
@@ -22,9 +22,6 @@
                compatible = "gpio-keys-polled";
                poll-interval = <20>;
 
-               pinctrl-names = "default";
-               pinctrl-0 = <&jtag_disable_pins>;
-
                reset {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
 };
 
 &gpio {
-       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&jtag_disable_pins &pmx_usb_power>;
+};
+
+&pinmux {
+       pmx_usb_power: usb_power {
+               pinctrl-single,bits = <0x4 0x0 0xff>;
+       };
 };
 
 &spi {