From patchwork Tue Mar 7 17:00:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 6272 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3735wrd; Tue, 7 Mar 2023 14:47:32 -0800 (PST) X-Google-Smtp-Source: AK7set8yWc7Clm4eSSnm9hHfm+YAl0GqYXT60vLACJq0hVqxaZQmloyS2rA9PIwIXM0XCyfI1gg8 X-Received: by 2002:a17:902:9b8a:b0:19e:7182:b54f with SMTP id y10-20020a1709029b8a00b0019e7182b54fmr13890725plp.36.1678229251802; Tue, 07 Mar 2023 14:47:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678229251; cv=none; d=google.com; s=arc-20160816; b=yvlRJaUweP3ghBFniQZ+Fu6kskQfOpXGj8odHrq96j+Uwg3OeXyCNrGsnSgYn06StQ CSsN3gpvBA/9DZL1UsqOn2vRxFOoTbEZ08th2M1kuesdZU5AIMHfDXJu6ro+RpGQBkTG 5FKnH+tgQvgC7+FLoLmXMgVjTVRzJ/qh8S1ytPRWa4pbiA8mvsq4hl8gDymSerTq16St NCwlFVBPg8+LYpOHwPdo9SUcaexYXnjrLbG1rzZDnE50KeIseBenldyNiGg0oJPGytx+ Do8HqwKnM5DPLO1/FkpIeyFFYH6plDq7lmkgaC+hPpcWWYAaRGCcsDiSWOEuSkscmYjY wC7Q== 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 :message-id:date:subject:to:from:dkim-signature; bh=vy4nAJ52d9qly4N/eBpamNRw8G/Xs8TXNaSOjPeSnwo=; b=Hw5A6hSFjlhqmujatkv7P2Zy/RF9N2XqFvt12Mfs5pUQ09MErj7iUHgja0nOOVgVSo a2VsyBDUQtcYLtVaas89hNy4oRnHeqZ9u865GuddkHiSH5p4yjmNNrE49Zap0Zb35KrU Dyo6Nta/hULn7awi8LDbIBMWtIbioxgINb6PrmsC2WfrDxSpgid7AQJb9bdcOXzp3m+F nysl+bqCM0kxd0RVeYmXqcDvqdP8K/3Szehb6vXLjU6ZY+RrA1SEPySpbKXSIjf+WaZv Q+lK4N6eo2aAyFj6F6fLH09FW384BaJiAmli85893lp3T1/ni5Ku5jKeAMLBfKwa5ezv 5cJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LEIqTiz2; 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 iy5-20020a170903130500b0019aa3505620si13279233plb.284.2023.03.07.14.47.15; Tue, 07 Mar 2023 14:47:31 -0800 (PST) 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=LEIqTiz2; 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 S229835AbjCGWd3 (ORCPT + 99 others); Tue, 7 Mar 2023 17:33:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229582AbjCGWd1 (ORCPT ); Tue, 7 Mar 2023 17:33:27 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D9D395E34; Tue, 7 Mar 2023 14:33:26 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id j19-20020a05600c1c1300b003e9b564fae9so96478wms.2; Tue, 07 Mar 2023 14:33:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678228405; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=vy4nAJ52d9qly4N/eBpamNRw8G/Xs8TXNaSOjPeSnwo=; b=LEIqTiz2iyvbjkfbQ0JFXMuS5UBnCK76trtCCqGFHK5H6SCXDyDLuV68bNshL1qQKe ohV4Uyfz6JUdqjMpa8zlGCwlFUV/k5sTDLpxA86QnGF5hHmSACtkUnXaawWomSOEUrVx jaSJMSXC8yiZvKdiT8/vbg4Y3ar4MJXmP2kDPWojUsvA5eYOw2M1lNcEp1EbKuhSvVyO 1gYbwt9YQJGT8TMZjf4ztVp7T2yfe3A4uFAQ3Ih0uDrB9zac4Zlcu7X7MUrz9LL33bTg Unv174q/7K+1+R7MVWhELDk7rB6D5KESQ/dE7BjO4HQhI8aW47tUfcDv7ZT6ZRG+FLoV GRlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678228405; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vy4nAJ52d9qly4N/eBpamNRw8G/Xs8TXNaSOjPeSnwo=; b=6MIyU+ENRVdcKg/tQx9/OSDs422qczL/I8PNWcB9+TvYsZE0PgsowRKcsQST2brIwE hJSLA9IX64sYCrltBL8AwLL6spHILF8AgJz1GQvEbEAzEhmeiKydixvk5K9VlUJNJb/j 3+JVQpkVH2RF5rTcl4rTvK1EX4tiDget5nZjlhOaZD19WQGJ0DAo5hlYMiAznGpeo9m5 DI30LWFVPuLlapm4hrroL8rEkvcJF4vSiGKarM6Y2VauzWLeUMxJEbqjViNc6305kERh z8ejCiwRyjVaHmRq11gNgmHcyFs5iXQ9igYCL/mEBpeeHqArkYZHAyt4CPMzYQ672nCV C4bQ== X-Gm-Message-State: AO0yUKXkje/9biCyz+jpYsUmqC+klIGZEdxm2PJ1MW66ENDPvlVPRuqS VjOFbYxyzOHEpjPIZUHkbBO8wzx6jNw= X-Received: by 2002:a05:600c:46c7:b0:3e7:f108:664c with SMTP id q7-20020a05600c46c700b003e7f108664cmr13776053wmo.40.1678228404628; Tue, 07 Mar 2023 14:33:24 -0800 (PST) Received: from localhost.localdomain (93-34-89-197.ip49.fastwebnet.it. [93.34.89.197]) by smtp.googlemail.com with ESMTPSA id q11-20020a05600c46cb00b003dc1d668866sm19233101wmo.10.2023.03.07.14.33.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 14:33:24 -0800 (PST) From: Christian Marangi To: Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Heiner Kallweit , Russell King , Gregory Clement , Sebastian Hesselbarth , Christian Marangi , John Crispin , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Lee Jones , linux-leds@vger.kernel.org Subject: [net-next PATCH 00/11] net: Add basic LED support for switch/phy Date: Tue, 7 Mar 2023 18:00:35 +0100 Message-Id: <20230307170046.28917-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,DATE_IN_PAST_03_06, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759750916069427834?= X-GMAIL-MSGID: =?utf-8?q?1759750916069427834?= This is a continue of [1]. It was decided to take a more gradual approach to implement LEDs support for switch and phy starting with basic support and then implementing the hw control part when we have all the prereq done. This series implements only the brightness_set() and blink_set() ops. An example of switch implementation is done with qca8k. For PHY a more generic approach is used with implementing the LED support in PHY core and with the user (in this case marvell) adding all the required functions. Currently we set the default-state as "keep" to not change the default configuration of the declared LEDs since almost every switch have a default configuration. [1] https://lore.kernel.org/lkml/20230216013230.22978-1-ansuelsmth@gmail.com/ Andrew Lunn (6): net: phy: Add a binding for PHY LEDs net: phy: phy_device: Call into the PHY driver to set LED brightness. net: phy: marvell: Add software control of the LEDs net: phy: phy_device: Call into the PHY driver to set LED blinking. net: phy: marvell: Implement led_blink_set() arm: mvebu: dt: Add PHY LED support for 370-rd WAN port Christian Marangi (5): net: dsa: qca8k: add LEDs basic support net: dsa: qca8k: add LEDs blink_set() support dt-bindings: net: dsa: dsa-port: Document support for LEDs node dt-bindings: net: dsa: qca8k: add LEDs definition example dt-bindings: net: phy: Document support for LEDs node .../devicetree/bindings/net/dsa/dsa-port.yaml | 7 + .../devicetree/bindings/net/dsa/qca8k.yaml | 24 ++ .../devicetree/bindings/net/ethernet-phy.yaml | 22 ++ arch/arm/boot/dts/armada-370-rd.dts | 14 ++ drivers/net/dsa/qca/Kconfig | 7 + drivers/net/dsa/qca/Makefile | 1 + drivers/net/dsa/qca/qca8k-8xxx.c | 4 + drivers/net/dsa/qca/qca8k-leds.c | 238 ++++++++++++++++++ drivers/net/dsa/qca/qca8k.h | 69 +++++ drivers/net/phy/marvell.c | 81 +++++- drivers/net/phy/phy_device.c | 115 +++++++++ include/linux/phy.h | 33 +++ 12 files changed, 610 insertions(+), 5 deletions(-) create mode 100644 drivers/net/dsa/qca/qca8k-leds.c