[PATCHv3] gpio-generic: add support for device tree probing

Jamie Iles jamie at jamieiles.com
Mon Aug 1 01:22:14 EST 2011


On Sat, Jul 30, 2011 at 09:06:11PM -0600, Grant Likely wrote:
> On Fri, Jul 29, 2011 at 05:49:40PM +0100, Jamie Iles wrote:
> > On Fri, Jul 29, 2011 at 10:24:53AM -0600, Grant Likely wrote:
> > > I really do think that the compatible property can be dropped from the
> > > child nodes... although thinking further.  It doesn't have much value
> > > for specifying the exact controller, but maybe it should be used to
> > > specify the specific type of bank.  Right now the generic code uses a
> > > heuristic to figure out which set of accessor ops to use which strikes
> > > me as rather fragile.  I think it would be better to identify the
> > > major types of gpio controllers and name them.
> > 
> > I did think of doing this originally but I felt it could get a bit too 
> > unwieldy to describe all of the combinations (both in the compatible 
> > string and parsing code).  I guess in the driver we could have a list of 
> > templates that have a mask of the required registers for a given 
> > compatible string.
> 
> Yes, I was thinking along those lines.  The devil is in the
> implementation details of course.

OK.  I'll try prototyping something over the next couple of days but 
initially I was thinking something along the lines of a bitmask for all 
required registers for a given compatible string.  Then at probe time, 
for now just check that we have all of the required regoffset-* 
properties (and none that we shouldn't have).  We could still use the 
heuristics for working out the accessors for now but add accessors to 
the templates later if needed.

Jamie


More information about the devicetree-discuss mailing list