[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
port-evbarm/52574: awingpio(4) pin enumeration is broken
>Synopsis: awingpio(4) pin enumeration is broken
>Arrival-Date: Wed Sep 27 13:05:00 +0000 2017
>Originator: Tobias Nygren
In awin_gpio_config_pins(), any pins that are marked as in use by device drivers are skipped and not registered with the gpio subsystem.
The code allocates pins sequentially. So for example if pin 10 is in use, the logical and physical pin numbers are off by one from pin 10 and upwards.
But the handlers for GPIO read/write ioctls interpret the pin number argument as a physical pin, not a logical pin.
This makes it impossible to access upper GPIO pins (ioctl returns EINVAL because it thinks the pin number is too large).
Option 1: all pins should be registered with the gpio subsystem but accessing inuse pins should return EBUSY.
Option 2: read/write ioctls need to perform a logical-to-physical translation of pin numbers.
I'm not sure which option is the best.
Main Index |
Thread Index |