lkml.org 
[lkml]   [2008]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] gpiolib: fix oops on reading sysfs exported GPIOs
On Thu, Oct 16, 2008 at 08:43:08AM -0700, David Brownell wrote:
[...]
> > GPIO users should always issue the gpio_direction_input() call and
> > check its return value prior to trying gpio_get_value().
>
> Not true; the API explicitly allows GPIOs to be treated
> as bidirectional, even when they're configured as outputs.
> That's because most GPIOs *are* bidirectional.

I just recalling somebody was speaking about not wasting cycles with
the checks in the gpio_{set,get}_value(). And the solution was that
before using the gpio_{set,get} one should always try to issue the
"direction" calls to ensure that gpio controller is capable of that
direction... That way gpio_{set,get}_value() don't have to check
anything.

Though I can't find the discussion now, maybe it was a dream... :-)


Thanks,

--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2


\
 
 \ /
  Last update: 2008-10-16 18:37    [W:0.224 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site