[openwrt/openwrt] realtek: Simple conversions to RTL8231 MFD driver
LEDE Commits
lede-commits at lists.infradead.org
Sun Jan 26 12:46:59 PST 2025
svanheule pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/b7af54d5c18cf74b9b598b506a335443a0bbed87
commit b7af54d5c18cf74b9b598b506a335443a0bbed87
Author: Sander Vanheule <sander at svanheule.net>
AuthorDate: Sat Jan 18 21:40:06 2025 +0100
realtek: Simple conversions to RTL8231 MFD driver
Change devices with RTL8231 GPIO expander definition that can easily be
translated to the new RTL8231 binding and carry over any gpio-hogs. This
will let them use the new RTL8231 MFD driver, without any functional
changes.
Signed-off-by: Sander Vanheule <sander at svanheule.net>
---
.../realtek/dts/rtl8380_engenius_ews2910p.dts | 57 +++++++++++++---------
.../linux/realtek/dts/rtl8380_linksys_lgs310c.dts | 19 ++++++--
.../linux/realtek/dts/rtl8380_netgear_gigabit.dtsi | 19 ++++++--
.../linux/realtek/dts/rtl8382_iodata_bsh-g24mb.dts | 19 ++++++--
4 files changed, 79 insertions(+), 35 deletions(-)
diff --git a/target/linux/realtek/dts/rtl8380_engenius_ews2910p.dts b/target/linux/realtek/dts/rtl8380_engenius_ews2910p.dts
index 289ec86274..b0f1e9b538 100644
--- a/target/linux/realtek/dts/rtl8380_engenius_ews2910p.dts
+++ b/target/linux/realtek/dts/rtl8380_engenius_ews2910p.dts
@@ -38,29 +38,6 @@
};
};
- gpio1: rtl8231-gpio {
- compatible = "realtek,rtl8231-gpio";
- #gpio-cells = <2>;
- gpio-controller;
- indirect-access-bus-id = <0>;
-
- poe_enable {
- gpio-hog;
- gpios = <1 GPIO_ACTIVE_HIGH>;
- output-high;
- line-name = "poe-enable";
- };
-
- sff_p9_gpios {
- gpio-hog;
- gpios = < 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>,
- < 11 GPIO_ACTIVE_HIGH>, /* los-gpio */
- < 12 GPIO_ACTIVE_LOW>; /* mod-def0-gpio */
- input;
- line-name = "sff-p9-gpios";
- };
- };
-
gpio-export {
compatible = "gpio-export";
@@ -119,6 +96,40 @@
};
};
+&mdio_aux {
+ status = "okay";
+
+ gpio1: expander at 0 {
+ compatible = "realtek,rtl8231";
+ reg = <0>;
+
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&gpio1 0 0 37>;
+
+ poe_enable {
+ gpio-hog;
+ gpios = <1 GPIO_ACTIVE_HIGH>;
+ output-high;
+ line-name = "poe-enable";
+ };
+
+ sff_p9_gpios {
+ gpio-hog;
+ gpios = < 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>,
+ < 11 GPIO_ACTIVE_HIGH>, /* los-gpio */
+ < 12 GPIO_ACTIVE_LOW>; /* mod-def0-gpio */
+ input;
+ line-name = "sff-p9-gpios";
+ };
+
+ led-controller {
+ compatible = "realtek,rtl8231-leds";
+ status = "disabled";
+ };
+ };
+};
+
&spi0 {
status = "okay";
diff --git a/target/linux/realtek/dts/rtl8380_linksys_lgs310c.dts b/target/linux/realtek/dts/rtl8380_linksys_lgs310c.dts
index 08ef740399..ab095dbc65 100644
--- a/target/linux/realtek/dts/rtl8380_linksys_lgs310c.dts
+++ b/target/linux/realtek/dts/rtl8380_linksys_lgs310c.dts
@@ -92,12 +92,23 @@
linux,code = <KEY_RESTART>;
};
};
+};
+
+&mdio_aux {
+ status = "okay";
+
+ gpio1: expander at 0 {
+ compatible = "realtek,rtl8231";
+ reg = <0>;
- gpio1: rtl8231-gpio {
- compatible = "realtek,rtl8231-gpio";
- #gpio-cells = <2>;
gpio-controller;
- indirect-access-bus-id = <0>;
+ #gpio-cells = <2>;
+ gpio-ranges = <&gpio1 0 0 37>;
+
+ led-controller {
+ compatible = "realtek,rtl8231-leds";
+ status = "disabled";
+ };
};
};
diff --git a/target/linux/realtek/dts/rtl8380_netgear_gigabit.dtsi b/target/linux/realtek/dts/rtl8380_netgear_gigabit.dtsi
index aca1a14774..75bf06e674 100644
--- a/target/linux/realtek/dts/rtl8380_netgear_gigabit.dtsi
+++ b/target/linux/realtek/dts/rtl8380_netgear_gigabit.dtsi
@@ -31,12 +31,23 @@
gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
open-source;
};
+};
+
+&mdio_aux {
+ status = "okay";
+
+ gpio1: expander at 31 {
+ compatible = "realtek,rtl8231";
+ reg = <31>;
- gpio1: rtl8231-gpio {
- compatible = "realtek,rtl8231-gpio";
- #gpio-cells = <2>;
gpio-controller;
- indirect-access-bus-id = <31>;
+ #gpio-cells = <2>;
+ gpio-ranges = <&gpio1 0 0 37>;
+
+ led-controller {
+ compatible = "realtek,rtl8231-leds";
+ status = "disabled";
+ };
};
};
diff --git a/target/linux/realtek/dts/rtl8382_iodata_bsh-g24mb.dts b/target/linux/realtek/dts/rtl8382_iodata_bsh-g24mb.dts
index 49b55813f9..c4f8165604 100644
--- a/target/linux/realtek/dts/rtl8382_iodata_bsh-g24mb.dts
+++ b/target/linux/realtek/dts/rtl8382_iodata_bsh-g24mb.dts
@@ -43,12 +43,23 @@
linux,code = <KEY_RESTART>;
};
};
+};
+
+&mdio_aux {
+ status = "okay";
+
+ gpio1: expander at 0 {
+ compatible = "realtek,rtl8231";
+ reg = <0>;
- gpio1: rtl8231-gpio {
- compatible = "realtek,rtl8231-gpio";
- #gpio-cells = <2>;
gpio-controller;
- indirect-access-bus-id = <0>;
+ #gpio-cells = <2>;
+ gpio-ranges = <&gpio1 0 0 37>;
+
+ led-controller {
+ compatible = "realtek,rtl8231-leds";
+ status = "disabled";
+ };
};
};
More information about the lede-commits
mailing list