iio: ltr501: Add support for ltr559 chip
authorDaniel Baluta <daniel.baluta@intel.com>
Tue, 21 Apr 2015 16:10:59 +0000 (19:10 +0300)
committerJonathan Cameron <jic23@kernel.org>
Sun, 26 Apr 2015 13:53:14 +0000 (14:53 +0100)
commit8592a7eefa540303dd9e60fa49340d09ca9376b4
tree12ea1725844ba0141f3fc368893d9ce002a497d9
parent772154d0ddde6b46a3866c73a16cfbfaf3053be4
iio: ltr501: Add support for ltr559 chip

This device is register compatible with LTR501, with a minor difference for
ALS control register as showed below:

ALS Control register for LTR501:

    7      6      5      4      3      2      1      0
+------+------+------+------+------+------+------+------+
|                           |      |      |             |
|        Reserved           | Gain |  SW  |    ALS Mode |
|                           |      | Reset|             |
+------+------+------+------+------+------+------+------+

ALS Control register for LTR559:

    7      6      5      4      3      2      1      0
+------+------+------+------+------+------+------+------+
|                    |                    |      |      |
|     Reserved       |        Gain        |  SW  | ALS  |
|                    |                    | Reset| Mode |
+------+------+------+------+------+------+------+------+

We handle this difference by introducing ltr501_chip_info.

Datasheet for LTR559 is at:
http://optoelectronics.liteon.com/upload/download/DS86-2013-0003/S_110_LTR-559ALS-01_DS_V1.pdf

Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/light/Kconfig
drivers/iio/light/ltr501.c