diff options
| author | Samuel Holland <[email protected]> | 2024-11-11 14:02:49 -0800 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2024-11-28 17:29:12 +0530 |
| commit | bef8f9b8068c6e5e0bb706f90eee30674910a47f (patch) | |
| tree | 2d02342743f792030c7ebd5de51238a952c9156f /include | |
| parent | 10df2d6fb5dba486a74cb47bbc062f3383bba80d (diff) | |
lib: utils/gpio: Use fdt_driver for initialization
FDT gpio drivers have an extra .xlate operation, so they need to embed
the `struct fdt_driver` inside the subsystem-specific type. The gpio
subsystem always initializes the driver for a specific DT node.
Signed-off-by: Samuel Holland <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/sbi_utils/gpio/fdt_gpio.h | 5 | ||||
| -rw-r--r-- | include/sbi_utils/gpio/gpio.h | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/include/sbi_utils/gpio/fdt_gpio.h b/include/sbi_utils/gpio/fdt_gpio.h index ab9304bf..fde667e0 100644 --- a/include/sbi_utils/gpio/fdt_gpio.h +++ b/include/sbi_utils/gpio/fdt_gpio.h @@ -10,18 +10,17 @@ #ifndef __FDT_GPIO_H__ #define __FDT_GPIO_H__ +#include <sbi_utils/fdt/fdt_driver.h> #include <sbi_utils/gpio/gpio.h> struct fdt_phandle_args; /** FDT based GPIO driver */ struct fdt_gpio { - const struct fdt_match *match_table; + struct fdt_driver driver; int (*xlate)(struct gpio_chip *chip, const struct fdt_phandle_args *pargs, struct gpio_pin *out_pin); - int (*init)(const void *fdt, int nodeoff, - const struct fdt_match *match); }; /** Get a GPIO pin using "gpios" DT property of client DT node */ diff --git a/include/sbi_utils/gpio/gpio.h b/include/sbi_utils/gpio/gpio.h index 7a3d8bbe..7027fd19 100644 --- a/include/sbi_utils/gpio/gpio.h +++ b/include/sbi_utils/gpio/gpio.h @@ -40,7 +40,7 @@ struct gpio_pin { /** Representation of a GPIO chip */ struct gpio_chip { /** Pointer to GPIO driver owning this GPIO chip */ - void *driver; + const void *driver; /** Uniquie ID of the GPIO chip assigned by the driver */ unsigned int id; /** Number of GPIOs supported by the GPIO chip */ |
