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.

[AM3703]GPIO setting for RTC interrupt

Other Parts Discussed in Thread: AM3703, TPS65951

Hi All,

My customer want to use AM3703 GPIO_116 for getting interrupt from RTC present in TPS65951 chip. He use kernel 3.0.3 from kernel.org.
The RTC interrupt line is directly connected to GPIO_116.

Enabled GPIO with pin mux
OMAP3_MUX(MCBSP2_FSX,   OMAP_MUX_MODE4  | OMAP_PIN_INPUT),      /*GPIO 116 : PS_INT*/

static struct twl4030_platform_data beagle_twldata = {
        .irq_base       = TWL4030_IRQ_BASE,
        .irq_end        = TWL4030_IRQ_END,
};

static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = {
        {
          I2C_BOARD_INFO("twl4030", 0x48),
         .flags         = I2C_CLIENT_WAKE,
         .irq           = gpio_to_irq(116), 
         .platform_data = &beagle_twldata,
         },
};
static int __init omap3_beagle_i2c_init(void)
{
      omap_register_i2c_bus(1, 2600, beagle_i2c_boardinfo,
                  ARRAY_SIZE(beagle_i2c_boardinfo));
      return 0;
}

On beagle with .irq= INT_34XX_SYS_NIRQ enabled:
======================================
root@omap:/boot/uboot# cat /proc/interrupts
  7:          0      INTC        TWL4030-PIH
379:       0      twl4030   rtc0

He ran rtc test program, interrupts got updated:
root@omap:/boot/uboot# cat /proc/interrupts
  7:          1      INTC        TWL4030-PIH
379:       1      twl4030   rtc0

On our customized design with .irq= gpio_to_irq(116) :
=======================================
root@omap:/boot/uboot# cat /proc/interrupts
276:          0      gpio       TWL4030-PIH
379:            0      twl4030   rtc0
He ran rtc test program,  didn’t see the interrupts are getting updated:

root@omap:/boot/uboot# cat /proc/interrupts
276:           0       gpio        TWL4030-PIH
379:           0       twl4030   rtc0

Finally "hwclock" command should read RTC value without fail.
Are the settings done properly, do we need to take  care of anything else. Please advice.

Thanks!!

Regards
Sathish

  • Can you try configuring you pinmux setting to

    OMAP3_MUX(MCBSP2_FSX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE),

    Thanks,

    Vaibhav

  • Hi Vaibhav,

    No luck, I don’t see the interrupts are getting updated in “/proc/interrupts” table.
    root@omap:/boot/uboot# cat /proc/interrupts
               CPU0
      9:          0      INTC  l3-debug-irq
    10:          0      INTC  l3-app-irq
    11:          1      INTC  prcm
    12:       5650      INTC  DMA
    20:          0      INTC  gpmc
    25:          1      INTC  OMAP DISPC
    56:        192      INTC  omap_i2c
    72:          0      INTC  serial idle
    73:          0      INTC  serial idle
    74:        253      INTC  serial idle, OMAP UART2
    77:          0      INTC  ehci_hcd:usb1
    80:          0      INTC  serial idle
    83:       7888      INTC  mmc0
    86:        144      INTC  mmc1
    92:          1      INTC  musb-hdrc
    93:          0      INTC  musb-hdrc
    95:      10824      INTC  gp timer
    276:          0      GPIO  TWL4030-PIH
    379:          0   twl4030  rtc0
    IPI0:          0  Timer broadcast interrupts
    IPI1:          0  Rescheduling interrupts
    IPI2:          0  Function call interrupts
    IPI3:          0  Single function call interrupts
    IPI4:          0  CPU stop interrupts
    LOC:          0  Local timer interrupts

    Also  he would like to know
    1.       There is TWL4030-PIH under “/proc/interrupts” whose value is getting updated based on the .irq = INT_34XX_SYS_NIRQ or gpio_to_irq(116).  I want to understand what is “TWL4030-PIH” value?
           
    static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = {

                    {
    I2C_BOARD_INFO("twl4030", 0x48),
    .flags         = I2C_CLIENT_WAKE,
    .irq           = INT_34XX_SYS_NIRQ,
    //          .irq           = gpio_to_irq(116), 
                 .platform_data = &beagle_twldata,
    },
    };

    Thanks!!

    regards
    Sathish

  • Sathish,

    Can you conform that, the mus setting is right? Can you dump the pin mux register after booking the Linux kernel (Use devmem utility)? I suspect, you don't have right mux configuration for this pin.

    Thanks,

    Vaibhav

  • Hi Vaibhav,

    Customer reverted the PS_INT INT1 connection of TPS65951 chip to A8 sys_nirq pin instead of gpio_116, RTC works fine.

    Thanks!!

    Regards
    Sathish