|
@@ -2869,6 +2869,16 @@ bool gpiochip_line_is_open_source(struct gpio_chip *chip, unsigned int offset)
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(gpiochip_line_is_open_source);
|
|
|
|
|
|
+bool gpiochip_line_is_persistent(struct gpio_chip *chip, unsigned int offset)
|
|
|
+{
|
|
|
+ if (offset >= chip->ngpio)
|
|
|
+ return false;
|
|
|
+
|
|
|
+ return !test_bit(FLAG_SLEEP_MAY_LOOSE_VALUE,
|
|
|
+ &chip->gpiodev->descs[offset].flags);
|
|
|
+}
|
|
|
+EXPORT_SYMBOL_GPL(gpiochip_line_is_persistent);
|
|
|
+
|
|
|
/**
|
|
|
* gpiod_get_raw_value_cansleep() - return a gpio's raw value
|
|
|
* @desc: gpio whose value will be returned
|
|
@@ -3225,6 +3235,8 @@ static int gpiod_configure_flags(struct gpio_desc *desc, const char *con_id,
|
|
|
set_bit(FLAG_OPEN_DRAIN, &desc->flags);
|
|
|
if (lflags & GPIO_OPEN_SOURCE)
|
|
|
set_bit(FLAG_OPEN_SOURCE, &desc->flags);
|
|
|
+ if (lflags & GPIO_SLEEP_MAY_LOOSE_VALUE)
|
|
|
+ set_bit(FLAG_SLEEP_MAY_LOOSE_VALUE, &desc->flags);
|
|
|
|
|
|
/* No particular flag request, return here... */
|
|
|
if (!(dflags & GPIOD_FLAGS_BIT_DIR_SET)) {
|