diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2016-02-16 15:41:42 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-02-16 15:41:42 +0100 |
commit | 143b65d677a59764e438d457bf2510b3fa5b90f8 (patch) | |
tree | 586c063e5cf8960fe39b481436a26f961f7fb44f /include/linux/gpio | |
parent | d6f434e8585ac5e4256d894819bf76d02bc2ed3c (diff) | |
download | lwn-143b65d677a59764e438d457bf2510b3fa5b90f8.tar.gz lwn-143b65d677a59764e438d457bf2510b3fa5b90f8.zip |
gpio: create an API to detect open drain/source on lines
My left hand merges code to privatize the descriptor handling
while my right hand merges drivers that poke around and
disrespect with the same gpiolib internals.
So let's expose the proper APIs for drivers to ask the gpiolib
core if a line is marked as open drain or open source and
get some order around things so this driver compiles again.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Nicolas Saenz Julienne <nicolassaenzj@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'include/linux/gpio')
-rw-r--r-- | include/linux/gpio/driver.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index b92ab9efdb69..ff96d0f9fceb 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -199,6 +199,10 @@ int gpiochip_lock_as_irq(struct gpio_chip *chip, unsigned int offset); void gpiochip_unlock_as_irq(struct gpio_chip *chip, unsigned int offset); bool gpiochip_line_is_irq(struct gpio_chip *chip, unsigned int offset); +/* Line status inquiry for drivers */ +bool gpiochip_line_is_open_drain(struct gpio_chip *chip, unsigned int offset); +bool gpiochip_line_is_open_source(struct gpio_chip *chip, unsigned int offset); + /* get driver data */ void *gpiochip_get_data(struct gpio_chip *chip); |