AnsweredAssumed Answered

Problem of GPIO_PF4 configuration

Question asked by zilong91 on Nov 13, 2011
Latest reply on Nov 16, 2011 by Aaronwu

On my BF518 platform, I can't config the GPIO_PF4 correctly.I do the test as following:

step 1: power up the board,and cat /proc/gpio file ,

GPIO_0:         mcp2515                 Peripheral
GPIO_1:         gpio-irq72              GPIO INPUT
GPIO_3:         gpio-irq74              GPIO INPUT
GPIO_5:         gpio-irq76              GPIO INPUT
GPIO_7:         pin_RS485_contr                 GPIO OUTPUT
GPIO_14:        CH376_RST               GPIO OUTPUT
GPIO_16:        ch376           Peripheral
GPIO_19:        bfin-sdh                Peripheral
GPIO_20:        bfin-sdh                Peripheral

So,GPIO_PF4 is not used by other functio.

step2: I inserd the driver mode,which config GPIO_PF4 as input,then cat /proc/gpio,

root:~> cat /proc/gpio
GPIO_0:         mcp2515                 Peripheral
GPIO_1:         gpio-irq72              GPIO INPUT
GPIO_3:         gpio-irq74              GPIO INPUT
GPIO_4:         port_update             GPIO OUTPUT
GPIO_5:         gpio-irq76              GPIO INPUT
GPIO_7:         pin_RS485_contr                 GPIO OUTPUT
GPIO_14:        CH376_RST               GPIO OUTPUT

GPIO_15:        led-usb                 GPIO OUTPUT
GPIO_16:        ch376           Peripheral

GPIO_30:        bfin-spi                Peripheral
GPIO_31:        m25p80          Peripheral
GPIO_33:        bfin-spi                Peripheral
GPIO_34:        bfin-spi                Peripheral
GPIO_35:        bfin-spi                Peripheral
GPIO_37:        port_maintain           GPIO INPUT
GPIO_38:        uart1_tx                Peripheral
GPIO_39:        uart1_rx                Peripheral

 

 

 

Codes as following was used  to config GPIO_PF4 and GPIO_PH5 ,but GPIO_PH5 work correctly.

   /*init system update port*/   
    ret = bfin_gpio_request(GPIO_PF4,"port_update");
    if(ret == EINVAL)
    { 
        printk("update port init failure!\n");
        return -1;           
    }
    bfin_gpio_direction_input(GPIO_PF4);




    /*init system maitaince port*/
    ret = bfin_gpio_request(GPIO_PH5,"port_maintain");
    if(ret == EINVAL)        
    { 
        printk("maintain port init failure!\n");
        return -1;
    }
    bfin_gpio_direction_input(GPIO_PH5);

 

 

How to solve this problem?

Outcomes