Pin controller guidelines
Depending on the controller you write the driver for, you may need to implement a pin control operation to handle pin multiplexing, configuration, and so on:
- For a pin controller that can only do simple GPIO, a simple
struct gpio_chip
will be sufficient to handle it. There is no need to set up astruct pinctrl_desc
structure; just write the GPIO controller driver as it. - If the controller can generate interrupts on top of the GPIO functionality, a
struct irq_chip
must be set up and registered to the IRQ subsystem. - For a controller that has pin multiplexing, advanced pin driver strength, and complex biasing, you should set up the following three interfaces :
struct gpio_chip
, discussed earlier in this chapterstruct irq_chip
, discussed in the next chapter (Chapter 16, Advanced IRQ Management)struct pinctrl_desc
, not discussed in the book, but well explained in the kernel documentation inDocumentation/pinctrl.txt