[PATCH 03/16] staging:iio:adc:ad799x fix incorrect setting of configuration register on single channel read.

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

 



It is a bit mask whereas current code treats it as a straight value.

Signed-off-by: Jonathan Cameron <jic23@xxxxxxxxx>
---
 drivers/staging/iio/adc/ad799x_core.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/iio/adc/ad799x_core.c b/drivers/staging/iio/adc/ad799x_core.c
index 975a3f7..3b5f8be 100644
--- a/drivers/staging/iio/adc/ad799x_core.c
+++ b/drivers/staging/iio/adc/ad799x_core.c
@@ -123,7 +123,8 @@ static int ad799x_scan_direct(struct ad799x_state *st, unsigned ch)
 		break;
 	case ad7997:
 	case ad7998:
-		cmd = (ch << AD799X_CHANNEL_SHIFT) | AD7997_8_READ_SINGLE;
+		cmd = ((1 << ch) << AD799X_CHANNEL_SHIFT) |
+			AD7997_8_READ_SINGLE;
 		break;
 	default:
 		return -EINVAL;
-- 
1.7.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux