From patchwork Mon Oct 28 09:44:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evan Jobling X-Patchwork-Id: 2003189 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=kqXXs3lB; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XcTRc5BYKz1xw0 for ; Mon, 28 Oct 2024 21:01:00 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type:List-Help: Reply-To:List-Archive:List-Unsubscribe:List-Subscribe:From:List-Post:List-Id: Message-ID:MIME-Version:To:Subject:Date:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=+LPLCvY30OopWvVGsmi9903nhd30iqMUAtUBCLlj9io=; b=kqXXs3lBXk8pMOgOov2nl6Q5ju ta54Kb0Yz6HGd1JU64UAB2A3RM/jtgl/SdCcuQUJSTzeHEn920MSOx7OafEHpMuSbFKWX/uP1yYiR g57WOyafyDySqaauMOONQcQA2GxyhLSoKXggFM1XftRkkNI4BDraX9GsbFROx37anzoz13tZ29SpZ OlgS3PDMxmaOZcSYiRwzNjR+a4puj0BdJuGy8LWlD1uNk7p0Y1Efh7ACfpKt6YnHQA6LQRlHV4brt UVHBcgrYFWlcyXcaBsWoik1AmQsYOuANP/GfyiVOirGeStjqktKHaqEjhumshB6Cgc7uDrQ3If7U/ iSMNYzgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t5MWn-0000000AKDZ-02ko; Mon, 28 Oct 2024 09:59:13 +0000 Date: Mon, 28 Oct 2024 20:44:42 +1100 Subject: [PATCH] realtek: hpe 1920-48-poe jg928a: add fan control To: openwrt-devel MIME-Version: 1.0 Message-ID: List-Id: OpenWrt Development List List-Post: X-Patchwork-Original-From: Evan Jobling via openwrt-devel From: Evan Jobling Precedence: list X-Mailman-Version: 2.1.34 X-BeenThere: openwrt-devel@lists.openwrt.org List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: Evan Jobling List-Help: Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org 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 --- .../realtek/dts/rtl8393_hpe_1920-48g-poe.dts | 20 +++++++++++++++++++ target/linux/realtek/image/rtl839x.mk | 4 +++- 2 files changed, 23 insertions(+), 1 deletion(-) 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