Hi Patrick! > On 30.11.2017, at 17:44, Patrick Menschel <menschel.p@xxxxxxxxx> wrote: >> How would you try to present that HW-configuration in the >> device tree instead? >> How would it impact the driver design? >> > Hi, > I'm afraid I don't know what is best practice but you may want to look > at the max310x driver which declares it's GPIOs and GPIO based > interrupts in the regular driver. > > drivers/tty/serial/max310x.c > Documentation/devicetree/bindings/serial/maxim,max310x.txt > Look for "#ifdef CONFIG_GPIOLIB”. This is a gpio-controller, for which this is what I would implement. The problem comes more from the fact that the mcp2517fd is primarily a CAN controller, which has a few GPIO pins. So implementing a gpio-controller for those (rarely used) GPIOs in the same driver seems a bit of an overkill. The mcp2515 chip also supports 5 GPIO pins, but the driver does not really make use of them, so they are left out. The problem here is more the fact that the mcp2517fd supports also push-pull/open-drain on some of those gpios. And at least openDrain may be required on TXCan if used on a network without a transceiver… > My first try would be a single dt node like the max310x uses in the dt > example. > Imho it is better to make things useful before making them complicated. The settings as they are now are the “simple” version. implementing a separate GPIO-controller driver just to implement the same logic we have now would make it a much bigger driver without lots of extra benefits. So I hope the current proposal is ok... Martin-- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html