Subject: Re: GPIO abstraction [was "Re: wscons on a HD44780"]
To: Alexander Yurchenko <grange@rt.mipt.ru>
From: Jachym Holecek <freza@liberouter.org>
List: tech-embed
Date: 03/22/2005 20:38:05
> On Fri, Mar 04, 2005 at 03:54:12PM -0700, Jesse Off wrote:
> > I've since noticed OpenBSD implemented something very similar to what is 
> > being discussed here in their gpio(4) driver.
> > 
> > "pinbus" sounds like exactly the perfect word for the abstraction.  A 
> > wishlist item that I'd like to see enabled is the general attachment of 
> > certain pins to full devices and functions such that a "pinbus" could be 
> > attached at bootup and then individual pins could be arbitrarily aggregated 
> > into devices that could be "hot-plugged"  e.g. a matrixkp, hd44780 LCD, 
> > serial-port,  SPI-based ADC's.    Remaining pins might be assigned to a 
> > generic OpenBSD style gpio(4) device for user programs to twiddle.  I was 
> 
> OpenBSD's gpio(4) has initial config glue of gpio bit-banging, it's
> possible to attach devices to gpio controller specifying a set of pins
> via locators like:
> 
> 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.

	Regards,
		-- Jachym Holecek