<html><head></head><body dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="ApplePlainTextBody"><div class="ApplePlainTextBody"><br><br><blockquote type="cite">On 15-Feb-2021, at 4:38 AM, Andrew Jeffery <andrew@aj.id.au> wrote:<br><br><br><br>On Wed, 10 Feb 2021, at 21:46, vishwanatha subbanna wrote:<br><blockquote type="cite"><br><br><blockquote type="cite">On 16-Nov-2020, at 11:43 AM, Joel Stanley <joel@jms.id.au> wrote:<br><br>On Fri, 13 Nov 2020 at 05:59, Vishwanatha Subbanna<br><vishwa@linux.vnet.ibm.com> wrote:<br><blockquote type="cite"><br>These are LEDs on the cable cards that plug into PCIE slots.<br>The LEDs are controlled by PCA9552 I2C expander<br><br>Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com><br>---<br>arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts | 288 +++++++++++++++++++++++++++<br>1 file changed, 288 insertions(+)<br><br>diff --git a/arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts b/arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts<br>index 67c8c40..7de5f76 100644<br>--- a/arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts<br>+++ b/arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts<br>@@ -696,6 +696,70 @@<br> gpios = <&pca4 7 GPIO_ACTIVE_LOW>;<br> };<br> };<br>+<br>+ leds-optional-cablecard0 {<br></blockquote><br>Is it necessary to have separate nodes for each of the different GPIO devices?<br><br>Would it make sense to combine them, or is it better to be separate?<br><br>Andrew, Eddie, Brad: please review this one before I merge it.<br></blockquote><br>I answered this in previous patch set. If I express ‘em all in one <br>node that is “leds {", then if any of the GPIO is not seen because of <br>not having the card, then the current leds-gpio driver knocks off all <br>the ones on which it successfully acquired the GPIOs also, leaving <br>nothing.<br></blockquote><br>I'm struggling to follow this sentence. Can you please explain what you're <br>trying to say in a less colloquial way?<br></blockquote><br><br>Okay.. So, let me give a bit of background. We have some cards that are optional. What that means is, if the cards are to be inserted, then the system needs to be brought down to put ‘em. Now, there can be N such cards in our system and any of ‘em can be populated or none of ‘em can be populated depending on what user wants.<br><br>Now, let us assume I put global “leds { , compatible = "gpio-leds"; ” section and I describe LEDs of all these N cards along with all the other LEDs on the planar, then leds-gpio driver would populate all the entries in /sys/class/leds/ __if__ all of the N cards that I mentioned are plugged in and their GPIOs can be detected.<br><br>However, take for instance where 1 or more of those cards are not plugged in, then, because there is a failure in detecting those GPIOs, leds-gpio driver will<br>discard all other LEDs on which it could successfully acquire the GPIOs. So, there will not be anything in “/sys/class/leds”. So, the way it works is : either -all- or -none-.<br><br>So, what I have done :<br><br>- Put a "leds {“ section that contain the LEDs that are always present and wired to planar<br>- For each optional cards, have a separate section. This will make sure that even if some cards are not plugged in, leds-gpio honours rest others since acquiring GIPO on them would be successful. <br><br><br><br><blockquote type="cite"><br><blockquote type="cite">I did speak to the maintainer and it looked like the behaviour <br>was existing since long time and changing it would break old code.<br><br></blockquote><br>Break how?<br></blockquote><br>In my email to the maintainer, I mentioned if this behaviour can be fixed. Meaning, if the driver fails to detect one of more of GPIOs, then drop only those entries instead of dropping all other GPIOs that were actually present. I was told that the behaviour has been existing for a long time and can not be changed.<br><br>I hope I answered the questions. Please let me know if there is anything else.<br><br>Thank you,<br><blockquote type="cite"><br>Andrew<br></blockquote><br></div></body></html>