diff options
author | Thomas Petazzoni <thomas.petazzoni@bootlin.com> | 2019-02-07 17:28:58 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2019-02-13 09:10:14 +0100 |
commit | d449991c4d1d0663b42db7648510a9911de21298 (patch) | |
tree | 3506a0caec0f680a87edf2404ab5f79cd6a40ff6 /include/linux/gpio | |
parent | 6581eaf0e890756e093e2f44916edb5e7e6558ca (diff) |
gpio: add core support for pull-up/pull-down configuration
This commit adds support for configuring the pull-up and pull-down
resistors available in some GPIO controllers. While configuring
pull-up/pull-down is already possible through the pinctrl subsystem,
some GPIO controllers, especially simple ones such as GPIO expanders
on I2C, don't have any pinmuxing capability and therefore do not use
the pinctrl subsystem.
This commit implements the GPIO_PULL_UP and GPIO_PULL_DOWN flags,
which can be used from the Device Tree, to enable a pull-up or
pull-down resistor on a given GPIO.
The flag is simply propagated all the way to the core GPIO subsystem,
where it is used to call the gpio_chip ->set_config callback with the
appropriate existing PIN_CONFIG_BIAS_* values.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'include/linux/gpio')
-rw-r--r-- | include/linux/gpio/machine.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/gpio/machine.h b/include/linux/gpio/machine.h index daa44eac9241..69673be10213 100644 --- a/include/linux/gpio/machine.h +++ b/include/linux/gpio/machine.h @@ -12,6 +12,8 @@ enum gpio_lookup_flags { GPIO_OPEN_SOURCE = (1 << 2), GPIO_PERSISTENT = (0 << 3), GPIO_TRANSITORY = (1 << 3), + GPIO_PULL_UP = (1 << 4), + GPIO_PULL_DOWN = (1 << 5), }; /** |