From patchwork Tue Nov 28 23:21:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Lunn X-Patchwork-Id: 13471962 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="EPEuQa87" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7788197 for ; Tue, 28 Nov 2023 15:21:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject: Cc:To:From:From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version: Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Content-Disposition:In-Reply-To:References; bh=WtOLoBBwzQ0ssbSLlbU44nkZv4ONajUcT8mIhC8nhK4=; b=EPEuQa874Yuf5Vpdm87O1uVeyu HqEiiJRKoj+JssjBrRI6nj7zlGqP5Hl5yD+F+vRO3h01aZsh9eafe9IkdXm7fmYrm5ILFEHxUPFBI Dsh5N+VmU2NZ/BvBfuBdcA7adaKRMS/rlQWbrmucK7qIQVBI4Pd7xJTJzrkKLRYl1NrI=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1r87Op-001VIp-Gi; Wed, 29 Nov 2023 00:21:51 +0100 From: Andrew Lunn To: netdev Cc: Linus Walleij , Christian Marangi , Vladimir Oltean , Florian Fainelli , Andrew Lunn Subject: [PATCH RFC net-next 0/8] DSA LED infrastructure, mv88e6xxx and QCA8K Date: Wed, 29 Nov 2023 00:21:27 +0100 Message-Id: <20231128232135.358638-1-andrew@lunn.ch> X-Mailer: git-send-email 2.37.2 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC This patchset extends the DSA core to add support for port LEDs being controlled via sys/class/leds, and offloading blinking via ledtrig-netdev. The core parses the device tree binding, and registers LEDs. The DSA switch ops structure is extended with the needed functions. The mv88e6xxx support is partially added. Support for setting the brightness and blinking is provided, but offloading of blinking is not yet available. To demonstrate this, the wrt1900ac device tree is extended with LEDs. The existing QCA8K code is refactored to make use of this shared code. RFC: Linus, can you rework your code into this for offloading blinking ? And test with ports 5 & 6. Christian: Please test QCA8K. I would not be surprised if there is an off-by-one. This code can also be found in https://github.com/lunn/ v6.7-rc2-net-next-mv88e6xxx-leds Andrew Lunn (8): net: dsa: mv88e6xxx: Add helpers for 6352 LED blink and brightness net: dsa: mv88e6xxx: Tie the low level LED functions to device ops net: dsa: Plumb LED brightnes and blink into switch API dsa: Create port LEDs based on DT binding dsa: Plumb in LED calls needed for hardware offload dsa: mv88e6xxx: Plumb in LED offload functions arm: boot: dts: mvebu: linksys-mamba: Add Ethernet LEDs dsa: qca8k: Use DSA common code for LEDs .../dts/marvell/armada-xp-linksys-mamba.dts | 66 +++++ drivers/net/dsa/mv88e6xxx/chip.c | 103 +++++++ drivers/net/dsa/mv88e6xxx/chip.h | 14 + drivers/net/dsa/mv88e6xxx/port.c | 99 +++++++ drivers/net/dsa/mv88e6xxx/port.h | 76 +++++- drivers/net/dsa/qca/qca8k-8xxx.c | 11 +- drivers/net/dsa/qca/qca8k-leds.c | 255 +++--------------- drivers/net/dsa/qca/qca8k.h | 9 - drivers/net/dsa/qca/qca8k_leds.h | 21 +- include/net/dsa.h | 17 ++ net/dsa/dsa.c | 190 +++++++++++++ 11 files changed, 620 insertions(+), 241 deletions(-)