lkml.org 
[lkml]   [2021]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 01/16] iio: adc: max1027: Fix wrong shift with 12-bit devices
    Date
    10-bit devices must shift the value twice.
    This is not needed anymore on 12-bit devices.

    Fixes: ae47d009b508 ("iio: adc: max1027: Introduce 12-bit devices support")
    Cc: stable@vger.kernel.org
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    ---
    drivers/iio/adc/max1027.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c
    index 655ab02d03d8..4a42d140a4b0 100644
    --- a/drivers/iio/adc/max1027.c
    +++ b/drivers/iio/adc/max1027.c
    @@ -103,7 +103,7 @@ MODULE_DEVICE_TABLE(of, max1027_adc_dt_ids);
    .sign = 'u', \
    .realbits = depth, \
    .storagebits = 16, \
    - .shift = 2, \
    + .shift = (depth == 10) ? 2 : 0, \
    .endianness = IIO_BE, \
    }, \
    }
    --
    2.27.0
    \
     
     \ /
      Last update: 2021-08-18 13:12    [W:4.094 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site