From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 75ECCCCFA03 for ; Sat, 1 Nov 2025 13:33:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=EK06CbvSEGuUCCYDJu0v9KuyLuNNsss4+MFQFqTJHXE=; b=0KjmOftdnSTt+m0C1ggz1oCBS5 uiaW1TDoCvwqv4XZCmm281ROo/UJ9Blp3fu9WZByQDIOnqQU7szWJG1otbtwTt388esUEV4aNqDMv hqwJHDkjX1ErjFZCm22mxwhsXilWjmIi4LOO59Txaba7TdGKTuPUHN5jSmvQLg7U+VsNqsU18LPex tvtGm6GhKvMx8ZAxW0RH3/s7Fs2hyusFAmxbVt0PNIBrfGDdKSmT9jm33r4jK0XLoBIAkwS89jpox TrjRt+gD2KkI01iYJr/ReRIC/HUhr7/zCfvCEL1RxAPa8gq/SAjrV90b5xIKgVOWDQppdgSlJ/1ci Sqi2P7mg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vFBjV-00000007mpP-0vmJ; Sat, 01 Nov 2025 13:33:29 +0000 Received: from bali.collaboradmins.com ([2a01:4f8:201:9162::2]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vFBjB-00000007m9Y-2qfm; Sat, 01 Nov 2025 13:33:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1762003979; bh=UijHeDMHMdBNIO9BLCrR9i8WyBLXoUJhDobFME3OXHY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=E2Y4n+EvnaE3MViZJ+XtsJMVOGjHDNaXPHmKm7axkj15Dv1CxLY1N8BjXN02rR8O0 9TvvzOxKf4fnbLYiwGtq7+KCVzMMr324qhvDZC3P8vK53ZLTd/0useF9Bh6e8Zd6vB c2NXXUGlc4EwCg83rG+hSzrN3UPVRlNcY2M8G+2zaRI5mKoEOnT7A2o93LSBBDgwwt 12sD3DVv7WpV7RolzzryQw1AQbd1VdYpIuf/c9iigfn8fZKxbpDCb+ti2l5lhxemt8 n+YJ2TdqlN+mtwTrYmyMYs2+s2Ch4ZKIwk3V4g8pxJOMe5GCobJ2vKfhTG8x0b2RfR BuygEanXt5xVg== Received: from beast.luon.net (simons.connected.by.freedominter.net [45.83.240.172]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: sjoerd) by bali.collaboradmins.com (Postfix) with ESMTPSA id AB5BE17E15C9; Sat, 1 Nov 2025 14:32:59 +0100 (CET) Received: by beast.luon.net (Postfix, from userid 1000) id DC29010E9D046; Sat, 01 Nov 2025 14:32:58 +0100 (CET) From: Sjoerd Simons Date: Sat, 01 Nov 2025 14:33:00 +0100 Subject: [PATCH v2 15/15] arm64: dts: mediatek: mt7981b-openwrt-one: Enable software leds MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20251101-openwrt-one-network-v2-15-2a162b9eea91@collabora.com> References: <20251101-openwrt-one-network-v2-0-2a162b9eea91@collabora.com> In-Reply-To: <20251101-openwrt-one-network-v2-0-2a162b9eea91@collabora.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Ryder Lee , Jianjun Wang , Bjorn Helgaas , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Manivannan Sadhasivam , Chunfeng Yun , Vinod Koul , Kishon Vijay Abraham I , Lee Jones , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lorenzo Bianconi , Felix Fietkau Cc: kernel@collabora.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pci@vger.kernel.org, linux-phy@lists.infradead.org, netdev@vger.kernel.org, Daniel Golle , Bryan Hinton , Sjoerd Simons X-Mailer: b4 0.14.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251101_063310_012558_9EBE4B05 X-CRM114-Status: GOOD ( 13.76 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The openwrt has 3 status leds at the front: * red: Used as failsafe led by openwrt * white: Used as boot led by openwrt * green: Used as running/upgrade led by openwrt On the back each RJ45 jack has the typical amber/green leds. For the WAN jack this is hardware controlled by the phy, for LAN these are under software control and enabled by this patch. Signed-off-by: Sjoerd Simons --- V1 -> V2: - Improve commit message - Re-order nodes to be alphabetical --- .../boot/dts/mediatek/mt7981b-openwrt-one.dts | 57 ++++++++++++++++++++++ arch/arm64/boot/dts/mediatek/mt7981b.dtsi | 2 +- 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/mediatek/mt7981b-openwrt-one.dts b/arch/arm64/boot/dts/mediatek/mt7981b-openwrt-one.dts index b13f16d7816bf..b308b7ad4945d 100644 --- a/arch/arm64/boot/dts/mediatek/mt7981b-openwrt-one.dts +++ b/arch/arm64/boot/dts/mediatek/mt7981b-openwrt-one.dts @@ -26,6 +26,50 @@ memory@40000000 { device_type = "memory"; }; + pwm-leds { + compatible = "pwm-leds"; + + led-0 { + color = ; + default-brightness = <0>; + function = LED_FUNCTION_STATUS; + max-brightness = <255>; + pwms = <&pwm 0 10000>; + }; + + led-1 { + color = ; + default-brightness = <0>; + function = LED_FUNCTION_STATUS; + max-brightness = <255>; + pwms = <&pwm 1 10000>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + led-0 { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&pio 9 GPIO_ACTIVE_HIGH>; + }; + + led-1 { + color = ; + function = LED_FUNCTION_LAN; + gpios = <&pio 34 GPIO_ACTIVE_LOW>; + linux,default-trigger = "netdev"; + }; + + led-2 { + color = ; + function = LED_FUNCTION_LAN; + gpios = <&pio 35 GPIO_ACTIVE_LOW>; + linux,default-trigger = "netdev"; + }; + }; + reg_3p3v: regulator-3p3v { compatible = "regulator-fixed"; regulator-name = "fixed-3.3V"; @@ -111,6 +155,13 @@ mux { }; }; + pwm_pins: pwm-pins { + mux { + function = "pwm"; + groups = "pwm0_0", "pwm1_1"; + }; + }; + spi2_flash_pins: spi2-pins { mux { function = "spi"; @@ -147,6 +198,12 @@ conf { }; }; +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm_pins>; + status = "okay"; +}; + &spi2 { pinctrl-names = "default"; pinctrl-0 = <&spi2_flash_pins>; diff --git a/arch/arm64/boot/dts/mediatek/mt7981b.dtsi b/arch/arm64/boot/dts/mediatek/mt7981b.dtsi index 17dd13d4c0015..66d89495bac52 100644 --- a/arch/arm64/boot/dts/mediatek/mt7981b.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7981b.dtsi @@ -126,7 +126,7 @@ apmixedsys: clock-controller@1001e000 { #clock-cells = <1>; }; - pwm@10048000 { + pwm: pwm@10048000 { compatible = "mediatek,mt7981-pwm"; reg = <0 0x10048000 0 0x1000>; clocks = <&infracfg CLK_INFRA_PWM_STA>, -- 2.51.0