mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
gpio: mockup: fix indicated direction
[ Upstream commit bff466bac59994cfcceabe4d0be5fdc1c20cd5b8 ] Commit 3edfb7bd76bd ("gpiolib: Show correct direction from the beginning") fixed an existing issue but broke libgpiod tests by changing the default direction of dummy lines to output. We don't break user-space so make gpio-mockup behave as before. Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
934f4965b4
commit
6c65ce9201
@ -35,8 +35,8 @@
|
||||
#define GPIO_MOCKUP_MAX_RANGES (GPIO_MOCKUP_MAX_GC * 2)
|
||||
|
||||
enum {
|
||||
GPIO_MOCKUP_DIR_OUT = 0,
|
||||
GPIO_MOCKUP_DIR_IN = 1,
|
||||
GPIO_MOCKUP_DIR_IN = 0,
|
||||
GPIO_MOCKUP_DIR_OUT = 1,
|
||||
};
|
||||
|
||||
/*
|
||||
@ -112,7 +112,7 @@ static int gpio_mockup_get_direction(struct gpio_chip *gc, unsigned int offset)
|
||||
{
|
||||
struct gpio_mockup_chip *chip = gpiochip_get_data(gc);
|
||||
|
||||
return chip->lines[offset].dir;
|
||||
return !chip->lines[offset].dir;
|
||||
}
|
||||
|
||||
static int gpio_mockup_name_lines(struct device *dev,
|
||||
|
Loading…
x
Reference in New Issue
Block a user