]> git.karo-electronics.de Git - karo-tx-linux.git/commit
gpio: add LP3943 I2C GPIO expander driver
authorMilo Kim <milo.kim@ti.com>
Fri, 6 Dec 2013 02:18:42 +0000 (11:18 +0900)
committerLee Jones <lee.jones@linaro.org>
Fri, 6 Dec 2013 16:09:21 +0000 (16:09 +0000)
commita4cb691b22056221f11950f81466cd17431b3eb3
tree74e5ce01dd4d6b475ef59ceabf506f7030597b8c
parent4661a151a882d8c2024a20fd17c3eef0ececaa2b
gpio: add LP3943 I2C GPIO expander driver

This is one of LP3943 MFD driver.
LP3943 is configurable as a GPIO expander, up to 16 GPIOs.

* Application note: how to configure LP3943 as a GPIO expander
  http://www.ti.com/lit/an/snva287a/snva287a.pdf

* Supported GPIO controller operations
  request, free, direction_input, direction_output, get and set

* GPIO direction register not supported
  LP3943 doesn't have the GPIO direction register. It only provides input and
  output status registers.
  So, private data for the direction should be handled manually.
  This variable is updated whenever the direction is changed and
  used in 'get' operation.

* Pin assignment
  A driver data, 'pin_used' is checked when a GPIO is requested.
  If the GPIO is already assigned, then returns as failure.
  If the GPIO is available, 'pin_used' is set.
  When the GPIO is not used anymore, then it is cleared.
  It is defined as unsigned long type for atomic bit operation APIs,
  but only LSB 16bits are used because LP3943 has 16 outputs.

Signed-off-by: Milo Kim <milo.kim@ti.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/gpio/Kconfig
drivers/gpio/Makefile
drivers/gpio/gpio-lp3943.c [new file with mode: 0644]