Re: am335x gpiochip numbering changed after 5.10

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 8, 2022 at 5:12 PM Andy Shevchenko
<andy.shevchenko@xxxxxxxxx> wrote:
>
> On Mon, Aug 8, 2022 at 1:41 PM Johannes Pointner <h4nn35.work@xxxxxxxxx> wrote:
> >
> > Hello,
> >
> > I just tried to upgrade a am335x based board from 5.10 LTS to 5.15 LTS
> > and this broke an application for me because the gpiochip numbering
> > changed:
>
> Don't we have somewhere in the documentation that the GPIO chip device

s/device//

The GPIO chip device name is something different to what you see in
the below dumps.

> name should be nothing except name. It seems to me you are relying on
> the name to be part of ABI, but it's not. The ABI is the real device
> behind no matter what name the associated character device has. To
> prevent objection, it's the same as for network cards (old) naming
> scheme when eth0 and eth1 can be swapped at boot time.
>
> > <= 5.10:
> > gpio0 == gpiochip0
> > gpio1 == gpiochip32
> > gpio2 == gpiochip64
> > gpio3 == gpiochip96
> >
> > > 5.10
> > gpio0 == gpiochip96
> > gpio1 == gpiochip0
> > gpio2 == gpiochip32
> > gpio3 == gpiochip64
> >
> > This is the same for /dev/gpiochipX
>
> Sure.
>
> ...
>
> > Did I configure something wrong or do I have to adjust the devicetree
> > for the board somehow?
>
> No, you have to write the application based on `libgpiod` or so with
> proper handling of the GPIO chips. Note, that if you run `gpiodetect`
> you will see the device instance names for your GPIO chips (IIRC it's
> called 'label' in the Linux kernel inside APIs) which should be unique
> and that is what your application should rely on.

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux