On Thu, Jun 14, 2018 at 4:33 PM, Rob Herring <robh@xxxxxxxxxx> wrote: > On Thu, Jun 14, 2018 at 8:14 AM, Linus Walleij <linus.walleij@xxxxxxxxxx> wrote: >> On Wed, Jun 13, 2018 at 9:28 PM, Rob Herring <robh@xxxxxxxxxx> wrote: >> >>>> "Some system-on-chips (SoCs) use the concept of GPIO banks. ... >>>> Usually each such bank is >>>> exposed in the device tree as an individual gpio-controller node. ..." >>> >>> This should be conditioned on being able to divide up the registers by >>> bank which seems like you can't. Or there's the case like the DW GPIO >>> block and the number of banks is configurable. >> >> If it is possible to create one device per bank I usually prefer that >> approach, as it also (often) makes it possible to use the >> generic GPIO library, i.e. the hardware abstraction start to >> share more with other GPIO controllers. > > But that should be possible whether there are banks in DT or not, right? Possible yes, but more complex, requireing a bigger and more complex chunk of code to get it right. Which we don't have for Linux (I don't know about $OS). For 1 bank = 1 device, all callbacks etc naturally offsets to something like 0..31 landing in (1 << offset) which makes for a simple support library. If there is more complex calculations, more complex helper libs are required and maybe not even worth it, ending up with more duplicated or slightly-different code. Yours, Linus Walleij -- 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