Adding new function to existing driver ops

Asha R rd.asha22 at gmail.com
Fri Jul 8 05:25:58 EDT 2011


Hi,

I would like to know how to add new function to a driver in Linux Framework?

For eg: In GPIO driver, there is gpio_chip structure defined.

static struct gpio_chip mygpio_chip = {
        .label                         = "mygpio",
        .owner                        = THIS_MODULE,
        .direction_input           = mygpio_direction_input,
        .get                            = mygpio_get,
        .direction_output         = mygpio_direction_output,
        .set                            = mygpio_set,
        .to_irq                        = mygpio_to_irq,
};
If i want to add *mygpio_pulldown* or *mygpio_altfunc* to support few more
gpio functionalities, how and where can i add these functions in the
structure?

Any suggestions on this will be appreciated.

Thanks in advance,
Asha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110708/40b51c94/attachment.html 


More information about the Kernelnewbies mailing list