[PATCH] backlight: corgi: Fix gpio numbers for backlight controls

Linus Walleij linus.walleij at linaro.org
Sun Jun 26 16:51:20 PDT 2022


On Fri, Jun 17, 2022 at 11:21 PM Laurence de Bruxelles
<lfdebrux at gmail.com> wrote:

> With recent stable kernels on my Zaurus Akita I am unable to change the
> backlight brightness, as the necessary files are not in the sys
> filesystem, and at startup I get the following errors:
>
> corgi-lcd spi2.1: requested GPIO 0 (207) is out of range [0..120] for
> chip gpio-pxa
> corgi-lcd: probe of spi2.1 failed with error -22
>
> Looking at recent changes to the Corgi backlight driver, I found that
> commit ee0c8e494cc3 ("backlight: corgi: Convert to use GPIO
> descriptors") replaced the use of the deprecated integer-based GPIO
> interface, but didn't convert the GPIO numbers in the platform header
> to match this. I think this is what causes the error, as the GPIOs for
> the backlight are part of an expander chip with a GPIO base number
> larger than the number of GPIOs for the gpio-pxa device.
>
> This patch fixes things by updating the GPIO numbers for the backlight,
> simply by dropping the GPIO base. It also updates the GPIO lookups to
> look in the table for the appropriate expander. For the Akita platform
> the expander with i2c address 0-0018 is used, for Spitz and Borzoi
> the second Sharp SCOOP expander is used.
>
> I've tested this patch with real Akita and Spitz handhelds, as well as
> with QEMU.
>
> Signed-off-by: Laurence de Bruxelles <lfdebrux at gmail.com>
> Fixes: ee0c8e494cc3 ("backlight: corgi: Convert to use GPIO descriptors")

Looks correct, my mistakes (nothing to test on, that's why...)
Thanks a lot for fixing this!
Reviewed-by: Linus Walleij <linus.walleij at linaro.org>

I would just send the patch directly to the SoC tree for fixes.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list