Re: [PATCH] dt-bindings: leds: leds-gpio: fix & extend node regex
From: Rafał Miłecki <rafal@milecki.pl>
Date: 2021-03-16 23:25:04
Also in:
linux-leds
From: Rafał Miłecki <rafal@milecki.pl>
Date: 2021-03-16 23:25:04
Also in:
linux-leds
On 16.03.2021 23:31, Rob Herring wrote:
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?
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?