b/target/linux/lantiq/files/arch/mips/boot/dts/ARV7519PW.dts
@@ -108,17 +108,16 @@
gpios = <&gpio 29 GPIO_ACTIVE_LOW>;
};
};
+};
- /* is there another way to "reserve" the GPIO? */
- gpio_export {
- compatible = "gpio-export";
- #size-cells = <0>;
+&gpio {
+ status = "okay";
- switch {
- gpio-export,name = "switch";
- gpio-export,output = <1>;
- gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
- };
+ switch {
+ gpio-hog;
+ line-name = "switch";
+ gpios = <19 GPIO_ACTIVE_HIGH>;
+ output-high;
};
};
b/target/linux/lantiq/files/arch/mips/boot/dts/GIGASX76X.dts
@@ -28,17 +28,6 @@
};
};
- gpio_export {
- compatible = "gpio-export";
- #size-cells = <0>;
-
- switch {
- gpio-export,name = "switch";
- gpio-export,output = <1>;
- gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
- };
- };
-
usb_vbus: regulator-usb-vbus {
compatible = "regulator-fixed";
@@ -52,6 +41,17 @@
};
};
+&gpio {
+ status = "okay";
+
+ switch {
+ gpio-hog;
+ line-name = "switch";
+ gpios = <19 GPIO_ACTIVE_HIGH>;
+ output-high;
+ };
+};
+
&gpio {
pinctrl-names = "default";
pinctrl-0 = <&state_default>;
@@ -64,10 +64,6 @@
};
};
-&gpios {
- status = "okay";
-};
-
&gsw {
phy-mode = "rmii";
};
b/target/linux/lantiq/files/arch/mips/boot/dts/H201L.dts
@@ -84,27 +84,6 @@
};
};
- gpio_export {
- compatible = "gpio-export";
- #size-cells = <0>;
-
- switch {
- gpio-export,name = "switch";
- gpio-export,output = <1>;
- gpios = <&gpio 38 GPIO_ACTIVE_HIGH>;
- };
- usb {
- gpio-export,name = "usb";
- gpio-export,output = <1>;
- gpios = <&gpio 28 GPIO_ACTIVE_HIGH>;
- };
- wifi {
- gpio-export,name = "wifi";
- gpio-export,output = <1>;
- gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
- };
- };
-
usb_vbus: regulator-usb-vbus {
compatible = "regulator-fixed";
@@ -118,6 +97,31 @@
};
};
+&gpio {
+ status = "okay";
+
+ switch {
+ gpio-hog;
+ line-name = "switch";
+ gpios = <38 GPIO_ACTIVE_HIGH>;
+ output-high;
+ };
+
+ usb {
+ gpio-hog;
+ line-name = "usb";
+ gpios = <28 GPIO_ACTIVE_HIGH>;
+ output-high;
+ };
+
+ wifi {
+ gpio-hog;
+ line-name = "wifi";
+ gpios = <7 GPIO_ACTIVE_HIGH>;
+ output-high;
+ };
+};
+
&gpio {
pinctrl-names = "default";
pinctrl-0 = <&state_default>;
@@ -165,7 +169,6 @@
status = "okay";
};
-
&usb0 {
status = "okay";
vbus-supply = <&usb_vbus>;
b/target/linux/lantiq/files/arch/mips/boot/dts/P2601HNFX.dts
@@ -85,16 +85,16 @@
gpios = <&stp 10 GPIO_ACTIVE_LOW>;
};
};
+};
- gpio_export {
- compatible = "gpio-export";
- #size-cells = <0>;
+&gpio {
+ status = "okay";
- switch {
- gpio-export,name = "switch";
- gpio-export,output = <1>;
- gpios = <&gpio 50 GPIO_ACTIVE_HIGH>;
- };
+ switch {
+ gpio-hog;
+ line-name = "switch";
+ gpios = <50 GPIO_ACTIVE_HIGH>;
+ output-high;
};
};
lantiq: use gpio_hog instead of gpio-export The `gpio-export` functionality is a hack for missing kernel functionality, which was rejected in upstream kernel long time ago, for details see this email http://lists.infradead.org/pipermail/openwrt-devel/2019-February/015772.html, discussion in PR#1366 or https://github.com/openwrt/openwrt/pull/1814#issuecomment-462942022. This patch converts all remaining lantiq .dts(i) files which were using export-gpio, not making use of the change-direction functionality and not used from user-space to using gpio_hog instead Signed-off-by: Birger Koblitz <mail@birger-koblitz.de> --- v2: - Not converting annexa/b export in DM200.dts - Not converting power_led_blink export in ASL56026.dts