lkml.org 
[lkml]   [2014]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.13 138/198] staging: iio: tsl2x7x_core: fix proximity treshold
    Date
    3.13.11.5 -stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Mario Schuknecht <mario.schuknecht@dresearch-fe.de>

    commit c404618cd06dad771495fe1cf9d5a63b5664f65f upstream.

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

    Signed-off-by: Mario Schuknecht <mario.schuknecht@dresearch-fe.de>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Kamal Mostafa <kamal@canonical.com>
    ---
    drivers/staging/iio/light/tsl2x7x_core.c | 8 ++++++--
    1 file changed, 6 insertions(+), 2 deletions(-)

    diff --git a/drivers/staging/iio/light/tsl2x7x_core.c b/drivers/staging/iio/light/tsl2x7x_core.c
    index 1880502..5b1f237 100644
    --- a/drivers/staging/iio/light/tsl2x7x_core.c
    +++ b/drivers/staging/iio/light/tsl2x7x_core.c
    @@ -667,9 +667,13 @@ static int tsl2x7x_chip_on(struct iio_dev *indio_dev)
    chip->tsl2x7x_config[TSL2X7X_PRX_COUNT] =
    chip->tsl2x7x_settings.prox_pulse_count;
    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_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 */
    if (chip->tsl2x7x_chip_status == TSL2X7X_CHIP_WORKING) {
    --
    1.9.1


    \
     
     \ /
      Last update: 2014-07-16 00:21    [W:4.040 / U:0.148 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site