Re: [PATCH] dt-bindings: leds: leds-gpio: fix & extend node regex
From: Rafał Miłecki <rafal@milecki.pl>
Date: 2021-03-24 03:28:54
Also in:
linux-leds
On 23.03.2021 23:02, Rob Herring wrote:
On Tue, Mar 16, 2021 at 5:25 PM Rafał Miłecki [off-list ref] wrote:quoted
On 16.03.2021 23:31, Rob Herring wrote:quoted
On Wed, Mar 10, 2021 at 08:00:25AM +0100, Rafał Miłecki wrote:quoted
From: Rafał Miłecki <rafal@milecki.pl> The old regex allowed only 1 character to follow the "led-" prefix which was most likely just an overlook.Indeed.quoted
Fix it and while at it allow dashes in node names. It allows more meaningful names and it helpful e.g. when having the same function name with 2 different colors. For example: 1. led-power-white 2. led-power-blueNo, node names are supposed to be generic and reflect the class of device.There was some extra discussion on this patch that has ended up with a question about numbering nodes. Current binding assumes that nodes should be numbered with independent suffix numbers like: led-0 { }; led-1 { }; led-2 { }; Do you think this could / should be improved somehow?No, we have other ways for meaningful names (label, color, function, etc.).quoted
One option I was thinking about was using: led@0 { }; led@5 { }; where numbers ("0", "5") should match GPIO numbers. Is that a valid solution and does it improve things to make it worth it?What if you have <gpioa 1> and <gpiob 1>? The cells in a consumer for a provider are opaque to the consumer.
Thanks a lot for helping me understand that, it make sense ofc.