diff options
| author | Matti Vaittinen <mazziesaccount@gmail.com> | 2025-03-05 16:13:00 +0300 |
|---|---|---|
| committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2025-03-05 16:36:04 +0300 |
| commit | f636d4f60ac477187a466a573f947731fa762059 (patch) | |
| tree | 6c46162efdca8688a6e0a18b6c87a630949dfa8d /include/linux/gpio | |
| parent | a501624864f3fd9ab785f1f674f48dca535b198c (diff) | |
| download | linux-f636d4f60ac477187a466a573f947731fa762059.tar.xz | |
gpio: Add a valid_mask getter
The valid_mask member of the struct gpio_chip is unconditionally written
by the GPIO core at driver registration. It shouldn't be directly
populated by drivers. This can be prevented by moving it from the struct
gpio_chip to struct gpio_device, which is internal to the GPIO core.
As a preparatory step, provide a getter function which can be used by
those drivers which need the valid_mask information.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/026f9d78502eca883bfe3faeb684e23d5d6c5e84.1741180097.git.mazziesaccount@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to 'include/linux/gpio')
| -rw-r--r-- | include/linux/gpio/driver.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 83e0a7e86962..e3b59fda62e0 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -720,6 +720,7 @@ bool gpiochip_line_is_open_source(struct gpio_chip *gc, unsigned int offset); /* Sleep persistence inquiry for drivers */ bool gpiochip_line_is_persistent(struct gpio_chip *gc, unsigned int offset); bool gpiochip_line_is_valid(const struct gpio_chip *gc, unsigned int offset); +const unsigned long *gpiochip_query_valid_mask(const struct gpio_chip *gc); /* get driver data */ void *gpiochip_get_data(struct gpio_chip *gc); |
