Depending on the controller you write the driver for, you may need to implement some 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 a struct 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 chapter
- struct irq_chip, discussed in the next chapter (Chapter 16, Advanced IRQ Management)
- struct pinctrl_desc, not discussed in the book, but well...