Message ID | 20230319191814.22067-16-ansuelsmth@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp843490wrt; Sun, 19 Mar 2023 12:22:03 -0700 (PDT) X-Google-Smtp-Source: AK7set/UhqckVLzJcg1qDeSb2f7JKuKg0uEiidLTuJ/tJN3cK+JlRZO+EH41z82WVxvllQaHnFH7 X-Received: by 2002:a17:902:e551:b0:1a0:65ae:df32 with SMTP id n17-20020a170902e55100b001a065aedf32mr17311599plf.37.1679253723554; Sun, 19 Mar 2023 12:22:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679253723; cv=none; d=google.com; s=arc-20160816; b=hrFwfIuIGu/HJkdHrmFww8eGcWBAg0GZ/EocoLVV/iQnyjZo+icjz8hZtvG5UfmwBY 3XWNZ1oSyr0uFa3R0Rj/1O4NbGFhwPRJwm85qIqNUBBsTEsE5InKw4uLr8T+jjn0eH5h sYzko652JY1ySSj8LNRqL4WR5e5BXg7ZGvHzGIEtUdrErMXx8/Xj4Dv+qcC4r6bp5mxS I3foB/WMg5czLj7lVTP6Oa9xV8rqCcn67l4iPoshNyV8jhM5WDt4iKcvrvEl1DWT/tc1 sJnSeGE1qqyQnTLRlHVY8+zUtK9aTV7jZnSLZH3YfRk37tQ4s6Qr+nzyCf6G1yrK2ren /k4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=oy4rJp/0zV8uQx96aqdFOna+cm21IPd+B8/oErRDE1c=; b=N22IR6Cl+GRC65Pig14LpVZPcpY4EWynyb7vY7z6ht6F9bj7kIE8OVSMh7pHjii5+u ivM01xkBztKyY3EJCJN2+wcfjg0xYdLTo4wNItJlBm3i591LIEHhPGgOwo7IiyT9CkuQ ghZ4bK8xGvEOIPiYgUKpbzom/X/6AWcr0KwSFjCFH/1F397Z9DYNkzhSJC4UQnFkm++4 WuH9iu9E/E9AK/bl1WyNmhOWNJuCPIxQBMB2aWm2JXh+qDDYi0zLL9p7KPjJ5jwmlQR7 KERcmDTMeeKOfQmwxwG/ImItCR2LHL6djobaub0G9FM/HDxH6N/8YVduE848s/XZwoyo cEhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ITt6syLm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n3-20020a654883000000b004fb12ee7cb9si8507364pgs.354.2023.03.19.12.21.50; Sun, 19 Mar 2023 12:22:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ITt6syLm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230208AbjCSTUt (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Sun, 19 Mar 2023 15:20:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230122AbjCSTTu (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 19 Mar 2023 15:19:50 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6252F1E9E3; Sun, 19 Mar 2023 12:18:58 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id v1so2417893wrv.1; Sun, 19 Mar 2023 12:18:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679253536; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=oy4rJp/0zV8uQx96aqdFOna+cm21IPd+B8/oErRDE1c=; b=ITt6syLmwNGy0ZbUxm216tTbp3mY9GEm/3lMvbbE2Rt2AmFNDP+lDlVo9z74NODKkT PFUABL92MyqFqXD0IsdwgSVPYtr+hzSbiu2N45Nr+n8QX8AmyN8POiYqe5G/DajGXsJc 67FzzJrp7CrMFY4Y3HeIEpyujtlfFQpZokxqSIZ0j8ktmSZK1E7YZqfLTa/KyiYMHoCi T4VCPN2ZwK6nDdX3L3rI6l6bJJY4SzMN+vB0EOUrtkw+1Dbccm31xymXbmoBaT0mARDG M0OzS1dz+KV8WVgJiqN4sFnIBVzzEuNQ9Nb7uGwFagkzmu7y1OC0cB+tPyIYFnF2eRVd Ry8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679253536; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oy4rJp/0zV8uQx96aqdFOna+cm21IPd+B8/oErRDE1c=; b=BmLFh8WV1M+TZGUnzvPeSsGVXAQ6/vYpkGdESvvjYjJpD6zO5usE8f0HYBQ9kjZpzk niBLr8jLmqTwOUNznKVsVTBt4TNb1Tcd/qA8WPpFIMpn2lM24BJ0Het5MI9QYB1Tcg9X Df29M5/57Gx2gsnDYWV+Vo3vE25bLcs9ycXX5pee4VIPvgX03ATGu9JxtzNI5WEG/dnZ 9wvt9XeHx5AccaQduvXM+eGlHgUM8p0GO6za2z4DALIO0QTD5xOVMtKiNCEzL3/mbcoL zkPWBeStNNEGL9aMYApF1jldrxQmMEqao3pO7+JSQo4D2fDeFuvgJyzOmL0fVoMNHeuc Shtg== X-Gm-Message-State: AO0yUKWJIiv0ypZ1vCMrP5r0EYrVVKgE/DyGT9Yf+/MebxsCvgUzieD0 YbWyqO0hwFUmUMcBU0Svb/Q= X-Received: by 2002:a5d:4205:0:b0:2cf:fd6:b83f with SMTP id n5-20020a5d4205000000b002cf0fd6b83fmr7367868wrq.8.1679253535952; Sun, 19 Mar 2023 12:18:55 -0700 (PDT) Received: from localhost.localdomain (93-34-89-197.ip49.fastwebnet.it. [93.34.89.197]) by smtp.googlemail.com with ESMTPSA id b7-20020a5d4b87000000b002cfe0ab1246sm7165167wrt.20.2023.03.19.12.18.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Mar 2023 12:18:55 -0700 (PDT) From: Christian Marangi <ansuelsmth@gmail.com> To: Andrew Lunn <andrew@lunn.ch>, Florian Fainelli <f.fainelli@gmail.com>, Vladimir Oltean <olteanv@gmail.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Heiner Kallweit <hkallweit1@gmail.com>, Russell King <linux@armlinux.org.uk>, Gregory Clement <gregory.clement@bootlin.com>, Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>, Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Pavel Machek <pavel@ucw.cz>, Lee Jones <lee@kernel.org>, Christian Marangi <ansuelsmth@gmail.com>, John Crispin <john@phrozen.org>, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-leds@vger.kernel.org Subject: [net-next PATCH v5 15/15] arm: mvebu: dt: Add PHY LED support for 370-rd WAN port Date: Sun, 19 Mar 2023 20:18:14 +0100 Message-Id: <20230319191814.22067-16-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230319191814.22067-1-ansuelsmth@gmail.com> References: <20230319191814.22067-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760825152009776630?= X-GMAIL-MSGID: =?utf-8?q?1760825152009776630?= |
Series |
net: Add basic LED support for switch/phy
|
|
Commit Message
Christian Marangi
March 19, 2023, 7:18 p.m. UTC
From: Andrew Lunn <andrew@lunn.ch> The WAN port of the 370-RD has a Marvell PHY, with one LED on the front panel. List this LED in the device tree. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> --- arch/arm/boot/dts/armada-370-rd.dts | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
Comments
Hi! > From: Andrew Lunn <andrew@lunn.ch> > > The WAN port of the 370-RD has a Marvell PHY, with one LED on > the front panel. List this LED in the device tree. > > Signed-off-by: Andrew Lunn <andrew@lunn.ch> > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> > @@ -135,6 +136,19 @@ &mdio { > pinctrl-names = "default"; > phy0: ethernet-phy@0 { > reg = <0>; > + leds { > + #address-cells = <1>; > + #size-cells = <0>; > + > + led@0 { > + reg = <0>; > + label = "WAN"; > + color = <LED_COLOR_ID_WHITE>; > + function = LED_FUNCTION_LAN; > + function-enumerator = <1>; > + linux,default-trigger = "netdev"; > + }; > + }; > }; > How will this end up looking in sysfs? Should documentation be added to Documentation/leds/leds-blinkm.rst ? BR, Pavel
On Thu, Mar 23, 2023 at 01:04:53PM +0100, Pavel Machek wrote: > Hi! > > > From: Andrew Lunn <andrew@lunn.ch> > > > > The WAN port of the 370-RD has a Marvell PHY, with one LED on > > the front panel. List this LED in the device tree. > > > > Signed-off-by: Andrew Lunn <andrew@lunn.ch> > > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> > > > @@ -135,6 +136,19 @@ &mdio { > > pinctrl-names = "default"; > > phy0: ethernet-phy@0 { > > reg = <0>; > > + leds { > > + #address-cells = <1>; > > + #size-cells = <0>; > > + > > + led@0 { > > + reg = <0>; > > + label = "WAN"; > > + color = <LED_COLOR_ID_WHITE>; > > + function = LED_FUNCTION_LAN; > > + function-enumerator = <1>; > > + linux,default-trigger = "netdev"; > > + }; > > + }; > > }; > > > > How will this end up looking in sysfs? Hi Pavel It is just a plain boring LED, so it will look like all other LEDs. There is nothing special here. > Should documentation be added to Documentation/leds/leds-blinkm.rst > ? This has nothing to do with blinkm, which appears to be an i2c LED driver. Andrew
Hi! > > > The WAN port of the 370-RD has a Marvell PHY, with one LED on > > > the front panel. List this LED in the device tree. > > > > > > Signed-off-by: Andrew Lunn <andrew@lunn.ch> > > > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> > > > > > @@ -135,6 +136,19 @@ &mdio { > > > pinctrl-names = "default"; > > > phy0: ethernet-phy@0 { > > > reg = <0>; > > > + leds { > > > + #address-cells = <1>; > > > + #size-cells = <0>; > > > + > > > + led@0 { > > > + reg = <0>; > > > + label = "WAN"; > > > + color = <LED_COLOR_ID_WHITE>; > > > + function = LED_FUNCTION_LAN; > > > + function-enumerator = <1>; > > > + linux,default-trigger = "netdev"; > > > + }; > > > + }; > > > }; > > > > > > > How will this end up looking in sysfs? > > Hi Pavel > > It is just a plain boring LED, so it will look like all other LEDs. > There is nothing special here. Well, AFAICT it will end up as /sys/class/leds/WAN, which is really not what we want. (Plus the netdev trigger should be tested; we'll need some kind of link to the ethernet device if we want this to work on multi-ethernet systems). > > Should documentation be added to Documentation/leds/leds-blinkm.rst > > ? > > This has nothing to do with blinkm, which appears to be an i2c LED > driver. Sorry, I meant Should documentation be added to Documentation/leds/well-known-leds.txt ? Best regards, Pavel
> > Hi Pavel > > > > It is just a plain boring LED, so it will look like all other LEDs. > > There is nothing special here. > > Well, AFAICT it will end up as /sys/class/leds/WAN, which is really > not what we want. Why not? It is just a plain boring LED. It can be used for anything, heartbeat, panic SOS in Morse code, shift lock, disk activity. Any of the triggers can be applied to it. It can be found in /sys/class/leds/f1072004.mdio-mii:00:WAN. But when we come to using it for ledtrig-netdev, the user is more likely to follow /sys/class/net/eth0/phydev/leds/f1072004.mdio-mii\:00\:WAN/ > (Plus the netdev trigger should be tested; we'll > need some kind of link to the ethernet device if we want this to work > on multi-ethernet systems). Since this is a plain boring LED, it could actually blink for any netdev. When we get to offloading blinking to hardware, then things change, we need to check the netdev which is configured in the ledtrig-netdev is the same one the PHY is associated to. But i have a patchset for that which will appear later. > Should documentation be added to Documentation/leds/well-known-leds.txt ? Saying what. That there might be LEDs in your RJ45 connector, which can be used for anything which is supported by an Linux LED trigger? Andrew
diff --git a/arch/arm/boot/dts/armada-370-rd.dts b/arch/arm/boot/dts/armada-370-rd.dts index be005c9f42ef..15b36aa34ef4 100644 --- a/arch/arm/boot/dts/armada-370-rd.dts +++ b/arch/arm/boot/dts/armada-370-rd.dts @@ -20,6 +20,7 @@ /dts-v1/; #include <dt-bindings/input/input.h> #include <dt-bindings/interrupt-controller/irq.h> +#include <dt-bindings/leds/common.h> #include <dt-bindings/gpio/gpio.h> #include "armada-370.dtsi" @@ -135,6 +136,19 @@ &mdio { pinctrl-names = "default"; phy0: ethernet-phy@0 { reg = <0>; + leds { + #address-cells = <1>; + #size-cells = <0>; + + led@0 { + reg = <0>; + label = "WAN"; + color = <LED_COLOR_ID_WHITE>; + function = LED_FUNCTION_LAN; + function-enumerator = <1>; + linux,default-trigger = "netdev"; + }; + }; }; switch: switch@10 {