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;