Re: [PATCH v2] leds: pca9532: Fix inverted GPIO output polarity
Bartosz Golaszewski <[email protected]>
| Newsgroups | org.kernel.vger.linux-leds,org.kernel.vger.linux-gpio,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <CAMRc=Mc_P+hTKS78f-z58NLxxQryTYBUB5iSz-8byZ-b-KpCdA@mail.gmail.com> |
On Fri, 3 Jul 2026 03:42:01 +0200, Cosmo Chou <[email protected]> said: > The pca9532_gpio_set_value() function incorrectly mapped the requested > value to PCA9532_ON and PCA9532_OFF, inverting the GPIO output polarity. > A requested logical high (val=1) incorrectly enabled the LED output > driver, which on this open-drain device pulls the pin low, while a > requested logical low (val=0) released the pin. > > Correct the mapping so that val=1 yields PCA9532_OFF (pin released / > high-impedance) and val=0 yields PCA9532_ON (pin driven low). > > pca9532_gpio_direction_input() is also updated to pass val=1 to > pca9532_gpio_set_value() to align with the corrected polarity mapping, > ensuring the pin remains not driven when configured as an input. > > Fixes: 3c1ab50d0a31 ("drivers/leds/leds-pca9532.c: add gpio capability") > Signed-off-by: Cosmo Chou <[email protected]> > --- Reviewed-by: Bartosz Golaszewski <[email protected]>