Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: pl061: implement .get_direction()

Implement this callback so that the driver reports correctly
the direction setting of each line.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

+8
+8
drivers/gpio/gpio-pl061.c
··· 61 61 #endif 62 62 }; 63 63 64 + static int pl061_get_direction(struct gpio_chip *gc, unsigned offset) 65 + { 66 + struct pl061_gpio *chip = gpiochip_get_data(gc); 67 + 68 + return !(readb(chip->base + GPIODIR) & BIT(offset)); 69 + } 70 + 64 71 static int pl061_direction_input(struct gpio_chip *gc, unsigned offset) 65 72 { 66 73 struct pl061_gpio *chip = gpiochip_get_data(gc); ··· 322 315 chip->gc.free = gpiochip_generic_free; 323 316 } 324 317 318 + chip->gc.get_direction = pl061_get_direction; 325 319 chip->gc.direction_input = pl061_direction_input; 326 320 chip->gc.direction_output = pl061_direction_output; 327 321 chip->gc.get = pl061_get_value;