On Tue, Jun 18, 2019 at 6:02 PM Michael Walle <michael@xxxxxxxx> wrote: > I'd like to disuss adding a generic gpio-syscon (eg. compatible = > "gpio-syscon"). At the moment, if you have a board which could use the > gpio-syscon out-of-the-box, you still have to submit a patch to add > support to the gpio-syscon driver. Wouldn't it be easier to let the > user/board manufacturer configure the parameters through the dtb? I don't know about that. I have written a binding: Documentation/devicetree/bindings/leds/register-bit-led.txt which does something like this. So then I would say be inspired by that. It kind of depends on how complex the hardware really is. If this is "just" a register in the syscon then I guess yes. And then I mean ONE register. One register only, e.g. an output-only thing. If it is supposed to hide an actually more complex hardware with separate input and output registers and direction setting I'm not so happy with it. Compare to drivers/gpio/gpio-mmio.c that rather takes the idea of Linux supporting several simpler GPIO controllers by using several compatible strings. For anything that is a complex enough piece of hardware, that should have its own compatible string. > gpio0 { > compatible = "gpio-syscon"; > syscon = <&syscon>; > gpio-controller; (...) > offsets = <0 0 1>; I don't understand this... > io-width = <4>; In bytes? > mask = <0x0000ffff>; Isn't this synonymous to using the standard "ngpios" property, indexed from 0? Linus Walleij