]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
iio: 104-quad-8: Fix off-by-one error in register selection
authorWilliam Breathitt Gray <vilhelm.gray@gmail.com>
Thu, 24 May 2018 20:37:46 +0000 (16:37 -0400)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:51:10 +0000 (19:51 -0600)
BugLink: https://bugs.launchpad.net/bugs/1836287
[ Upstream commit 2873c3f0e2bd12a7612e905c920c058855f4072a ]

The reset flags operation is selected by bit 2 in the "Reset and Load
Signals Decoders" register, not bit 1.

Fixes: 28e5d3bb0325 ("iio: 104-quad-8: Add IIO support for the ACCES 104-QUAD-8")
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/iio/counter/104-quad-8.c

index b56985078d8c3440d9f8d0486f013face68c1737..4be85ec54af4cc862df1d5f8ba2afce9beb6db71 100644 (file)
@@ -138,7 +138,7 @@ static int quad8_write_raw(struct iio_dev *indio_dev,
                        outb(val >> (8 * i), base_offset);
 
                /* Reset Borrow, Carry, Compare, and Sign flags */
-               outb(0x02, base_offset + 1);
+               outb(0x04, base_offset + 1);
                /* Reset Error flag */
                outb(0x06, base_offset + 1);