On 31/03/15 11:37, Daniel Baluta wrote:
This device is register compatible with LTR501, with a minor difference forLooks good to me. Let us know when you've tested it ;)
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@xxxxxxxxx>
Anyhow, one comment inline. It 'think' you can end up with a device probing
succesfully with no known name...
- indio_dev->name = LTR501_DRV_NAME;Can name still be NULL? Needs a default value that makes sense.
+ indio_dev->name = name;
indio_dev->modes = INDIO_DIRECT_MODE;