diff options
author | Hubert CHAUMETTE <hubertx.chaumette@intel.com> | 2017-03-16 14:32:44 +0100 |
---|---|---|
committer | Bertolin, PierreX <pierrex.bertolin@intel.com> | 2017-05-17 09:48:48 -0700 |
commit | cee318195991a37b27f9ac8c0fce2a7119a734d9 (patch) | |
tree | c1dcc9e79963c4a5bef8695e9e10b60b75c9c428 | |
parent | c35c26a8c5d0f6299bbef2c0a494208c71e2ea7a (diff) | |
download | x86-cee318195991a37b27f9ac8c0fce2a7119a734d9.tar.gz |
als: fix measurement with very low ambient light
When covering the sensor, it gives a measurement of 47418 due to
arithmetic operations on unsigned types.
Change-Id: Icc110fc4aa11286e7a072bc3ac01dadfe45617c2
Tracked-On: https://jira01.devtools.intel.com/browse/AW-4487
Signed-off-by: Hubert CHAUMETTE <hubertx.chaumette@intel.com>
Reviewed-on: https://android.intel.com/582529
Reviewed-by: Ghaddab, RiadhX <riadhx.ghaddab@intel.com>
Reviewed-by: Dubray, SimonX <simonx.dubray@intel.com>
Reviewed-by: Tasayco Loarte, VictorX <victorx.tasayco.loarte@intel.com>
-rw-r--r-- | drivers/input/misc/tsl2583.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/input/misc/tsl2583.c b/drivers/input/misc/tsl2583.c index 0b135acd85b4..9af868e83d53 100644 --- a/drivers/input/misc/tsl2583.c +++ b/drivers/input/misc/tsl2583.c @@ -502,13 +502,13 @@ static int taos_init_configure(struct tsl258x_chip *chip, static int taos_get_lux(struct tsl258x_chip *chip) { u16 ch0, ch1; /* separated ch0/ch1 data from device */ - u32 lux; /* raw lux calculated from device data */ + int lux; /* raw lux calculated from device data */ u32 ratio; struct taos_lux *p; int ret; u32 ch0lux = 0; u32 ch1lux = 0; - u32 gain; + int gain; int lux1; int lux2; |