CHROMIUM: iio: light sensor: Improve granularity of tsl2583 lux values.
authorBryan Freed <bfreed@chromium.org>
Fri, 2 Dec 2011 19:00:27 +0000 (11:00 -0800)
committerGrant Grundler <grundler@google.com>
Thu, 24 May 2012 22:06:07 +0000 (15:06 -0700)
commitff112d84a5cfff397e6bc3f46a7fe551e2627815
tree38fb1f79ae443790f243a40c4196e78e56cc3c1c
parent91fe0c9745088a0c92c63913cab128edeecf16d8
CHROMIUM: iio: light sensor: Improve granularity of tsl2583 lux values.

When illuminance0_calibbias gets 4000 (for a 4x multiplier), we see lux
granularity of 4.  Reversing the order of the right shift and multiplication
retains the precision of the unadjusted lux value.

BUG=chromium-os:23451
TEST='while :;do cat illuminance0_input;done' gives granularity of 1.

Signed-off-by: Bryan Freed <bfreed@chromium.org>
Change-Id: I92667cb04007ac17e91e0e3da10d691f774a753d
Reviewed-on: https://gerrit.chromium.org/gerrit/12394
Reviewed-by: Benson Leung <bleung@chromium.org>
drivers/staging/iio/light/tsl2583.c