]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.14.117/staging-iio-adt7316-allow-adt751x-to-use-internal-vref-for-all-dacs.patch
Fixes for 5.10
[thirdparty/kernel/stable-queue.git] / releases / 4.14.117 / staging-iio-adt7316-allow-adt751x-to-use-internal-vref-for-all-dacs.patch
1 From 10bfe7cc1739c22f0aa296b39e53f61e9e3f4d99 Mon Sep 17 00:00:00 2001
2 From: Jeremy Fertic <jeremyfertic@gmail.com>
3 Date: Tue, 11 Dec 2018 17:55:00 -0700
4 Subject: staging: iio: adt7316: allow adt751x to use internal vref for all dacs
5
6 From: Jeremy Fertic <jeremyfertic@gmail.com>
7
8 commit 10bfe7cc1739c22f0aa296b39e53f61e9e3f4d99 upstream.
9
10 With adt7516/7/9, internal vref is available for dacs a and b, dacs c and
11 d, or all dacs. The driver doesn't currently support internal vref for all
12 dacs. Change the else if to an if so both bits are checked rather than
13 just one or the other.
14
15 Signed-off-by: Jeremy Fertic <jeremyfertic@gmail.com>
16 Fixes: 35f6b6b86ede ("staging: iio: new ADT7316/7/8 and ADT7516/7/9 driver")
17 Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20 ---
21 drivers/staging/iio/addac/adt7316.c | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-)
23
24 --- a/drivers/staging/iio/addac/adt7316.c
25 +++ b/drivers/staging/iio/addac/adt7316.c
26 @@ -1086,7 +1086,7 @@ static ssize_t adt7316_store_DAC_interna
27 ldac_config = chip->ldac_config & (~ADT7516_DAC_IN_VREF_MASK);
28 if (data & 0x1)
29 ldac_config |= ADT7516_DAC_AB_IN_VREF;
30 - else if (data & 0x2)
31 + if (data & 0x2)
32 ldac_config |= ADT7516_DAC_CD_IN_VREF;
33 } else {
34 ret = kstrtou8(buf, 16, &data);