lkml.org 
[lkml]   [2011]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: problems with GPIO
On Thu, Feb 17, 2011 at 9:21 PM, Murali K. Vemuri
<vemuri.muralikrishna@gmail.com> wrote:
> Hi There,
>
> I am rather a novice with linux kernel and I have this problem.
> My board is  OMAP 3530 based and I use GPIO 21 to detect an external
> device plug-in.
> Now, when the board is just booted (after a complete power disconnect
> ), the GPIO is high, and when I plug in my external device, the GPIO
> goes low, and I am able to detect it.
> However, I see the voltage level still low after I remove the external
> plug-in, and any further plug-ins, remain un-detected.
> My H/W engineers say it is some config I am missing in Kernel.
> can someone point me?
>
> my code snippet is like:
>
>    omap_mux_init_gpio(MY_GPIO,  OMAP_PIN_INPUT_PULLDOWN  );
>    gpio_request(MY_GPIO,"CABLE IN");
>    gpio_direction_input(MY_GPIO);
>    gpio_set_value(MY_GPIO,1);

It depends on the gpio controller driver, but gpio_set_value() is very
likely switching the GPIO pin from input to output. Why are you
calling gpio_set_value()?

g.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-03-03 07:27    [from the cache]
©2003-2011 Jasper Spaans