summaryrefslogtreecommitdiffstats
path: root/drivers/iio/potentiometer
diff options
context:
space:
mode:
authorBrian Masney2018-03-04 02:49:42 +0100
committerJonathan Cameron2018-03-10 15:56:06 +0100
commit2ab5b72453672ea18a176925becc40888df435ce (patch)
tree6f50ee68c6ec83cd0a1cf547bc6b3349f88d4491 /drivers/iio/potentiometer
parentstaging: iio: tsl2x7x: remove unnecessary sysfs attribute (diff)
downloadkernel-qcow2-linux-2ab5b72453672ea18a176925becc40888df435ce.tar.gz
kernel-qcow2-linux-2ab5b72453672ea18a176925becc40888df435ce.tar.xz
kernel-qcow2-linux-2ab5b72453672ea18a176925becc40888df435ce.zip
staging: iio: tsl2x7x: make proximity sensor function correctly
The bits for setting up the proximity diode were not setup correctly and this was causing the proximity sensor to not function correctly. This patch sets up the correct bit mask in tsl2x7x_chip_on() based on what the data sheet expects. From page 35 of the TSL2771 data sheet: https://ams.com/eng/content/download/250264/976045/file/TSL2771_DS000105_3-00.pdf - Bits 0-1 is the ALS gain control - Bits 2-3 is reserved (The proximity gain control on other tsl2x7x chips) - Bits 4-5 is the proximity diode select - Bits 6-7 is the LED drive strength tsl2x7x_chip_on() had the power and diode hardcoded, so these are extracted out into the settings so that these fields can be configured in the platform data. The default prox_gain is changed from 1 (2X gain) to 0 (1X gain) since the proximity gain control on the TSL2771, TMD2771, and other chips have these fields listed as reserved, and to write 0 into those bits. Verified that the proximity sensor now works correctly on a TSL2771 hooked up to a Raspberry Pi 2. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/potentiometer')
0 files changed, 0 insertions, 0 deletions