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.

Interrupt handler not getting triggered

Hi,

We  have PCF8523 RTC sitting on i2c bus in a AM335x based platform.

RTC interrupt is connected to GPIO 114.

In pcf8523, driver probe routine, if we do a devm_request_irq on gpio_to_irq(114), interrupt handler is getting triggered/called properly:

 if ((err = devm_request_irq(&client->dev, gpio_to_irq(114), pcf8523_rtc_irq, IRQF_TRIGGER_FALLING, dev_name(&client->dev), client ))) {
  return err;

But, if we take the irq # from i2c_client->irq, interrupt handler is not getting triggered.

 if ((err = devm_request_irq(&client->dev, client->irq, pcf8523_rtc_irq, IRQF_TRIGGER_FALLING, dev_name(&client->dev), client ))) {
  return err;

Requesting your help, on getting my handler working with client->irq.

Thanks,

Ajit Kumar

  • Hi Ajit Kumar,
    How did you get that "client->irq" ?
    If RTC interrupt is connected to GPIO114, then gpio to irq method is correct and suppose if you are using internal RTC then you would use "platform_get_irq()" API to get the IRQ from board file or dts.

    Why do you want to use with i2c_client->irq ?

    Please refer to the following sample driver for your reference.

    drivers/rtc/rtc-davinci.c
  • Hi Titus,

    We are getting client->irq from client pointer being passed to probe routine.
    static int pcf8523_probe(struct i2c_client *client,
    const struct i2c_device_id *id)
    {
    ...
    }
    Most of the RTC drivers(like rtc-pcf50633.c), that have the above interface, are using client->irq in request_irq.
    Not sure, how this client->irq is calculated and how it is related to GPIOs.

    Thanks
  • Hi,

    Has this issue been solved ?
    Where does the client->irq is being initialized ?

    Thanks,
    Ran