This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

What's the GPIO number of GPIO_WK3?

Other Parts Discussed in Thread: 4430

Dear sir,

I seems that the gpio number of gpio_wkn is n, So the gpio number of "sim_sd.gpio_wk3"  should be 3.  But I found another pin of "KPD_ROW2" whose GPIO number is 3 . If the gpio number of "sim_sd.gpio_wk3" is also be 3, it will be confused when invoking GPIO APIs. So what's the GPIO number of GPIO_WK3?

Thanks!

Connie kuang

  • Sorry, it is "sim_cd.gpio_wk3", not "sim_sd.gpio_wk3" .

  • Connie,

    You do use the value "n" when invoking the GPIO API's for gpio_wkn.  You can find several examples in the Blaze Tablet board file (/arch/arm/mach-omap2/board-44xx-tablet.c, in the 4AI.1.3 release, for example):

     omap_mux_init_signal("fref_clk0_out.gpio_wk6", OMAP_PIN_OUTPUT);
    gpio_request(6, "msecure");
    gpio_direction_output(6, 1);
    -------------------------------------------------------------
    #define GPIO_WK30     30
     omap_mux_init_signal("fref_clk3_req.gpio_wk30", \
    OMAP_PIN_OUTPUT | \
    OMAP_PIN_OFF_NONE | OMAP_PULL_ENA);

    /* Enable 5V,1A USB power on external HS-USB ports */
    if (gpio_is_valid(GPIO_WK30)) {
    gpio_request(GPIO_WK30, "USB POWER GPIO");
    gpio_direction_output(GPIO_WK30, 1);
    gpio_set_value(GPIO_WK30, 0);
    }
    
    
    
    
    In the case that you mentioned, there should not be an issue since you can only use gpio_wk3 or gpio_3 at once.  
    See section 25.2.2 in the TRM:
    
    
    NOTE: Users must not use a GPIO channel through two device pads simultaneously. Channels that
    can be mapped on two different device pads are:
    • GPIO[3:0] of the GPIO1 module (signals gpio_[3:0] or gpio_wk[3:0]; each can be routed
    to a different device pad). See Figure 25-4.
    • GPIO[8:4] of the GPIO4 module (signals gpio_[104:100]; each can be routed to two
    different device pads)
    Therefore, appropriate configuration must be done through the pad configuration registers.
    See Section 18.4.8, Pad Functional Multiplexing and Configuration, in Chapter 18, Control
    Module.
    
    
    Regards,
    Gina
  • Hi Connie,

    Can you provide more info on where are you seeing that?, I am only seeing one gpio_wk3 in OMAP 4430 TRM.

  • Hi Israel

    The two device pad I mentioned above are "sim_sd.gpio_wk3" and "kpd_row2.gpio_3". Thanks!

    Connie Kuang

  • Hello, Gina.

    What settings i have to use for gpio_wk1 line  if i want to use this gpio as wakeup source?

    Let's suppose that i don't need gpio_1 but i need gpio_wk1...so i configure gpio_wk1 as following:

    omap_mux_init_signal("sim_clk.gpio_wk1", OMAP_PIN_INPUT | OMAP_WAKEUP_EN |
                            OMAP_WAKEUP_EVENT); /* gpio_wk1 */

    and what mux settings i have to set to gpio_1 pad to switch off it and activate gpio_wk1?

    WBR,

  • Hi Egor,

    I will address these questions on your other thread for this topic, here: http://e2e.ti.com/support/omap/f/849/p/189398/680385.aspx#680385

    Regards,

    Gina

  • hi,

    i am using gpio_wk3 as one of the input pin in my project. i tried to execute the following commands:

    echo 3 > /sys/class/gpio/export

    echo in > /sys/class/gpio/gpio3/direction

    but i cannot see gpio3 class is created. May i know what is the proper way to do this?

    Thanks a lot.

  • Hi.

    All this commands correct but first you have to set up pinmux.

    You can write it some driver or board platform file.

    For example i set pinmux for GPIO3 (not GPIO_WK3)

    omap_mux_init_signal( "kpd_row2.gpio_3",  OMAP_MUX_MODE3 | OMAP_PIN_INPUT |  OMAP_WAKEUP_EN); /* gpio_3 */
    omap_mux_init_signal( "sim_cd.gpio_wk3", OMAP_MUX_MODE7 | OMAP_PIN_INPUT); /* gpio_wk3 */

    If you need exactly GPIO_WK3 you can put GPIO3 in MUX_MODE7 and make GPIO_WK3 as regular gpio OMAP_MUX_MODE3.

    Also i can thry to do such mux in runtime with devmem2 programm - you have to find out register number for GPIO3 and GPIO_WK3 in TRM

    WBR,



  • Hi Egor,

    Thanks for the reply.

    i already configure the pinmux for gpio_wk3 in MUX_MODE7. but the still facing the same problem.

    May you advice me on this?

    Thanks again. 

  • Hi.

    May be my English not correct :)

    If you want to use GPIO_WK3 you have to set MUX_MODE3, not MUX_MODE7.

    WBR,

  • Hi Egor,

    Sorry, my mistake. i already configure GPIO_WK3 to MUX_MODE3.

    Really sorry on that.

  • Then i can't help with this...sorry.

    I've always exported gpio from drivers or kernel board platform file.

    In this cases it worked for me.

    Try to check if pinmux register set up correctly....may be someone change you mux.

    Use devmem2 or other same utility