Patch "iio: adc: mcp3911: make use of the sign bit" has been added to the 5.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    iio: adc: mcp3911: make use of the sign bit

to the 5.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     iio-adc-mcp3911-make-use-of-the-sign-bit.patch
and it can be found in the queue-5.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 2eadc1f283728b6f4068aadccd95709404fa621c
Author: Marcus Folkesson <marcus.folkesson@xxxxxxxxx>
Date:   Fri Jul 22 15:07:18 2022 +0200

    iio: adc: mcp3911: make use of the sign bit
    
    [ Upstream commit 8f89e33bf040bbef66386c426198622180233178 ]
    
    The device supports negative values as well.
    
    Fixes: 3a89b289df5d ("iio: adc: add support for mcp3911")
    Signed-off-by: Marcus Folkesson <marcus.folkesson@xxxxxxxxx>
    Reviewed-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20220722130726.7627-2-marcus.folkesson@xxxxxxxxx
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/iio/adc/mcp3911.c b/drivers/iio/adc/mcp3911.c
index 1cb4590fe4125..f581cefb67195 100644
--- a/drivers/iio/adc/mcp3911.c
+++ b/drivers/iio/adc/mcp3911.c
@@ -113,6 +113,8 @@ static int mcp3911_read_raw(struct iio_dev *indio_dev,
 		if (ret)
 			goto out;
 
+		*val = sign_extend32(*val, 23);
+
 		ret = IIO_VAL_INT;
 		break;
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux