From patchwork Thu Mar 9 22:35:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 13168534 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 C4F2FC64EC4 for ; Thu, 9 Mar 2023 23:47:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=/mDQxjGXkQQRItXGwMqigYsFcBYmcN/ZDbkf8Sb/Vt0=; b=WT+jybLdLi3hvb PVdy2mnlCVaW8Faz1oqecE0oIVxVVfJE+Kv6kJg7FQ7/IybEviXE2z66PitjOCn3/90npYfRyblqw Y731SNsKqesybxRp8HeZEe9nSfcGIdDMyMoECDh7ojD3VUN4dclNnKh2Hm3FYdOT1XVsGlykH4PPF 3ScHWLQT+vDmRjy+A4VFbz2DhcmShzTDTMJ3K75+TAdmmv77LZzsfTIIGTSDX0svz51gBkiJOQGUl HmPppO5yrgeZyGbCiuv103RRrZGKL+X/j+lGQwM8TQCypAWJ0624hP4+bvq3iDh4yai9T/08+wIjZ zIoDSttdBjYu9/x/gcHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paPxk-00CMks-2g; Thu, 09 Mar 2023 23:46:20 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paOto-00CBoN-23 for linux-arm-kernel@lists.infradead.org; Thu, 09 Mar 2023 22:38:13 +0000 Received: by mail-wm1-x32a.google.com with SMTP id fm20-20020a05600c0c1400b003ead37e6588so4753444wmb.5 for ; Thu, 09 Mar 2023 14:37:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678401477; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=+YkCkrjJHa9Smmj/wJYS+f+10gt8i1v3+K2/QxqxGnI=; b=eJfOsBUED3fscQrc9JaP5TBDOF3Y46ECD0kikqu0swWAEZDbr/7Q1xoNQQMrD9lNx9 W+PeULXJXFWvpKlIHkG8G1N4+dq2abOGvUilkFgqkJOkbqJQgihsrWMgxhWD1h+lv7nY 6dyS/Dy9jmBtxRcRRPGb/kpgImyrlsqpUj9okXYvbTl7hh401KTNC4ttUfg+dmHGUvdY UWhybAzDCdqeU7gQNTHDu2ECQe685H3mSGscYauLFebmU0XgvwRQvKXCM5iOZG95pFWE 2PWBrASaBvLFoXO4HQK8q934x5quNX3HR7E41wTrSvpekIAt7WqBt5nr3Z1/lyPGG+9N +dcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678401477; 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=+YkCkrjJHa9Smmj/wJYS+f+10gt8i1v3+K2/QxqxGnI=; b=BCMECQ13clgp3rh7p/E8J7nUjP8RG4kB17pQ2bUujbsOscvYnq58MLuD9QZhwXjz+t HN5gnunI3KkPaYNyDCpF/fkAWdDDdKoC3O+fiYhxUPHiwezmLN+JGXthXW68YXWw4pjw BxIoaG71iG5m0QcTIK29QBGGEr77UhmpFOYmvmMgyBbu7NrR5tQz2Cgredm8wpAwO1rp tbzXQiyJWa6UCp1eFC7MxuvIyBphvK6sad3NjM7ApXR7I0VfNZWKYLr8TdN1mWq1kH3l FPNoU+VOrQjlLpXaOdJlTUgrO3q7hYzZnHpaugEyR9TuNp836s6oNT8QcIwzVXMvULkC Wmlg== X-Gm-Message-State: AO0yUKUOL0MaSLXnPpd07QuE0gLOpY0gXpEHH8PlEnjB50dp2L8lcLso Sla++Je+RNo8LOQWhTZz5oA= X-Google-Smtp-Source: AK7set8NHhpkF76F1n+vl6zWoM3i7+IYLzBdgq5tR6J3qDrVLnoQ2La7K2evFiIWcHcaTNKePGLOxQ== X-Received: by 2002:a05:600c:1e1f:b0:3eb:fc6:79cf with SMTP id ay31-20020a05600c1e1f00b003eb0fc679cfmr780797wmb.6.1678401476689; Thu, 09 Mar 2023 14:37:56 -0800 (PST) Received: from localhost.localdomain (93-34-89-197.ip49.fastwebnet.it. [93.34.89.197]) by smtp.googlemail.com with ESMTPSA id g12-20020a05600c310c00b003e209b45f6bsm1183981wmo.29.2023.03.09.14.37.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 14:37:56 -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 , Andy Gross , Bjorn Andersson , Konrad Dybcio , Christian Marangi , John Crispin , 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, Lee Jones , linux-leds@vger.kernel.org Subject: [net-next PATCH v2 00/14] net: Add basic LED support for switch/phy Date: Thu, 9 Mar 2023 23:35:10 +0100 Message-Id: <20230309223524.23364-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_143812_112426_471F9751 X-CRM114-Status: GOOD ( 19.03 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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/ Changes in new series v2: - Add LEDs node for rb3011 - Fix rb3011 switch node unevaluated properties while running make dtbs_check - Fix a copypaste error in qca8k-leds.c for port 4 required shift - Drop phy-handle usage for qca8k and use qca8k_port_to_phy() - Add review tag from Andrew - Add Christian Marangi SOB in each Andrew patch - Add extra description for dsa-port stressing that PHY have no access and LED are controlled by the related MAC - Add missing additionalProperties for dsa-port.yaml and ethernet-phy.yaml Changes from the old v8 series: - Drop linux,default-trigger set to netdev. - Dropped every hw control related patch and implement only blink_set and brightness_set - Add default-state to "keep" for each LED node example 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 (8): net: dsa: qca8k: move qca8k_port_to_phy() to header 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 arm: qcom: dt: Drop unevaluated properties in switch nodes for rb3011 arm: qcom: dt: Add Switch LED for each port for rb3011 dt-bindings: net: phy: Document support for LEDs node .../devicetree/bindings/net/dsa/dsa-port.yaml | 21 ++ .../devicetree/bindings/net/dsa/qca8k.yaml | 24 ++ .../devicetree/bindings/net/ethernet-phy.yaml | 31 +++ arch/arm/boot/dts/armada-370-rd.dts | 14 ++ arch/arm/boot/dts/qcom-ipq8064-rb3011.dts | 124 ++++++++- drivers/net/dsa/qca/Kconfig | 7 + drivers/net/dsa/qca/Makefile | 1 + drivers/net/dsa/qca/qca8k-8xxx.c | 19 +- drivers/net/dsa/qca/qca8k-leds.c | 236 ++++++++++++++++++ drivers/net/dsa/qca/qca8k.h | 83 ++++++ drivers/net/phy/marvell.c | 81 +++++- drivers/net/phy/phy_device.c | 115 +++++++++ include/linux/phy.h | 33 +++ 13 files changed, 765 insertions(+), 24 deletions(-) create mode 100644 drivers/net/dsa/qca/qca8k-leds.c