Skip to content

Commit

Permalink
realtek: HPE 1920 24G PoE+ 180W/370W move fans to hwmon
Browse files Browse the repository at this point in the history
Apply the equivalent of commit f64541d ("realtek: HPE 1920 8G PoE+
180W move fans to hwmon") to the 24-ports variants of the HPE 1920 PoE+
switches, with model numbers JG925A and JG926A.

Copy from the original commit message:

  Move to using hwmon and gpio-fan. This is by adding gpio_fan_array to
  DTS and kmod-hwmon-gpiofan to DEVICE_PACKAGES.

  In combination with the new rtl8231 gpio driver the default fan
  behaviour will be maximum fan speed.

  Bump compat value to 1.1 due to existing config in /etc/config/system
  via gpio_switch. Also notify in device compat that fan is now going to
  be at bootloader setting (maximum in this case) by default unless turned
  down.

As the init script 03_gpio_switches does not perform any action after
removing these devices from it, the file can be dropped.

Link: openwrt/openwrt#17598
Signed-off-by: Fabian Groffen <[email protected]>
Signed-off-by: Sander Vanheule <[email protected]>
  • Loading branch information
grobian authored and svanheule committed Jan 16, 2025
1 parent 67a4aee commit 0a7c8ed
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 20 deletions.
17 changes: 0 additions & 17 deletions target/linux/realtek/base-files/etc/board.d/03_gpio_switches

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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 | \
Expand Down
11 changes: 11 additions & 0 deletions target/linux/realtek/dts/rtl8382_hpe_1920-24g-poe-180w.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
11 changes: 11 additions & 0 deletions target/linux/realtek/dts/rtl8382_hpe_1920-24g-poe-370w.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 4 additions & 2 deletions target/linux/realtek/image/rtl838x.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0a7c8ed

Please sign in to comment.