Commit c404618c authored by Mario Schuknecht's avatar Mario Schuknecht Committed by Jonathan Cameron

staging: iio: tsl2x7x_core: fix proximity treshold

Consider high byte of proximity min and max treshold in function
'tsl2x7x_chip_on'. So far, the high byte was not set.

Cc: Stable@vger.kernel.org
Signed-off-by: default avatarMario Schuknecht <mario.schuknecht@dresearch-fe.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent d29f5929
...@@ -667,9 +667,13 @@ static int tsl2x7x_chip_on(struct iio_dev *indio_dev) ...@@ -667,9 +667,13 @@ static int tsl2x7x_chip_on(struct iio_dev *indio_dev)
chip->tsl2x7x_config[TSL2X7X_PRX_COUNT] = chip->tsl2x7x_config[TSL2X7X_PRX_COUNT] =
chip->tsl2x7x_settings.prox_pulse_count; chip->tsl2x7x_settings.prox_pulse_count;
chip->tsl2x7x_config[TSL2X7X_PRX_MINTHRESHLO] = chip->tsl2x7x_config[TSL2X7X_PRX_MINTHRESHLO] =
chip->tsl2x7x_settings.prox_thres_low; (chip->tsl2x7x_settings.prox_thres_low) & 0xFF;
chip->tsl2x7x_config[TSL2X7X_PRX_MINTHRESHHI] =
(chip->tsl2x7x_settings.prox_thres_low >> 8) & 0xFF;
chip->tsl2x7x_config[TSL2X7X_PRX_MAXTHRESHLO] = chip->tsl2x7x_config[TSL2X7X_PRX_MAXTHRESHLO] =
chip->tsl2x7x_settings.prox_thres_high; (chip->tsl2x7x_settings.prox_thres_high) & 0xFF;
chip->tsl2x7x_config[TSL2X7X_PRX_MAXTHRESHHI] =
(chip->tsl2x7x_settings.prox_thres_high >> 8) & 0xFF;
/* and make sure we're not already on */ /* and make sure we're not already on */
if (chip->tsl2x7x_chip_status == TSL2X7X_CHIP_WORKING) { if (chip->tsl2x7x_chip_status == TSL2X7X_CHIP_WORKING) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment