From patchwork Thu May 5 13:55:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 570069 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0886C433F5 for ; Thu, 5 May 2022 13:55:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380329AbiEEN7T (ORCPT ); Thu, 5 May 2022 09:59:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380276AbiEEN7R (ORCPT ); Thu, 5 May 2022 09:59:17 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8F071EEDE; Thu, 5 May 2022 06:55:37 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id g23so5294141edy.13; Thu, 05 May 2022 06:55:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=W4OY/JvmasUugHSn3rUmXaSkS514QXA0AsYyOrhfQQg=; b=H8Ao8D+HKPoqzvyk98XDDUx5ZI7tA1FociIFIuzl17MmQWY+/ne9onYEyJ0AYfrm6M WBl8sG1lg7rLJT+ffPgm8+ERj97fPvTeSbCsqbV/h6YlsCvpNUU/SH7E4nWQHwQU8Y0H fQhXJQemxVsnGX6dt0rvSKqm47LDBgg9ByAAs+3RMv0Ot3YFjq3hLRfsG2DPniS3t4tp WhEqGTIecb+TAtoJ4goXvh/SbiMP9gwzm/uIIgPQNy116BtfzSDWWjEaRdRfeoc2C1Te o5Mry/99pzA8YkYpAYviJKCNP97gqiItOI+NtsW6Ppnw9ndyiGrdPcpP2ZSxG1ufiQh+ +Aig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=W4OY/JvmasUugHSn3rUmXaSkS514QXA0AsYyOrhfQQg=; b=tDfJn+YuPVgaAmVyWZe9n82wFVcEnDpCX+it73cjRR17en3oTWOZxUDwkMsuX0NESr vBqTx11eaPig5HP1RTIk5G4L2yquAqR9eUhhFzcARqAHYv9yd2FGxQNcglOMId3ZLW0Q +XeYpk8Tc36nE0pzDebJPbYbT0FV+1ixP8zoph7p119lUu1ALbMS3l8vNjAO8k8UCnij qcbS4KWDQNs07qsomy26s2SeupEUEotGIc0Wl58LuvLm8fzV5PViPbqYcxUuZTy1Ez6j 6LZIK2o+vtkLWIx2Ki55TKerJXMss/7GuvByNtl2TOh1I8NGK7vBWhBibEJ1xIR3ZP9o SzvQ== X-Gm-Message-State: AOAM530JLQeWaONohBV7JkkCV9V9eMw0VEgNIJxxMIhcmfhLaP9woxPb vgTkNMxActh+OshNjWGWXKQ= X-Google-Smtp-Source: ABdhPJxZtO2nEF1yJ6MjoitOsoR6NiKa4vbJTd4fTbtfyjCPOSo9zQI9bOEoP434SL7qulITdqNiPQ== X-Received: by 2002:a05:6402:2741:b0:41f:69dc:9bcd with SMTP id z1-20020a056402274100b0041f69dc9bcdmr30258922edd.239.1651758936244; Thu, 05 May 2022 06:55:36 -0700 (PDT) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id e15-20020a50e44f000000b0042617ba63c7sm877949edm.81.2022.05.05.06.55.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 May 2022 06:55:35 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Rob Herring , Krzysztof Kozlowski Cc: Pavel Machek , "David S . Miller" , Jakub Kicinski , Paolo Abeni , Florian Fainelli , Hauke Mehrtens , Jacek Anaszewski , devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-leds@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, ansuelsmth@gmail.com, andrew@lunn.ch, vivien.didelot@gmail.com, Vladimir Oltean , Jonathan Corbet , John Crispin , linux-doc@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH RESEND PoC] leds: trigger: netdev: support DT "trigger-sources" property Date: Thu, 5 May 2022 15:55:12 +0200 Message-Id: <20220505135512.3486-6-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220505135512.3486-1-zajec5@gmail.com> References: <20220505135512.3486-1-zajec5@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org From: Rafał Miłecki Parse "trigger-sources", find referenced netdev & use it as default trigger source. Signed-off-by: Rafał Miłecki --- This is a proof on concept, please don't apply this patch. I'll rework this on top of Ansuel's netdev trigger refactoring once it gets accepted ---- drivers/leds/trigger/ledtrig-netdev.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.c index d5e774d83021..c036a3671773 100644 --- a/drivers/leds/trigger/ledtrig-netdev.c +++ b/drivers/leds/trigger/ledtrig-netdev.c @@ -20,6 +20,8 @@ #include #include #include +#include +#include #include #include #include "../leds.h" @@ -389,6 +391,28 @@ static void netdev_trig_work(struct work_struct *work) (atomic_read(&trigger_data->interval)*2)); } +static void netdev_trig_of_init(struct led_classdev *led_cdev) +{ + struct device *dev = led_cdev->dev; + struct device_node *np = dev->of_node; + struct of_phandle_args args; + struct net_device *netdev; + int err; + + err = of_parse_phandle_with_args(np, "trigger-sources", "#trigger-source-cells", 0, &args); + if (err || WARN_ON(!args.np)) { + dev_err(dev, "Failed to get trigger source phandle: %d\n", err); + return; + } + + netdev = of_find_net_device_by_node(args.np); + if (netdev) { + device_name_store(dev, NULL, netdev->name, strlen(netdev->name) + 1); + } + + of_node_put(args.np); +} + static int netdev_trig_activate(struct led_classdev *led_cdev) { struct led_netdev_data *trigger_data; @@ -415,6 +439,8 @@ static int netdev_trig_activate(struct led_classdev *led_cdev) led_set_trigger_data(led_cdev, trigger_data); + netdev_trig_of_init(led_cdev); + rc = register_netdevice_notifier(&trigger_data->notifier); if (rc) kfree(trigger_data); From patchwork Thu May 5 13:55:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 570624 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78E83C433F5 for ; Thu, 5 May 2022 13:55:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380297AbiEEN7S (ORCPT ); Thu, 5 May 2022 09:59:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380347AbiEEN7J (ORCPT ); Thu, 5 May 2022 09:59:09 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4A5F1834B; Thu, 5 May 2022 06:55:29 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id i19so8873989eja.11; Thu, 05 May 2022 06:55:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ahkARIN+8V3yBAvDKNOhMu072AYtqbFU/lpjoQxJ3Ks=; b=gyhScaHs263fn2FMoFIaeIpmB1OR6lK4hIvTWKMnoqsCeTC4u7f5XlTXbu1qDGT80A 7fcgacj4FhqraB8kY6V759+NYx4cX2hkWcGvb32qC9sVoAGgT0c4dRd6y7e+IOJSFnNl PHH4QW2DAEqWANTXLaKCgcW6G7rVVLpcz1Y9yRu2BHdODLKSj7bnvTA+PdIgmneIxKQn oC0YfGZpHfaQqXIvYNm6WzICki7T1sEtt3tFgVSroKZ0jNV5NchrvnoWG+0aocWXlN2T BarZsb5ZxvXwki1O9/qbU1o/HM708vc56H6LtIseoYFnr1ECso98W2oRXzZ4Y6JD/N+5 dK2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ahkARIN+8V3yBAvDKNOhMu072AYtqbFU/lpjoQxJ3Ks=; b=D4u2Bx7nQGaPPfrDj3pV00Lmfdiw/k60rB5PoCdnO62pcg9svUDiMyxJO5KZCHoziD kXTcAf0PuHML6/rerD111Bls12pBQEKXC14WCH+nswz4PtiwMrKXwEAHESV03Oe1oncC 1JbxO7aVcqoGM0uQLFtHYqU0fqKzPHHEqDvsixxwzmXIsLAimxBbe+1UycAzlxxXTH3W N58PCQQCUM4fOcokmNsoqL6d/ES3tnc+XiHp2ahG5d67nFPG97NzDtpkXtxBuwEnjjZC W5NdspzxS/ccCYLmpUtedlNoF8UiZwx+S2cMW13ztJrynCUtLZEeSES+0l6EMrAgfOtb W3Ng== X-Gm-Message-State: AOAM530qkHmiNA+u5cJAL+qMkR0iJ+fele4w1jWwkh8va5ml/G+StHDh IJ6zVwMCtErq0SCwjfJKiq8= X-Google-Smtp-Source: ABdhPJzi3vKiAPWHMT0W9f/YUPiDcbp8oCkahrkdy1du7Mdl6X0NgMbhUvQRlzLOh3T78kfW8HG0HA== X-Received: by 2002:a17:906:2646:b0:6d5:d889:c92b with SMTP id i6-20020a170906264600b006d5d889c92bmr27143703ejc.696.1651758928315; Thu, 05 May 2022 06:55:28 -0700 (PDT) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id e15-20020a50e44f000000b0042617ba63c7sm877949edm.81.2022.05.05.06.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 May 2022 06:55:27 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Rob Herring , Krzysztof Kozlowski Cc: Pavel Machek , "David S . Miller" , Jakub Kicinski , Paolo Abeni , Florian Fainelli , Hauke Mehrtens , Jacek Anaszewski , devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-leds@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, ansuelsmth@gmail.com, andrew@lunn.ch, vivien.didelot@gmail.com, Vladimir Oltean , Jonathan Corbet , John Crispin , linux-doc@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH RESEND 2/5] dt-bindings: net: allow Ethernet devices as LED triggers Date: Thu, 5 May 2022 15:55:09 +0200 Message-Id: <20220505135512.3486-3-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220505135512.3486-1-zajec5@gmail.com> References: <20220505135512.3486-1-zajec5@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org From: Rafał Miłecki This allows specifying Ethernet interfaces and switch ports as triggers for LEDs activity. Signed-off-by: Rafał Miłecki --- Documentation/devicetree/bindings/net/ethernet-controller.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml index 4f15463611f8..ebeb4446d253 100644 --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml @@ -232,6 +232,9 @@ properties: required: - speed +allOf: + - $ref: /schemas/leds/trigger-source.yaml + additionalProperties: true ... From patchwork Thu May 5 13:55:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 570071 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18C89C4332F for ; Thu, 5 May 2022 13:55:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380200AbiEEN7O (ORCPT ); Thu, 5 May 2022 09:59:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380360AbiEEN7L (ORCPT ); Thu, 5 May 2022 09:59:11 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 345631834B; Thu, 5 May 2022 06:55:32 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id b24so5291411edu.10; Thu, 05 May 2022 06:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JuRsVVqEUdtcZTaqe1dOvQJoNCUAzBZXwnxfkTQiX94=; b=W/5UaXxDAqcyJs7vU252H7GvKSWg0c/fiI5EtvVqQfvbbPoDgxZeoXXz2Bgk//+mch 8qTUnwBd0j2CIEhPg/aS4YTarFuuVfBGllA8yzs84ycZDVCyOTpXIptNc42tOPCz4bJ5 G4qBDcunfd4lFqKQXpcXd1p7ZPDRbz1YTdnhFD3UVZsw0EdVd6t6mOQkTvUbFeuyyhi+ KBPyzJUQv7RpdP7/H9jVZW+yKVEZfCeDO9cmF157c2iIt02b+3+CtN86kfjCVVC1+ZVw LS+UMchVLfARzZsy9nsMQoagGcQ5TlLJ6F9G12/UQkZ3H9uRyUhbgGQJpWvM+/y93GgN l/Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JuRsVVqEUdtcZTaqe1dOvQJoNCUAzBZXwnxfkTQiX94=; b=b/l3ej1DiCFCdYFM7rr6P/R1+zRtYRGMNX3mjOEBDaexQFs2ImN8Yin+6MTcLhpjEw lDvEfJznOKkUL+m3vjNO5PO3BIX/2f33gXwLP2G8iWDNpETvirK1CVj/R/pMWWaszA5i GvmoM/BpySOq82BmFd7u74tivPmsR9HMZHJRaypo91EpiRaoNOiSI6xWIu4KqVMWl4FV UaErHHnkVYH+Qox6Lar3p6hZS+Pq8Q7zn1i2H690mXmiv5evYWv9xBTxD7ZJTWYHTc21 9kv973BXyzAYknaPb91XCnbdB9WCNgyIKwtRLO/+kR43BromnrnKHrbqrsjKCSbb+AA4 LbyQ== X-Gm-Message-State: AOAM530L+tXXK6sCg7nWzyXLgi2vuAruYKZ8c3pJwIoWR9huMtlhBDxN RFSSe47qzZHk/uKtyo1rxOc= X-Google-Smtp-Source: ABdhPJzTLEuqMS0XXlAUBVlv48aIfbTihrqnsUKYIVW/6h2dIhYSa6hS2trVlUxvL1OW4mGnO/lzDw== X-Received: by 2002:a05:6402:f25:b0:427:bf59:ad72 with SMTP id i37-20020a0564020f2500b00427bf59ad72mr23149749eda.231.1651758930769; Thu, 05 May 2022 06:55:30 -0700 (PDT) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id e15-20020a50e44f000000b0042617ba63c7sm877949edm.81.2022.05.05.06.55.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 May 2022 06:55:30 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Rob Herring , Krzysztof Kozlowski Cc: Pavel Machek , "David S . Miller" , Jakub Kicinski , Paolo Abeni , Florian Fainelli , Hauke Mehrtens , Jacek Anaszewski , devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-leds@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, ansuelsmth@gmail.com, andrew@lunn.ch, vivien.didelot@gmail.com, Vladimir Oltean , Jonathan Corbet , John Crispin , linux-doc@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH RESEND 3/5] dt-bindings: leds: add Ethernet triggered LEDs to example Date: Thu, 5 May 2022 15:55:10 +0200 Message-Id: <20220505135512.3486-4-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220505135512.3486-1-zajec5@gmail.com> References: <20220505135512.3486-1-zajec5@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org From: Rafał Miłecki This adds 3 entries to existing example: 1. LED triggered by switch port in 10 / 100 Mbps link state 2. LED triggered by switch port in 1000 Mbps link 3. LED triggered by Ethernet interface (any speed) Signed-off-by: Rafał Miłecki --- .../devicetree/bindings/leds/common.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Documentation/devicetree/bindings/leds/common.yaml b/Documentation/devicetree/bindings/leds/common.yaml index 328952d7acbb..6c72121a1656 100644 --- a/Documentation/devicetree/bindings/leds/common.yaml +++ b/Documentation/devicetree/bindings/leds/common.yaml @@ -168,6 +168,7 @@ examples: - | #include #include + #include led-controller { compatible = "gpio-leds"; @@ -183,6 +184,26 @@ examples: gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>; trigger-sources = <&ohci_port1>, <&ehci_port1>; }; + + led-2 { + function = LED_FUNCTION_WAN; + color = ; + gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; + trigger-sources = <&wan_port (SPEED_10 | SPEED_100)>; + }; + + led-3 { + function = LED_FUNCTION_WAN; + color = ; + gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; + trigger-sources = <&wan_port SPEED_1000>; + }; + + led-4 { + function = LED_FUNCTION_LAN; + gpios = <&gpio0 4 GPIO_ACTIVE_LOW>; + trigger-sources = <&gmac 0>; + }; }; - | From patchwork Thu May 5 13:55:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 570625 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66560C41535 for ; Thu, 5 May 2022 13:55:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239924AbiEEN7T (ORCPT ); Thu, 5 May 2022 09:59:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351058AbiEEN7Q (ORCPT ); Thu, 5 May 2022 09:59:16 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 339A51834B; Thu, 5 May 2022 06:55:35 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id be20so5275643edb.12; Thu, 05 May 2022 06:55:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HxnwmUt5XXOQZLtedBMlDA6s9oP05DqI/7RXSR5ri4c=; b=f74uBA86yjxvRibJ5/m+mK0DKh+ITswdWnRayKUptZ68YBTe6giJ2U/Lff31CW9f2n 9xGhm2wejuObPDBrG/3iASSUq9QfrBEHo9CHcJOx+LtXaAk3kBaC8NYeHavBp9JJPJW3 4/jU+k7P7Nv51sG3CBKYgFLbUSE8DJyl8s3/o7mtfgrioAjbcaESnqnMPYUzvVVgwt99 I2JWRpZiaWk/V5OWWuYafMakfSJUZBXNhnJ/0ExZAUI+CKp7mWEh7WdkidS8L9exbXd0 TkBYmGpCOIIezWpQPkCXVDhGeP9ylbzvBrrpUNYBUv6B4SIsypPPL2nb5wfM+F1LFumY aD/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HxnwmUt5XXOQZLtedBMlDA6s9oP05DqI/7RXSR5ri4c=; b=cPtLxMJgCQ7e59Qy1y0MRo7O1zTWbmp+i1uCjFLZCnUcw+5XH6R7sXBbBqVMBd4PaV Uemc2aWgooB6Ktn4ZMuuEqeO8gESiG6gaIBaJBWQeOOTYnJvfdx7L8G1IyrdTul1G2W6 mUvJTDJ2L+dqS0wbjuLk5Is7Zw4N22GFldbA5QUOlEwB0CFhnFIeNo3QVtmErSJJD5XJ M8eXJPHpoOzG+ZvXYeK/tgoAnarD1GXeAlIm6Z4jFBG6ekm879rinbcFZjBJlOm4FiWR lJIIC2pK5tPa+4A2I+5a4MMDboDCYQqhxY2nDXw44YjoUPkaSbB8O3BivmPxtdM59VcF Ss7w== X-Gm-Message-State: AOAM533nCwuK4vIAa78mFBrPuyuvaegwFHzcylNT04B+mg5MXNJMDDCz WOfkkLDlVwmnSK8mRnVeu6c= X-Google-Smtp-Source: ABdhPJzKQ4doBuTShpt/bqmUap9zPNLxvV2r0btNGW4wF9eKsbrNNiPReGQVLou27wEe566MwrMcEg== X-Received: by 2002:a05:6402:26d3:b0:427:c571:86fe with SMTP id x19-20020a05640226d300b00427c57186femr22415605edd.133.1651758933825; Thu, 05 May 2022 06:55:33 -0700 (PDT) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id e15-20020a50e44f000000b0042617ba63c7sm877949edm.81.2022.05.05.06.55.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 May 2022 06:55:33 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Rob Herring , Krzysztof Kozlowski Cc: Pavel Machek , "David S . Miller" , Jakub Kicinski , Paolo Abeni , Florian Fainelli , Hauke Mehrtens , Jacek Anaszewski , devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-leds@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, ansuelsmth@gmail.com, andrew@lunn.ch, vivien.didelot@gmail.com, Vladimir Oltean , Jonathan Corbet , John Crispin , linux-doc@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH RESEND 4/5] ARM: dts: BCM5301X: Add triggers for Luxul XWR-1200 network LEDs Date: Thu, 5 May 2022 15:55:11 +0200 Message-Id: <20220505135512.3486-5-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220505135512.3486-1-zajec5@gmail.com> References: <20220505135512.3486-1-zajec5@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org From: Rafał Miłecki Those LEDs are not hardware controlled so bootloader / operating system may want to control them manually depending on switch ports state. Signed-off-by: Rafał Miłecki --- arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts b/arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts index 9316a36434f7..ee1b0fd3eb86 100644 --- a/arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts +++ b/arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts @@ -5,6 +5,8 @@ /dts-v1/; +#include + #include "bcm47081.dtsi" #include "bcm5301x-nand-cs0-bch4.dtsi" @@ -38,24 +40,28 @@ power { lan3 { label = "bcm53xx:green:lan3"; gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>; + trigger-sources = <&port_lan3 SPEED_UNSPEC>; linux,default-trigger = "none"; }; lan4 { label = "bcm53xx:green:lan4"; gpios = <&chipcommon 2 GPIO_ACTIVE_LOW>; + trigger-sources = <&port_lan4 SPEED_UNSPEC>; linux,default-trigger = "none"; }; wan { label = "bcm53xx:green:wan"; gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>; + trigger-sources = <&port_wan SPEED_UNSPEC>; linux,default-trigger = "none"; }; lan2 { label = "bcm53xx:green:lan2"; gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>; + trigger-sources = <&port_lan2 SPEED_UNSPEC>; linux,default-trigger = "none"; }; @@ -87,6 +93,7 @@ status { lan1 { label = "bcm53xx:green:lan1"; gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>; + trigger-sources = <&port_lan1 SPEED_UNSPEC>; linux,default-trigger = "none"; }; }; @@ -114,29 +121,34 @@ &srab { status = "okay"; ports { - port@0 { + port_lan4: port@0 { reg = <0>; label = "lan4"; + #trigger-source-cells = <1>; }; - port@1 { + port_lan3: port@1 { reg = <1>; label = "lan3"; + #trigger-source-cells = <1>; }; - port@2 { + port_lan2: port@2 { reg = <2>; label = "lan2"; + #trigger-source-cells = <1>; }; - port@3 { + port_lan1: port@3 { reg = <3>; label = "lan1"; + #trigger-source-cells = <1>; }; - port@4 { + port_wan: port@4 { reg = <4>; label = "wan"; + #trigger-source-cells = <1>; }; port@5 {