Commit 7b479a84 authored by Kent Gibson's avatar Kent Gibson Committed by Bartosz Golaszewski
Browse files

gpiolib: add support for pull up/down to lineevent_create



Add support for pull up/down to lineevent_create.
Use cases include receiving asynchronous presses from a
push button without an external pull up/down.

Signed-off-by: default avatarKent Gibson <warthog618@gmail.com>
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
parent 9225d516
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -951,6 +951,10 @@ static int lineevent_create(struct gpio_device *gdev, void __user *ip)


	if (lflags & GPIOHANDLE_REQUEST_ACTIVE_LOW)
	if (lflags & GPIOHANDLE_REQUEST_ACTIVE_LOW)
		set_bit(FLAG_ACTIVE_LOW, &desc->flags);
		set_bit(FLAG_ACTIVE_LOW, &desc->flags);
	if (lflags & GPIOHANDLE_REQUEST_BIAS_PULL_DOWN)
		set_bit(FLAG_PULL_DOWN, &desc->flags);
	if (lflags & GPIOHANDLE_REQUEST_BIAS_PULL_UP)
		set_bit(FLAG_PULL_UP, &desc->flags);


	ret = gpiod_direction_input(desc);
	ret = gpiod_direction_input(desc);
	if (ret)
	if (ret)