Messages in this thread | | | From | Daniel Palmer <> | Date | Tue, 27 Oct 2020 00:15:45 +0900 | Subject | Re: [PATCH v2 1/5] dt-bindings: gpio: Add a binding header for the MSC313 GPIO driver |
| |
Hi Rob,
On Mon, 26 Oct 2020 at 22:46, Rob Herring <robh@kernel.org> wrote: > > On Mon, Oct 19, 2020 at 11:10:04PM +0900, Daniel Palmer wrote: > > Header adds defines for the gpio number of each pin > > from the driver view. The gpio block seems to support 128 lines > > but what line is mapped to a physical pin depends on the chip. > > The driver itself uses the index of a pin's offset in an array > > of the possible offsets for a chip as the gpio number. > > > > The defines remove the need to work out that index to consume > > a pin in the device tree. > > I'd expect the DT to have 0-127 numbering... If you need to map that to > another number, then an array property in DT could handle that. >
Thank you for the comments on this header and the binding description.
Thinking about this again I'm thinking about having the GPIO numbers be 0-127 like you say but supplying the valid offsets for that specific chip and the pad/pin names to make visible to the user via an array/arrays that contains the pin register offsets and the pin names. Basically my per-chip table moves out of the driver and into the DT. Does that sound acceptable? The main thing I want to avoid is presenting the user with 128 gpios when the actually chip only has <10 of them wired up.
Thanks,
Daniel
| |