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 45340C64EC4 for ; Fri, 10 Mar 2023 15:47:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231305AbjCJPrm (ORCPT ); Fri, 10 Mar 2023 10:47:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234367AbjCJPrB (ORCPT ); Fri, 10 Mar 2023 10:47:01 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 999C2F6022; Fri, 10 Mar 2023 07:37:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date: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=ubonWFxei1BSJBCpzuPCTlOng9woXvk00b8UzkkOn8s=; b=L8Pz1A9cZZFsBjeAtMHtcCUw3r vQSaSGju5MJBB8U5AYCpSun9Kdtwd84Gh2ehNPewetlMpwneK/2C8mATI1ANXczFA1lcIAE36Z4qg d2RfzdLQoqC3TWrLbzacEUZhr8nvS0BNMOXtv88yN2U11r/JpcgE4SVUYTsTvzTb4qDM=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1paeSU-006zGA-G5; Fri, 10 Mar 2023 16:15:02 +0100 Date: Fri, 10 Mar 2023 16:15:02 +0100 From: Andrew Lunn To: Linus Walleij Cc: Christian Marangi , Hans de Goede , Pavel Machek , Lee Jones , Rob Herring , Krzysztof Kozlowski , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Heiner Kallweit , Russell King , Jonathan Corbet , "Russell King (Oracle)" , Jacek Anaszewski , John Crispin , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-doc@vger.kernel.org, Tim Harvey , Alexander Stein , Rasmus Villemoes , Bagas Sanjaya , Arun.Ramadoss@microchip.com Subject: Re: [PATCH v8 00/13] Adds support for PHY LEDs with offload triggers Message-ID: <576d57cb-481c-46ba-9e3b-d3b7e3a4ec69@lunn.ch> References: <20230216013230.22978-1-ansuelsmth@gmail.com> <8226f000-dd9c-4774-b972-a7f1113f0986@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 10, 2023 at 10:37:25AM +0100, Linus Walleij wrote: > On Thu, Mar 9, 2023 at 4:22 PM Andrew Lunn wrote: > > > As to 'how a certain trigger on a certain LED is going to associate > > itself with, say, a certain port' is clearly a property of the > > hardware, when offloading is supported. I've not seen a switch you can > > arbitrarily assign LEDs to ports. The Marvell switches have the LED > > registers within the port registers, for example, two LEDs per port. > > Aha so there is an implicit HW dependency between the port and the > LED, that we just cannot see in the device tree. Okay, it makes sense. Well, i would say the dependency is in the device tree, in that the LEDs are described in the ports, not as a block of their own at a higher level within the switch. And in some switches, they might actually be a block of registers in there own space, rather than in the port registers. But i still expect there is a fixed mapping between LED and port. > I think there will be a day when a switch without LED controller appears, > but the system has a few LEDs for the ports connected to an > arbitrary GPIO controller, and then we will need this. But we have > not seen that yet :) The microchip sparx5 might be going in that direction. It has what looks like a reasonably generic sgpio controller: drivers/pinctrl/pinctrl-microchip-sgpio.c But this not just about switches. It is also plain NICs. And using ledtrig-netdev, you could make your keyboard LED blink based on network traffic etc. So yes, using a phandle to an LED could very well be useful in the future. Andrew