diff options
author | Wolfram Sang <wsa@the-dreams.de> | 2017-11-01 18:44:52 -0400 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2017-11-01 18:45:46 -0400 |
commit | 4ee045f4e9b73c4635ceedbb1ee40e0b3ecbdbcc (patch) | |
tree | f75e20907a3dc01e780ca75b1696f7d30c179944 /drivers/gpio | |
parent | 93367bfca98f36cece57c01dbce6ea1b4ac58245 (diff) | |
parent | 05c74778858d7d9907d607172fcc9646b70b6364 (diff) |
Merge branch 'for-wolfram' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio into i2c/for-4.15
Refactor i2c-gpio and its users to use gpiod. Done by GPIO maintainer
LinusW.
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpiolib.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index eb80dac4e26a..c952ef1b2f46 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -3264,8 +3264,21 @@ int gpiod_configure_flags(struct gpio_desc *desc, const char *con_id, | |||
3264 | 3264 | ||
3265 | if (lflags & GPIO_ACTIVE_LOW) | 3265 | if (lflags & GPIO_ACTIVE_LOW) |
3266 | set_bit(FLAG_ACTIVE_LOW, &desc->flags); | 3266 | set_bit(FLAG_ACTIVE_LOW, &desc->flags); |
3267 | |||
3267 | if (lflags & GPIO_OPEN_DRAIN) | 3268 | if (lflags & GPIO_OPEN_DRAIN) |
3268 | set_bit(FLAG_OPEN_DRAIN, &desc->flags); | 3269 | set_bit(FLAG_OPEN_DRAIN, &desc->flags); |
3270 | else if (dflags & GPIOD_FLAGS_BIT_OPEN_DRAIN) { | ||
3271 | /* | ||
3272 | * This enforces open drain mode from the consumer side. | ||
3273 | * This is necessary for some busses like I2C, but the lookup | ||
3274 | * should *REALLY* have specified them as open drain in the | ||
3275 | * first place, so print a little warning here. | ||
3276 | */ | ||
3277 | set_bit(FLAG_OPEN_DRAIN, &desc->flags); | ||
3278 | gpiod_warn(desc, | ||
3279 | "enforced open drain please flag it properly in DT/ACPI DSDT/board file\n"); | ||
3280 | } | ||
3281 | |||
3269 | if (lflags & GPIO_OPEN_SOURCE) | 3282 | if (lflags & GPIO_OPEN_SOURCE) |
3270 | set_bit(FLAG_OPEN_SOURCE, &desc->flags); | 3283 | set_bit(FLAG_OPEN_SOURCE, &desc->flags); |
3271 | if (lflags & GPIO_SLEEP_MAY_LOOSE_VALUE) | 3284 | if (lflags & GPIO_SLEEP_MAY_LOOSE_VALUE) |