aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpiolib.c13
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)