max44000: Expose ambient sensor scaling
authorCrestez Dan Leonard <leonard.crestez@intel.com>
Mon, 18 Apr 2016 14:31:56 +0000 (17:31 +0300)
committerJonathan Cameron <jic23@kernel.org>
Sun, 24 Apr 2016 09:23:02 +0000 (10:23 +0100)
commitd5d8f49b634520a98337fd413eef86da4e63e4fd
treeef91565fff86d7b5e3cad81c414e5dfd31ebaeb4
parent237a378b3bde0b3c1d1c47f7a3982c86a6728cdf
max44000: Expose ambient sensor scaling

This patch exposes ALSTIM as illuminance_integration_time and ALSPGA as
illuminance_scale.

Changing ALSTIM also changes the number of bits available in the data
register. This is handled inside raw value reading because:
* It's very easy to shift a few bits
* It allows SCALE and INT_TIME to be completely independent controls
* Buffer support requires constant scan_type.realbits per-channel

Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/light/max44000.c