Ltr558 a bug in which l sensor can be used after P sensor is enabled first

Source: Internet
Author: User

20130109
It is found that l sensor is enabled only once when the system is started, and no IOCTL is transferred to the driver. This is a problem.

Why does l-sensor work only when P-sensor is enabled once after the system is started? The result is that the P-sensor must be enabled before interruption occurs. If l-sensor is enabled first, the interruption does not occur.
The two use the same interrupt.

Solve the problem!
Cause: the sensor is working before the configuration is interrupted, and the detected environment data is written to the data register, which is not cleared, as a result, when the sensor interrupt attribute register is configured, it cannot be interrupted to the outside world. Therefore, you can clear these registers during the enable process.
User @ Ubuntu :~ /Mywork/xxxxroid403/kernel $ git diff
Diff -- git a/Drivers/input/MISC/ltr_558als.c B/Drivers/input/MISC/ltr_558als.c
Index mongodbd2 .. c4789c9 100644
--- A/Drivers/input/MISC/ltr_558als.c
++ B/Drivers/input/MISC/ltr_558als.c
@-235,6 + 235,11 @ static int ltr558_ps_enable (u8 gainrange)
* Other settings like timing and threshold to be set here, if required.
* Not set and kept as device default for now.
*/
+ Ltr558_i2c_read_1_byte (ltr558_als_ps_status );
+ Ltr558_i2c_read_2_bytes (ltr558_ps_data_0 );
+ Ltr558_i2c_read_2_bytes (ltr558_als_data_bytes );
+ Ltr558_i2c_read_2_bytes (ltr558_als_data_ch0 );
+
Print_info ("ltr558_ps_enable, gainrange = % d, ret = % d \ n", gainrange, RET );
If (Ret> = 0)
Return 0;
@-278,6 + 283,12 @ static int ltr558_als_enable (u8 gainrange)
* Other settings like timing and threshold to be set here, if required.
* Not set and kept as device default for now.
*/
+
+ Ltr558_i2c_read_1_byte (ltr558_als_ps_status );
+ Ltr558_i2c_read_2_bytes (ltr558_ps_data_0 );
+ Ltr558_i2c_read_2_bytes (ltr558_als_data_bytes );
+ Ltr558_i2c_read_2_bytes (ltr558_als_data_ch0 );
+
Print_info ("ltr558_als_enable, gainrange = % d, ret = % d \ n", gainrange, RET );
If (Ret> = 0)
Return 0;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.