Skip to content
Commit 0cc59b9d authored by Milo Kim's avatar Milo Kim Committed by Lee Jones
Browse files

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: default avatarMilo Kim <milo.kim@ti.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 25a7a6f4
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment