From bef8f9b8068c6e5e0bb706f90eee30674910a47f Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Mon, 11 Nov 2024 14:02:49 -0800 Subject: 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 Reviewed-by: Anup Patel --- include/sbi_utils/gpio/fdt_gpio.h | 5 ++--- include/sbi_utils/gpio/gpio.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'include') 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 #include 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 */ -- cgit v1.3.1