logo       

Re: Problem in setting the state of GPIO pin in PXA255: msg#00081

Subject: Re: Problem in setting the state of GPIO pin in PXA255
On Wed, 17 Dec 2003, Nagasesha Reddy wrote:

> Hi,
>     I am using Lubbock board (PXA255 based) and
> linux-2.4.19-rmk7-pxa1.
>     I am trying to set the state of GPIO pin using
> GPSR/GPCR registers. But the state I am trying to set
> is not reflected on the GPIO pin. The pin always
> reatins its old state.
> 
> I am using the following piece of code in
> the driver.
> 
>    set_GPIO_mode(81 | GPIO_OUT); 
>    old_state = ( GPLR(81) & GPIO_bit(81))?1:0 ;
>                   /* old_state is zero */
>    GPSR(81) |= GPIO_bit(81); /*set pin state to 1*/

With GPSR and GPCR you only need to perform a direct assignment, e.g.:

        GPSR(81) = GPIO_bit(81);

>    new_state = ( GPLR(81) & GPIO_bit(81))?1:0 ;
> 
> But I always get new_state as zero.

What about the level on the actual GPIO line?

> I tried with other GPIO pins and found the same thing.
> 
>    Any idea why the GPIO pin state is not 
> changing even after setting in GPSR/GPCR registers?
>    Did I miss any settings in some other registers?

Your code seems to be right (besides the minor detail above).


Nicolas


-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ/Etiquette:       http://www.arm.linux.org.uk/armlinux/mailinglists.php



<Prev in Thread] Current Thread [Next in Thread>