]> git.ipfire.org Git - thirdparty/linux.git/commit
gpio: generic: add new generic GPIO chip API
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 2 Jul 2025 09:22:08 +0000 (11:22 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 7 Jul 2025 07:43:52 +0000 (09:43 +0200)
commit8595375e4fded27de24b189c692c2c50051a7b3b
treea90b775d9fe6f61a6ad8789f418308dfc645aef3
parent179a666951d315bd6b47e3016df772956f71231b
gpio: generic: add new generic GPIO chip API

As the first step in removing the fields specific to the gpio-mmio
module from struct gpio_chip, we introduce a new set of generic GPIO
chip interfaces that are meant to replace the existing bgpio_ ones.

The new initialization function - gpio_generic_chip_init() - takes a
configuration structure as argument instead of 9 separate parameters.
This will allow easy extension if needed in the future. We hide the
locking details behind a set of helpers in order to be able to move the
raw spinlock out of struct gpio_chip without the users noticing.

For now, the new APIs just wrap the existing ones. Once all users have
been converted to the new interfaces, we'll pull them into gpio-mmio and
implement them in a backward-compatible way while also moving all fields
specific to the generic GPIO chip into struct gpio_generic_chip.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250702-gpio-mmio-rework-v2-1-6b77aab684d8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
include/linux/gpio/generic.h [new file with mode: 0644]