lkml.org 
[lkml]   [2008]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] generic GPIO parameter API
On Thu, 5 Jun 2008, David Brownell wrote:

> On Monday 02 June 2008, Guennadi Liakhovetski wrote:
> > Hi,
> >
> > as far as I understand, the current GPIO API only presents very basic GPIO
> > functionality: direction and level reading and writing. Whereas many GPIO
> > controllers have many further configurable parameters: pull-ups and
> > pull-downs, drive strength, slew rate, etc.
>
> Not at all how I'd describe it. Those omitted mechanisms are part
> of pin configuration, in the same way as function multiplexing is.
> (That is, assigning a given pin for use as a GPIO, vs hooking it up
> to an I2C, MMC, SPI, LCD, I2S, or memory controller.)

Yes, on the one hand you're right, this belongs to pin-configuration. But,
otoh, will anyone ever want to change these parameters on non-generic
pins? And should this be allowed? Whereas for GPIOs it clearly makes a
sense - on a test-board you have a header with free-hanging GPIOs. How do
you want to configure them? This depends on what the user connects to them
and you don't necessarily want to modify your kernel to reconfigure them.

As for various difficulties - they should be solvable, I think. For
example, for GPIO pins, that can only be configured in groups - you just
first verify that the other GPIOs in this group are either free or
configured compatibly, or you fail. Of course these functions are
hardware-specific, so we let every specific driver handle them.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer


\
 
 \ /
  Last update: 2008-06-09 18:27    [W:0.076 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site