Subject: Re: GPIO abstraction [was "Re: wscons on a HD44780"]
To: Valeriy E. Ushakov <uwe@ptc.spbu.ru>
From: Jachym Holecek <freza@liberouter.org>
List: tech-embed
Date: 03/23/2005 07:10:01
> Jachym Holecek <freza@liberouter.org> wrote:
> 
> > > somedevice0 at gpio0 pin 10 mask 0x5
> > >
> >> It means that somedevice uses first and third pins starting from pin 10,
> >> i.e. pins 10 and 12.
> > 
> > While this may be enough in common cases, I would really prefer
> > something like:
> > 
> > somedevice0 at gpio signal1 fooio[GP0] signal2 bario[DATA3]
> > 
> > That is: 1) use descriptive signal names in config 2) be able to
> > hook one gpio consumer on multiple gpio providers. Of course, this
> > doesn't play nicely with current config scheme... but should be
> > doable.
> 
> We have config_hook(9), though it's somehat underdocumented.  Take a
> look at hpcmips configs.

Thanks for the pointer, I'm reading through it. For the record,
relevant code is also in ${sys}/dev/hpc/{hpcioman.c, files.hpcio},
config_hook(9) just does the indirect call part.

One thing I don't see (yet) -- how does hpcio deal with probe-ordering
of child devices that use more then one pin? In the example above: we
want somedevice0 to attach after fooio and bario (they should really
be fooio0 and bario0).

	Regards,
		-- Jachym Holecek