[PATCH] powerpc/mpc8xxx_gpio.c: extend the driver to support mpc512x gpios
Grant Likely
grant.likely at secretlab.ca
Sun Aug 8 02:58:21 EST 2010
On Sat, Aug 7, 2010 at 10:39 AM, Anatolij Gustschin <agust at denx.de> wrote:
> Grant Likely <grant.likely at secretlab.ca> wrote:
>> > @@ -226,6 +272,9 @@ static struct irq_chip mpc8xxx_irq_chip = {
>> > static int mpc8xxx_gpio_irq_map(struct irq_host *h, unsigned int virq,
>> > irq_hw_number_t hw)
>> > {
>> > + if (of_device_is_compatible(h->of_node, "fsl,mpc5121-gpio"))
>> > + mpc8xxx_irq_chip.set_type = mpc512x_irq_set_type;
>> > +
>>
>> You can put the set type hook into the of_match_table data which you
>> will need for of_find_matching_node() (see below).
>
> How can I get this match table data reference in mpc8xxx_gpio_irq_map() ?
of_match_node() will return the matching entry in the table.
> Is it okay to set data field of struct device_node to the set type
> hook? I could do it in mpc8xxx_add_gpiochips() but I'm not sure whether
> the data field will be used for other purposes somewhere else.
You are safe to use the .data field.
g.
More information about the Linuxppc-dev
mailing list