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

Configure Feed

Select the types of activity you want to include in your feed.

gpiolib: provide gpio_device_get_base()

Let's start adding getters for the opaque struct gpio_device. Start with
a function allowing to retrieve the base GPIO number.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>

+16
+13
drivers/gpio/gpiolib.c
··· 242 242 EXPORT_SYMBOL_GPL(gpiod_to_gpio_device); 243 243 244 244 /** 245 + * gpio_device_get_base() - Get the base GPIO number allocated by this device 246 + * @gdev: GPIO device 247 + * 248 + * Returns: 249 + * First GPIO number in the global GPIO numberspace for this device. 250 + */ 251 + int gpio_device_get_base(struct gpio_device *gdev) 252 + { 253 + return gdev->base; 254 + } 255 + EXPORT_SYMBOL_GPL(gpio_device_get_base); 256 + 257 + /** 245 258 * gpio_device_get_chip() - Get the gpio_chip implementation of this GPIO device 246 259 * @gdev: GPIO device 247 260 *
+3
include/linux/gpio/driver.h
··· 787 787 struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc); 788 788 struct gpio_device *gpiod_to_gpio_device(struct gpio_desc *desc); 789 789 790 + /* struct gpio_device getters */ 791 + int gpio_device_get_base(struct gpio_device *gdev); 792 + 790 793 #else /* CONFIG_GPIOLIB */ 791 794 792 795 #include <linux/err.h>