diff --git a/target/linux/realtek/base-files/etc/board.d/03_gpio_switches b/target/linux/realtek/base-files/etc/board.d/03_gpio_switches deleted file mode 100644 index c178bd43308..00000000000 --- a/target/linux/realtek/base-files/etc/board.d/03_gpio_switches +++ /dev/null @@ -1,17 +0,0 @@ - -. /lib/functions/uci-defaults.sh - -board_config_update - -board=$(board_name) - -case "$board" in -hpe,1920-24g-poe-180w|\ -hpe,1920-24g-poe-370w) - ucidef_add_gpio_switch "fan_ctrl" "Fan control" "456" "0" - ;; -esac - -board_config_flush - -exit 0 diff --git a/target/linux/realtek/base-files/etc/board.d/05_compat-version b/target/linux/realtek/base-files/etc/board.d/05_compat-version index 687cbb32a5a..9c27314b241 100644 --- a/target/linux/realtek/base-files/etc/board.d/05_compat-version +++ b/target/linux/realtek/base-files/etc/board.d/05_compat-version @@ -8,7 +8,9 @@ board_config_update case "$(board_name)" in - hpe,1920-8g-poe-180w) + hpe,1920-8g-poe-180w | \ + hpe,1920-24g-poe-180w | \ + hpe,1920-24g-poe-370w) ucidef_set_compat_version "1.1" ;; zyxel,gs1900-8 | \ diff --git a/target/linux/realtek/dts/rtl8382_hpe_1920-24g-poe-180w.dts b/target/linux/realtek/dts/rtl8382_hpe_1920-24g-poe-180w.dts index 4783cec15ca..69e647c59a9 100644 --- a/target/linux/realtek/dts/rtl8382_hpe_1920-24g-poe-180w.dts +++ b/target/linux/realtek/dts/rtl8382_hpe_1920-24g-poe-180w.dts @@ -5,6 +5,17 @@ / { compatible = "hpe,1920-24g-poe-180w", "realtek,rtl838x-soc"; model = "HPE 1920-24G-PoE+ 180W (JG925A)"; + + 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 { diff --git a/target/linux/realtek/dts/rtl8382_hpe_1920-24g-poe-370w.dts b/target/linux/realtek/dts/rtl8382_hpe_1920-24g-poe-370w.dts index ccdcf71d1bd..532f23ab2f2 100644 --- a/target/linux/realtek/dts/rtl8382_hpe_1920-24g-poe-370w.dts +++ b/target/linux/realtek/dts/rtl8382_hpe_1920-24g-poe-370w.dts @@ -5,6 +5,17 @@ / { compatible = "hpe,1920-24g-poe-370w", "realtek,rtl838x-soc"; model = "HPE 1920-24G-PoE+ 370W (JG926A)"; + + 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 { diff --git a/target/linux/realtek/image/rtl838x.mk b/target/linux/realtek/image/rtl838x.mk index 27dbc6ce59a..34464316c7f 100644 --- a/target/linux/realtek/image/rtl838x.mk +++ b/target/linux/realtek/image/rtl838x.mk @@ -147,18 +147,20 @@ TARGET_DEVICES += hpe_1920-24g define Device/hpe_1920-24g-poe-180w $(Device/hpe_1920) + $(Device/hwmon-fan-migration) SOC := rtl8382 DEVICE_MODEL := 1920-24G-PoE+ 180W (JG925A) - DEVICE_PACKAGES += realtek-poe + DEVICE_PACKAGES += realtek-poe kmod-hwmon-gpiofan H3C_DEVICE_ID := 0x00010028 endef TARGET_DEVICES += hpe_1920-24g-poe-180w define Device/hpe_1920-24g-poe-370w $(Device/hpe_1920) + $(Device/hwmon-fan-migration) SOC := rtl8382 DEVICE_MODEL := 1920-24G-PoE+ 370W (JG926A) - DEVICE_PACKAGES += realtek-poe + DEVICE_PACKAGES += realtek-poe kmod-hwmon-gpiofan H3C_DEVICE_ID := 0x00010029 endef TARGET_DEVICES += hpe_1920-24g-poe-370w