[PATCH] ARM: pxa: spitz: Fix GPIO dev_name for SPI devices

Arnd Bergmann arnd at arndb.de
Fri Jul 22 02:11:03 PDT 2022


On Thu, Jul 21, 2022 at 11:06 PM Laurence de Bruxelles
<lfdebrux at gmail.com> wrote:
>
> Kernel >5.18 on Zaurus has a bug where the power management code can't
> talk to devices, emitting the following errors:
>
> sharpsl-pm sharpsl-pm: Error: AC check failed: voltage -22.
> sharpsl-pm sharpsl-pm: Charging Error!
> sharpsl-pm sharpsl-pm: Warning: Cannot read main battery!
>
> Looking at the recent changes, I found that commit 31455bbda208 ("spi:
> pxa2xx_spi: Convert to use GPIO descriptors") replaced the deprecated
> SPI chip select platform device code with a gpiod lookup table. However,
> this didn't seem to work until I changed the `dev_id` member from the
> device name to the bus id. I'm not entirely sure why this is necessary,
> but I suspect it is related to the fact that in sysfs SPI devices are
> attached under /sys/devices/.../dev_name/spi_master/spiB/spiB.C, rather
> than directly to the device.
>
> One thing I'm not clear on is whether the same change needs to be made
> to other PXA devices. The previous commit affected 10 devices, this
> commit only fixes one, but I only have hardware for that one, so
> possibly other hardware is different.
>
> Fixes: 31455bbda208 ("spi: pxa2xx_spi: Convert to use GPIO descriptors")

I think all the previous conversions were done blindly, so it's most likely that
everything needs the same change.

Linus, can you have a look at this? I don't understand where the name is
supposed to come from, and importantly what the best fix is. I assume we
can address this either by changing all the board files to use the correct
dev_id, or by changing the gpio drivers to change the ID of the gpio
controller to be what we expected it to be.

         Arnd



More information about the linux-arm-kernel mailing list