tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Changing the gpio(4) API/ABI



Am 25.09.2011 um 00:31 schrieb Ken Hornstein:

>> gpio(4) isn't in any release, right?  you're almost certainly the
>> major user so far, i don't think there's much benefit to backwards
>> comapt code here.
> 
> gpio(4) is in at least NetBSD 5.0.1.  Actually, I also see it on a
> NetBSD 4.0.1 system I have here as well, so it's been around for a
> while.
> 
> I use it for some stuff here.  But ... I'm not interested in holding
> back progress.  Could you explain exactly what you're removing, and what
> the new API will look like?


Sure.  I plan to remove the old API, which has not been documented for quite a 
while:

GPIOPINREAD (made obsolete by GPIOREAD)
GPIOPINWRITE (made obsolete by GPIOWRITE)
GPIOPINTOGGLE (made obsolete by GPIOTOGGLE)
GPIOPINCTL(made obsolete by GPIOSET/GPIOUNSET)

The curren GPIOATTACH ioctl, which is used to attach a driver to one or more
gpio pins, gets a new field to pass flags to the attaching driver.

So here is what you have to do to make sure you code runs:

If you use the old API, replace it by the current one, recompile.

If you used the new API (which is likely), and if you used GPIOATTACH, then
recompile.

If you only used gpioctl(8) to work with gpio, recompile that.

I hope this helps!
Marc



Home | Main Index | Thread Index | Old Index