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.

OPT3004: Interrupt is not working for opt3004

Part Number: OPT3004
Other Parts Discussed in Thread: OPT3001

Hi TI Team,

We are interfacing TI's opt3004 ALS with the Ambarella CV25 Processor. We are using the driver code - "opt3001.c" and it was loaded perfectly.

We have using gpio 44 as the interrupt and configured in the device tree .

Device Tree Configurations -

opt3001@44 {
                                compatible = "ti,opt3001";
                                reg = <0x44>;
                                interrupt-parent = <&gpio>;
                                interrupts = <44 IRQ_TYPE_EDGE_FALLING>;
                        };

But the pin is not working as an interrupt.

Also providing the value of lsiio command

# lsiio
Device 001: opt3001
Device 002: e4003000.adc
Device 000: Main
Trigger 000: e4003000.adc-dev2


Kindly check and give a solution to work the gpio as the interrupt.

Thanks,
Abhiram


  • Hi Abhiram,

    Unfortunately we cannot help from the MCU side.

    For the OPT3004, can you read the i2c configuration register while putting a scope on the INT pin to see if it is enabled correctly?

    Jalen

  • Hi Jalen,

    Thanks for the reply.

    Now we are getting the interrupt after executing the following command.

    echo 1 > in_illuminance_thresh_falling_en

    But after this execution, we cannot read the sensor result values ​​using the command

    cat in_illuminance_input

    This is resulting in an error as follows

    "cat: read error: Device or resource busy"

    Is it possible to enable the interrupt and read the resulting lux values ​​when the interrupt occurs?

  • Hi Megha,

    It would be possible to enable to the interrupt and read the resulting lux when the interrupt value occurs. Based on what you've provided this seems to be an issue with the MCU rather than the OPT3004 device. The MCU forum will be able to further help you debug.

    Jalen