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.

At the linux-2.6.29-rc3, OMAP3530 GPIO IRQ's????

Dear,

I have been trying to get understand the GPIO control for linux-2.6.29-rc3.

I had reference the OMAP35x EVM Rev D, but our target dosn't to connect TWL4030 Power Module.

GPIO_126 connected by MMC Card detect PIN.

I don't know how to use GPIO Control, but at the linux-2.6.22-18, MMC card used the GPIO MUX_MODE4.

Added at the "./include/asm/arch/omap34xx.h"

#define CONTROL_PADCONF_MMC1_DAT4      CONTROL_REG32_34XX(0x150)          /* GPIO_126 for MMC Card detect*/

Added at the "./arch/arm/mach-omap2/board-omap3evm.c"

 ptr = (u32 *)(&CONTROL_PADCONF_MMC1_DAT4);

 *ptr |= (u32)(IO_PAD_WAKEUPENABLE |
   IO_PAD_OFFPULLUDENABLE | /* Pull up enable */
   IO_PAD_OFFOUTENABLE |  /* Input enable   */
   IO_PAD_OFFENABLE |
   IO_PAD_INPUTENABLE |
   IO_PAD_PULLUDENABLE |
   IO_PAD_MUXMODE4);

Unfortunately, at the linux-2.6.29-rc3, I don't know how to configure GPIO setting.

Reference: mux.c, mux.h, gpio.c -> omap_cfg_regs()

Registered:  omap_cfg_reg(P27_34XX_GPIO126);

If you know, please let me your adivce.

Thanks

  • Kim,

    You have found the right set of files; and the API.

    I am assuming that you are looking for sequence/ steps to add a new GPIO to the existing infrastructure.

    I would suggest that you look at the linux-omap repository at git.kernel.org for this kernel version and subsequent versions to check if this GPIO has already been added.

    However, in short, the sequence would be:

    1) Add P27_34XX_GPIO126 to "enum omap34xx_index" in mach/mux.h

    2) Use macro MUX_CFG_34XX() to define the mux settings in mux.c

    3) Call omap_cfg_re() in the appropriate init function.

    Do verify:

    * If the GPIO isn't already defined - may be with a different name

    * The index in "enum" and position in mux.c are same. Always helps if any addition is done in the end.

    Best regards,
    Sanjeev


  • hi Kim

    board :mistaral EVM omap 3530

    kernel :2.6.22.18 (i cnot upgrate ,lcd driver,adc driver)

    i try to work with OMAP 35xx GPIO i write GPIO driver based on the gpio.txt from the kernel

    i add to the mux.h and to mux.c and init to devices.c

    i think that the bass add is not good:on the file mux.c i add

    /*agm gpio*/
    MUX_CFG_34XX("MUX1_1_GPIO113",  0x106, 4, 0, 0, 0,
        0, 0,  0,  0,  0, 0)
    MUX_CFG_34XX("MUX1_2_GPIO114",  0x108, 4, 0, 0, 0,
        0, 0,  0,  0,  0, 0)
    MUX_CFG_34XX("MUX1_3_GPIO115",  0x10a, 4, 0, 0, 0,
        0, 0,  0,  0,  0, 0)

    r.g. doron

  • i find the problem the offset is 134 i find it from pdf omap 35xx application processor page 932 on the physical addres is 0x4800 2134 the last number is the ofsset (134)

    R.G. doron

    AGMtonson L.T.D

  • hi

    i made driver and kernl modified  to work the QPIO on kernel 2.6.22-18.

    if this god for u?

    doron sandroy.