[PATCH] iio: capfun: fix inverted logic of ThrFixed

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

 



From: Michael Hennerich <michael.hennerich@xxxxxxxxxx>

Bit 7 of the AD7150 configuration register needs to be set for
fixed threshold modes.

Signed-off-by: Michael Hennerich <michael.hennerich@xxxxxxxxxx>
---
 drivers/staging/iio/adc/ad7150.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7150.c b/drivers/staging/iio/adc/ad7150.c
index 9e01614..fdf4da8 100644
--- a/drivers/staging/iio/adc/ad7150.c
+++ b/drivers/staging/iio/adc/ad7150.c
@@ -349,7 +349,7 @@ static int ad7150_write_event_config(struct iio_dev *indio_dev,
 		goto error_ret;
 	};
 
-	cfg |= (adaptive << 7) | (thresh_type << 5);
+	cfg |= (!adaptive << 7) | (thresh_type << 5);
 
 	ret = i2c_smbus_write_byte_data(chip->client, AD7150_CFG, cfg);
 	if (ret < 0)
-- 
1.7.0.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