From: Domenico Andreoli <[email protected]> This new field allows easy creation of GPIO chips in base of struct arrays.
Signed-off-by: Domenico Andreoli <[email protected]> --- drivers/of/gpio.c | 3 +++ include/asm-generic/gpio.h | 1 + 2 files changed, 4 insertions(+) Index: b/drivers/of/gpio.c =================================================================== --- a/drivers/of/gpio.c 2011-04-07 18:19:20.000000000 +0200 +++ b/drivers/of/gpio.c 2011-04-07 18:20:31.000000000 +0200 @@ -212,6 +212,9 @@ void of_gpiochip_add(struct gpio_chip *chip) { + if ((!chip->of_node) && (chip->dt_compat)) + chip->of_node = of_find_compatible_node(NULL, NULL, chip->dt_compat); + if ((!chip->of_node) && (chip->dev)) chip->of_node = chip->dev->of_node; Index: b/include/asm-generic/gpio.h =================================================================== --- a/include/asm-generic/gpio.h 2011-04-07 18:19:20.000000000 +0200 +++ b/include/asm-generic/gpio.h 2011-04-07 18:19:30.000000000 +0200 @@ -129,6 +129,7 @@ int of_gpio_n_cells; int (*of_xlate)(struct gpio_chip *gc, struct device_node *np, const void *gpio_spec, u32 *flags); + const char *dt_compat; #endif }; _______________________________________________ devicetree-discuss mailing list [email protected] https://lists.ozlabs.org/listinfo/devicetree-discuss
