[PATCH 3/4] of/gpio: Implement GPIOLIB notifier hooks

Grant Likely grant.likely at secretlab.ca
Wed Feb 10 04:13:11 EST 2010


On Fri, Feb 5, 2010 at 1:32 PM, Anton Vorontsov
<avorontsov at ru.mvista.com> wrote:
> This patch implements GPIOLIB notifier hooks, and thus makes device-enabled
> GPIO chips (i.e. the ones that have gpio_chip->dev specified) automatically
> attached to the OpenFirmware subsystem. Which means that now we can handle
> I2C and SPI GPIO chips almost* transparently.
>
> * "Almost" because some chips still require platform data, and for these
>  chips OF-glue is still needed, though with this support the glue will
>  be much smaller.
>
> Signed-off-by: Anton Vorontsov <avorontsov at ru.mvista.com>
> ---
> +static struct notifier_block of_gpio_nb = {
> +       .notifier_call = of_gpio_notify,
> +};
> +
> +static int __init of_gpio_notifier_init(void)
> +{
> +       return blocking_notifier_chain_register(&gpio_notifier, &of_gpio_nb);
> +}
> +arch_initcall(of_gpio_notifier_init);

Another concern;  if any gpio chips get registered before this
arch_initcall (not sure if it is possible or not), then those chips
won't get registered with the of gpio infrastructure.

g.


More information about the Linuxppc-dev mailing list