Re: tsl2x7x: IRQ event handler only being called when polling sysfs attributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 19 March 2018 10:37:17 GMT, Brian Masney <masneyb@xxxxxxxxxxxxx> wrote:
>I am working on getting interrupts to work properly for the tsl2x7x
>staging cleanup but I've run into an odd issue where
>tsl2x7x_event_handler() is only called if I poll the corresponding
>sysfs attribute. So for example, when I run this in the background:
>
>	watch -n .1 cat in_illuminance0_input
>
>tsl2x7x_get_lux() shows that the relevant bit in the device register is
>asserting an interrupt and tsl2x7x_event_handler() is called. As soon
>as I stop that watch process, tsl2x7x_event_handler() is no longer
>called.
>
>tsl2x7x_event_handler() is not called for any proximity interrupts
>while I only poll the ALS. However, when I start polling
>in_proximity0_raw, then tsl2x7x_event_handler() is called as expected
>when the sensor is asserting an interrupt.
>
>Note: tsl2x7x_get_prox() in IIO testing is missing a call to clear the
>interrupt bit, but tsl2x7x_get_lux() clears it. I added code to clear
>the interrupt bit in tsl2x7x_get_prox() to my local tree.
>
>Here is my relevant device tree binding for the Raspberry Pi 2:
>
>&i2c1 {
>       tsl2772@39 {
>               compatible = "amstaos,tsl2772";
>               reg = <0x39>;
>               interrupt-parent = <&gpio>;
>               interrupts = <22 0x1>;
>       };
>};
>
>I have a 10K pull-up resistor on the interrupt pin.
>
>Any ideas?
>
Superficially it sounds like the device is not in the free running mode it needs to be to get the
samples needed for comparison. 

Some devices require a different set of setting when threshold interrupts are enabled.
Here it looks like it might be associated with the PON bit...

As it stands, you sysfs poll is making it manually take samples rather than do it autonomously.

J


>Brian
>--
>To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>the body of a message to majordomo@xxxxxxxxxxxxxxx
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux