2011-07-27 03:12:55     gpio request problem

Document created by Aaronwu Employee on Aug 27, 2013
Version 1Show Document
  • View in full screen mode

2011-07-27 03:12:55     gpio request problem

Sakthivel Perumal (INDIA)

Message: 102677   

 

Hi,

 

I am working with 2010R1 distribution and tool chain for BF527 custom board. The board is having IR receiver connected to the PortH 13 of BF527.. i have configured the PH13 of bf527 as gpio for input and interrupt configuration to both edge using the following function...

 

 

if (bfin_gpio_request(GPIO_PH13,"IR")) {

 

return -EBUSY;

 

}

 

gpio_direction_input(GPIO_PH13);

 

 

 

set_irq_type(IRQ_PH13,IRQF_TRIGGER_BOTH_EDGE);

 

 

 

/*Request IRQ_PG13 for IR*/

 

s32_RetVal = request_irq(IRQ_PH13,(void *)IR_IRQ_Handler,IRQ_DISABLED, "IR_IRQ",NULL);

 

while runing with standalone application for remote key detection it display  the following  things when ever  pressing the remote key............. 

 

root:/> tftp -g -r MYWORK 172.16.6.118

root:/> chmod 777 MYWORK

root:/> ./MYWORK

bfin-gpio: GPIO 45 is already reserved by BFIN-GPIO! (Documentation/blackfin/bfi

n-gpio-notes.txt)

 

IR device opened succesfully

 

 

bfin-gpio: GPIO 45 is already reserved by gpio-irq116! (Documentation/blackfin/b

fin-gpio-notes.txt)

bfin-gpio: GPIO 45 is already reserved by gpio-irq116! (Documentation/blackfin/b

fin-gpio-notes.txt)

bfin-gpio: GPIO 45 is already reserved by gpio-irq116! (Documentation/blackfin/b

fin-gpio-notes.txt)

bfin-gpio: GPIO 45 is already reserved by gpio-irq116! (Documentation/blackfin/b

fin-gpio-notes.txt)

bfin-gpio: GPIO 45 is already reserved by gpio-irq116! (Documentation/blackfin/b

fin-gpio-notes.txt)

bfin-gpio: GPIO 45 is already reserved by gpio-irq116! (Documentation/blackfin/b

fin-gpio-notes.txt)

bfin-gpio: GPIO 45 is already reserved by gpio-irq116! (Documentation/blackfin/b

fin-gpio-notes.txt)

bfin-gpio: GPIO 45 is already reserved by gpio-irq116! (Documentation/blackfin/b

fin-gpio-notes.txt)

bfin-gpio: GPIO 45 is already reserved by gpio-irq116! (Documentation/blackfin/b

fin-gpio-notes.txt)

bfin-gpio: GPIO 45 is already reserved by gpio-irq116! (Documentation/blackfin/b

fin-gpio-notes.txt)

bfin-gpio: GPIO 45 is already reserved by gpio-irq116! (Documentation/blackfin/b

fin-gpio-notes.txt)

bfin-gpio: GPIO 45 is already reserved by gpio-irq116! (Documentation/blackfin/b

fin-gpio-notes.txt)

bfin-gpio: GPIO 45 is already reserved by gpio-irq116! (Documentation/blackfin/b

fin-gpio-notes.txt)

bfin-gpio: GPIO 45 is already reserved by gpio-irq116! (Documentation/blackfin/b

fin-gpio-notes.txt)

bfin-gpio: GPIO 45 is already reserved by gpio-irq116! (Documentation/blackfin/b

fin-gpio-notes.txt)

bfin-gpio: GPIO 45 is already reserved by gpio-irq116! (Documentation/blackfin/b

fin-gpio-notes.txt)

bfin-gpio: GPIO 45 is already reserved by gpio-irq116! (Documentation/blackfin/b

fin-gpio-notes.txt)

bfin-gpio: GPIO 45 is already reserved by gpio-irq116! (Documentation/blackfin/b

fin-gpio-notes.txt)

bfin-gpio: GPIO 45 is already reserved by gpio-irq116! (Documentation/blackfin/b

fin-gpio-notes.txt)

bfin-gpio: GPIO 45 is already reserved by gpio-irq116! (Documentation/blackfin/b

fin-gpio-notes.txt)

bfin-gpio: GPIO 45 is already reserved by gpio-irq116! (Documentation/blackfin/b

fin-gpio-notes.txt)

 

 

I have refered this document  but i didn't get anything from that  document ..  and one more thing to ur note is if  i am  writing the folowing thing directly , then no problem with this one,

 

s32_ReadVal=bfin_read_PORTH_FER();

 

bfin_write_PORTH_FER(s32_ReadVal&0xDFFF);

 

asm("ssync;");

 

can i use in this way or i need use  gpio request API ?         help me..................

QuoteReplyEditDelete

 

 

2011-07-27 03:51:36     Re: gpio request problem

steven miao (CHINA)

Message: 102690   

 

bfin gpio api will check gpio pin requesting conflict, it's said you don't need to set gpio direction input when you use it as gpio irq.

 

you can use bfin_gpio_get_value() to get gpio value, and if you want to bypass the gpio conflict check you can use __bfin_gpio_direction_input() in arch/blackfin/kernel/bfin_gpio.c (drop the static declare)

 

-steven

QuoteReplyEditDelete

 

 

2011-07-27 03:55:33     Re: gpio request problem

Sonic Zhang (CHINA)

Message: 102691   

 

You don't need to call bfin_gpio_request(GPIO_PH13,"IR") if you want to request this GPIO pin as IRQ.

QuoteReplyEditDelete

 

 

2011-07-27 04:41:46     Re: gpio request problem

Sakthivel Perumal (INDIA)

Message: 102692   

 

Hi  Steven and  Sonic,

 

      Thank u very much for ur reply,  now  it's working fine without giving the gpio request  that told by Sonic  Zhang.....  thank u again..

Attachments

    Outcomes