diff mbox series

realtek: hpe 1920-48-poe jg928a: add fan control

Message ID mailman.145909.1730109551.1280.openwrt-devel@lists.openwrt.org
State New
Headers show
Series realtek: hpe 1920-48-poe jg928a: add fan control | expand

Commit Message

Evan Jobling Oct. 28, 2024, 9:44 a.m. UTC
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
JG928A has an rtl8231 on the alt mdio bus.
Add it to device tree.
Add fan gpio and alarm to device tree.
Add hwmon kernel module to image.

Known issues:
Due to
3810e897295cb66bc45a62bc2c0b70a01004fe3b
"realtek: ensure output drivers are enabled in RTL8231"
This will change the default fan speed from what
bootloader has set.

Signed-off-by: Evan Jobling <evan.jobling@mslsc.com.au>
---
 .../realtek/dts/rtl8393_hpe_1920-48g-poe.dts  | 20 +++++++++++++++++++
 target/linux/realtek/image/rtl839x.mk         |  4 +++-
 2 files changed, 23 insertions(+), 1 deletion(-)
diff mbox series

Patch

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..297db96266 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,28 @@ 
 / {
 	compatible = "hpe,1920-48g-poe", "realtek,rtl8393-soc";
 	model = "HPE 1920-48G-PoE (JG928A)";
+
+	gpio1: rtl8231-gpio {
+			compatible = "realtek,rtl8231-gpio";
+			#gpio-cells = <2>;
+			gpio-controller;
+			indirect-access-bus-id = <0>;
+	};
+
+	gpio_fan_array {
+		compatible = "gpio-fan";
+		target-rpm = <10000>;
+
+		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";
 };
diff --git a/target/linux/realtek/image/rtl839x.mk b/target/linux/realtek/image/rtl839x.mk
index 14d23ff371..806ed5e70d 100644
--- a/target/linux/realtek/image/rtl839x.mk
+++ b/target/linux/realtek/image/rtl839x.mk
@@ -21,7 +21,9 @@  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