summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Jobling2025-01-23 00:13:35 +0000
committerSander Vanheule2025-02-22 11:32:35 +0000
commit8f3b24643b40e14be1c9c092c74030c29fa9d8c2 (patch)
treeff3e603389083342ea542fcb10023373a6328d14
parent0ae0766f29e537484748ce6681d78d33ecea8ec6 (diff)
downloadopenwrt-8f3b24643b40e14be1c9c092c74030c29fa9d8c2.tar.gz
realtek: HPE 1920-48G-PoE: allow fan speed control
The JG928A has an RTL8231 on the aux mdio bus. Add it to dts to expose the GPIO pins used to control and monitor the fan speed. To enable speed control, add the appropriate kernel driver module to DEVICE_PACKAGES. Of note, this does not control all fans for the unit. The power supply fans are not controlled. Signed-off-by: Evan Jobling <evan@jobling.au> Link: https://github.com/openwrt/openwrt/pull/17699 Signed-off-by: Sander Vanheule <sander@svanheule.net> (cherry picked from commit cbd1acbad3448280a180640e2a1a37a7144e1fb3)
-rw-r--r--target/linux/realtek/dts/rtl8393_hpe_1920-48g-poe.dts29
-rw-r--r--target/linux/realtek/image/rtl839x.mk2
2 files changed, 30 insertions, 1 deletions
diff --git a/target/linux/realtek/dts/rtl8393_hpe_1920-48g-poe.dts b/target/linux/realtek/dts/rtl8393_hpe_1920-48g-poe.dts
index e242775434..9765f80d88 100644
--- a/target/linux/realtek/dts/rtl8393_hpe_1920-48g-poe.dts
+++ b/target/linux/realtek/dts/rtl8393_hpe_1920-48g-poe.dts
@@ -5,8 +5,37 @@
/ {
compatible = "hpe,1920-48g-poe", "realtek,rtl8393-soc";
model = "HPE 1920-48G-PoE (JG928A)";
+
+ gpio_fan_array {
+ compatible = "gpio-fan";
+
+ gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
+ gpio-fan,speed-map = <5000 0>,
+ <8200 1>;
+
+ alarm-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
+ #cooling-cells = <2>;
+ };
};
&uart1 {
status = "okay";
};
+
+&mdio_aux {
+ status = "okay";
+
+ gpio1: expander@0 {
+ compatible = "realtek,rtl8231";
+ reg = <0>;
+
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&gpio1 0 0 37>;
+
+ led-controller {
+ compatible = "realtek,rtl8231-leds";
+ status = "disabled";
+ };
+ };
+};
diff --git a/target/linux/realtek/image/rtl839x.mk b/target/linux/realtek/image/rtl839x.mk
index 14d23ff371..5f9b6d56c6 100644
--- a/target/linux/realtek/image/rtl839x.mk
+++ b/target/linux/realtek/image/rtl839x.mk
@@ -21,7 +21,7 @@ define Device/hpe_1920-48g-poe
$(Device/hpe_1920)
SOC := rtl8393
DEVICE_MODEL := 1920-48G-PoE (JG928A)
- DEVICE_PACKAGES += realtek-poe
+ DEVICE_PACKAGES += realtek-poe kmod-hwmon-gpiofan
H3C_DEVICE_ID := 0x0001002b
endef
TARGET_DEVICES += hpe_1920-48g-poe