<br><br>On Friday, July 23, 2021, Andrew Jeffery <<a href="mailto:andrew@aj.id.au">andrew@aj.id.au</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
This series does a bunch of crimes, so it's an RFC. I'm cross-posting to the<br>
pinctrl/GPIO and LEDs lists because the PCA955x devices impact all of them. What<br>
needs fixing is the leds-pca955x driver's failure to map the GPIO numberspace to<br>
the pin numberspace of the PCA955x devices. The series solves that by<br>
implementing pinctrl and pinmux in the leds-pca955x driver.<br>
<br>
Things I'm unsure about:<br>
<br>
1. Patch 1: The pinctrl_gpio_as_pin() API feels a bit dirty, not sure what<br>
others thoughts are on that (Linus?).<br>
<br>
2. Patch 2: I've added a new callback to hook the entirety of the pinctrl map<br>
parsing rather than supplying a subnode-specific callback. This was necessary<br>
to handle the PCA955x devicetree binding in a backwards compatible way.<br>
<br>
3. Patch 4: The PCA955x devices don't actually have any pinmux hardware, but the<br>
properties of the pinctrl/pinmux subsystems in the kernel map nicely onto the<br>
problem we have. But it's quite a bit of code...<br>
<br>
4. Patch 6: I also lost a bunch of time to overlooking the get_group_pins()<br>
callback for pinctrl, and it seems odd to me that it isn't required.<br>
<br>
Please review!</blockquote><div><br></div><div><br></div><div>Sounds like a hack. I was briefly looking into patches 1-4 and suddenly realized that the fix can be similar as in PCA9685 (PWM), I.e. we always have chips for the entire pin space and one may map them accordingly, requested in one realm (LED) in the other (GPIO) automatically is BUSY. Or I missed the point?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Andrew<br>
<br>
Andrew Jeffery (6):<br>
pinctrl: Add pinctrl_gpio_as_pin()<br>
pinctrl: Add hook for device-specific map parsing<br>
leds: pca955x: Relocate chipdef-related descriptors<br>
leds: pca955x: Use pinctrl to map GPIOs to pins<br>
ARM: dts: rainier: Add presence-detect and fault indictor GPIO<br>
expander<br>
pinctrl: Check get_group_pins callback on init<br>
<br>
arch/arm/boot/dts/aspeed-bmc-<wbr>ibm-rainier.dts | 76 +++<br>
drivers/leds/leds-pca955x.c | 554 +++++++++++++++----<br>
drivers/pinctrl/core.c | 28 +-<br>
include/linux/pinctrl/pinctrl.<wbr>h | 4 +<br>
4 files changed, 566 insertions(+), 96 deletions(-)<br>
<br>
-- <br>
2.30.2<br>
<br>
</blockquote><br><br>-- <br>With Best Regards,<br>Andy Shevchenko<br><br><br>