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

gpio: twl6040: Implement .get_direction()

The gpiolib cannot deduce the fact that every line is output
by itself, implement a .get_direction() callback so we can
inspect this.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

+7
+7
drivers/gpio/gpio-twl6040.c
··· 32 32 return !!(ret & BIT(offset)); 33 33 } 34 34 35 + static int twl6040gpo_get_direction(struct gpio_chip *chip, unsigned offset) 36 + { 37 + /* This means "out" */ 38 + return 0; 39 + } 40 + 35 41 static int twl6040gpo_direction_out(struct gpio_chip *chip, unsigned offset, 36 42 int value) 37 43 { ··· 68 62 .owner = THIS_MODULE, 69 63 .get = twl6040gpo_get, 70 64 .direction_output = twl6040gpo_direction_out, 65 + .get_direction = twl6040gpo_get_direction, 71 66 .set = twl6040gpo_set, 72 67 .can_sleep = true, 73 68 };