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

gpio: ich: Implement get_direction function

Allow the kernel to query the driver for a GPIO's pin direction.

Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Aaron Sierra and committed by
Linus Walleij
62e08f25 afeb7b45

+6
+6
drivers/gpio/gpio-ich.c
··· 173 173 return !!(ichx_priv.use_gpio & (1 << (nr / 32))); 174 174 } 175 175 176 + static int ichx_gpio_get_direction(struct gpio_chip *gpio, unsigned nr) 177 + { 178 + return ichx_read_bit(GPIO_IO_SEL, nr) ? GPIOF_DIR_IN : GPIOF_DIR_OUT; 179 + } 180 + 176 181 static int ichx_gpio_direction_input(struct gpio_chip *gpio, unsigned nr) 177 182 { 178 183 /* ··· 291 286 ichx_priv.desc->get : ichx_gpio_get; 292 287 293 288 chip->set = ichx_gpio_set; 289 + chip->get_direction = ichx_gpio_get_direction; 294 290 chip->direction_input = ichx_gpio_direction_input; 295 291 chip->direction_output = ichx_gpio_direction_output; 296 292 chip->base = modparam_gpiobase;