On Fri, May 12, 2017 at 5:31 PM, Yves Lefloch <YvesMarie_Lefloch@xxxxxxxxxxxxxxxx> wrote: > On 05/11/2017 05:22 PM, Linus Walleij wrote: >> Implement everything you have a data sheet for even if you >> do not use it right now. It is good to have. > > Do you mean that I should submit a driver for every single device > before I can declare its pins in the DT? That will surely take > quite a long time, and I'm required to get GPIO functionality before > that. I mean that when you write a GPIO driver, i.e. ONE driver for ONE GPIO controlling hardware, you should implement all the functionality for THAT GPIO block. > Furthermore, even if I had a driver for a device whose pins can also > be GPIOs, say smartcard. If the driver is built as a module, and has > not been yet loaded in, then, since you want the pinctrl node has a > child node, no gpiochip struct could have been registered, and the pins > can't be used as GPIOs. > Does this mean that to use the smartcard's pin as GPIOs, the smartcard > driver must absolutely be loaded, even though smartcards are never used? I do not understand this remark. If the GPIOs are provided by the smartcard IP block inside your chip, yes then it makes sense to spawn the GPIO driver as part of the smartcard driver. Usually the GPIO hardware is a separate IP block from any others (such as smartcard) so this situation seldom occurs. Is you system such that there is an IO range for something like a smart card, and then that IO range also contains registers for reusing some or all pins as GPIO? Then yes, we usually write a driver for this whole IP block and let it expose a gpiochip as part of its main function. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html