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: 13164870 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 A1C9DC6FA99 for ; Tue, 7 Mar 2023 22:34:30 +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=6jaqG2DQOjaH5vCnwJHPVybzICaxWuBVo0du+T9yGiY=; b=a4j9aedo0e/Tk/ pwEhKY4D1ZRkcnLpz4VNsO/W/3RP/TX/1vOAonDpwcx8yB+a5lk4YjR+XN27mVbpa/pAtOgOtqTo5 KqD2vqpvpMtdnsP9cWGwUzmvI2lGcsKzM8V/8k6RRGZfVycUbWKqHYtYXHP/kSUxgmjJhdxhjosRM NY8l7kcouxwZa1DzN1ajSVVBiYgskqurReyTEuVUOuFy1YfeXfwgECDAa+uD7T0yCArc/tH19bZLv z1f12rDwDOIUpZkx8Oal4G9zYXFA63CBhOWfipOjIKto7+YAZSkK2EJUrvhK6up2zHu3EO8daZBMZ tpa8Abq11bOcXxjISAVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZfsG-002gq1-4G; Tue, 07 Mar 2023 22:33:36 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZfs9-002gm9-8j for linux-arm-kernel@lists.infradead.org; Tue, 07 Mar 2023 22:33:32 +0000 Received: by mail-wm1-x32e.google.com with SMTP id c18so8758638wmr.3 for ; 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=w7sdie3U2YcocV3n3xsojCK66c6UNmHEoE+0wiaGk9I1pLMinqbzfgjtgKkgG2EZoG +1Lx7HDyUAtrdB7iIPJm1PCOUAgXRxs4rVQdYHYqlExphq9oDpkI+JJjVPdFu+M63uX0 aZUxrTDBqEpolaNMiEfqBllEkNRYhJlkB6eKIVmwMLY9KAJqLTb4GZVmS+c99vB01XGH vbLo64uyyUAnL2swd6yaErIOLrhFvbIte/T4ZVbF0zJ77kjfVXDbxOhdA0zDgl0qunHQ lzE8e+vJzpJ716CI4EEt6gqNxrE1x/MOhpXbgA6O33LvhKvHPM/rTbEfbfq8hoaQUHeh 8BOA== X-Gm-Message-State: AO0yUKWd9rvOZqQsItL7piQH29kcGI5wIH2obWmk7DebJKlU8sF2Kpsj qj2GfdlZfLyqrqiORxktqAQ= X-Google-Smtp-Source: AK7set+iISmhUNkN69tYI3z874X1mjN+SCBOpOBQFjZ6yWOi430CV4ezhe3Gmm24A0IprkHYwQo04w== 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230307_143329_325965_748A3D19 X-CRM114-Status: GOOD ( 15.58 ) 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/ 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