On Thu, Oct 22, 2015 at 10:32:24AM +0200, Linus Walleij wrote: > OK so this is it, I had no patience waiting for users to come up > with this new ABI, and the requests for a way for userspace to > use GPIOs properly is coming up again and again. So I created the > basics for it, so we can then build on top of this to get things > right. I want to get these very first things right before we go > wild with setting/getting pin values etc. > > We add ONE ioctl() to get information on the gpiochip. Now we can > do this (example from ux500): > > root@Ux500:/ lsgpio > GPIO chip: a03fe000.gpio, 32 GPIO lines > GPIO chip: 8011e080.gpio, 32 GPIO lines > GPIO chip: 8011e000.gpio, 32 GPIO lines > GPIO chip: 8000e180.gpio, 32 GPIO lines > GPIO chip: 8000e100.gpio, 32 GPIO lines > GPIO chip: 8000e080.gpio, 32 GPIO lines > GPIO chip: 8000e000.gpio, 32 GPIO lines > GPIO chip: 8012e080.gpio, 32 GPIO lines > GPIO chip: 8012e000.gpio, 32 GPIO lines > GPIO chip: abx500-gpio, 42 GPIO lines > GPIO chip: tc3589x, 20 GPIO lines What happens if we have two I2C gpio expanders with the same I2C addresses connected to different I2C busses? If I see this correctly they would both show up with the same name. Is there an easy and race-free way to see which GPIO chip is connected to which I2C bus? Best Regards, Markus > > Johan: I don't have a hot-pluggable GPIO controller :( can you > do me the favour of testing this and fixing my stupid refcounts > and race conditions? I only used my brain to try to get things > right with pluggable GPIO controllers in this patch set, and it > is bound to fail. > > How to identify and manipulate individual GPIO lines from this > ABI is a *LATER* *QUESTION*, this is the bare essentials for > getting there: basic operations on the gpiochip device level. > > Linus Walleij (6): > gpio: make the gpiochip a real device > gpio: refer to gpio device in prints and debugfs > gpio: add a userspace chardev ABI for GPIOs > tools/gpio: create GPIO tools > gpio: add a userspace character device ABI > gpio: ABI: mark the sysfs ABI as obsolete > > Documentation/ABI/obsolete/sysfs-gpio | 30 ++++++ > Documentation/ABI/testing/gpio-cdev | 26 +++++ > Documentation/ABI/testing/sysfs-gpio | 28 ----- > MAINTAINERS | 4 + > drivers/gpio/gpiolib-sysfs.c | 2 +- > drivers/gpio/gpiolib.c | 193 +++++++++++++++++++++++++++++++--- > drivers/gpio/gpiolib.h | 12 +-- > include/linux/gpio/driver.h | 11 +- > include/uapi/linux/Kbuild | 1 + > include/uapi/linux/gpio.h | 28 +++++ > tools/Makefile | 7 +- > tools/gpio/Makefile | 12 +++ > tools/gpio/gpio-utils.c | 11 ++ > tools/gpio/gpio-utils.h | 25 +++++ > tools/gpio/lsgpio.c | 128 ++++++++++++++++++++++ > 15 files changed, 462 insertions(+), 56 deletions(-) > create mode 100644 Documentation/ABI/obsolete/sysfs-gpio > create mode 100644 Documentation/ABI/testing/gpio-cdev > delete mode 100644 Documentation/ABI/testing/sysfs-gpio > create mode 100644 include/uapi/linux/gpio.h > create mode 100644 tools/gpio/Makefile > create mode 100644 tools/gpio/gpio-utils.c > create mode 100644 tools/gpio/gpio-utils.h > create mode 100644 tools/gpio/lsgpio.c > > -- > 2.4.3 > > -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Attachment:
signature.asc
Description: PGP signature