Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321762
b: refs/heads/master
c: 58cdff6
h: refs/heads/master
v: v3
  • Loading branch information
Lars-Peter Clausen authored and Jonathan Cameron committed Aug 16, 2012
1 parent 030496f commit d8ae2e5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a684a0c711d384665b43f9079a035e52a2761eab
refs/heads/master: 58cdff6ee71b4ea00a6b822a52ebf9ceb0b6a7d5
14 changes: 10 additions & 4 deletions trunk/drivers/staging/iio/adc/ad7192.c
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,6 @@ static int ad7192_read_raw(struct iio_dev *indio_dev,

switch (chan->type) {
case IIO_VOLTAGE:
if (!unipolar)
*val -= (1 << (chan->scan_type.realbits - 1));
break;
case IIO_TEMP:
*val -= 0x800000;
Expand All @@ -853,6 +851,12 @@ static int ad7192_read_raw(struct iio_dev *indio_dev,
default:
return -EINVAL;
}
case IIO_CHAN_INFO_OFFSET:
if (!unipolar)
*val -= (1 << (chan->scan_type.realbits - 1));
else
*val = 0;
return IIO_VAL_INT;
}

return -EINVAL;
Expand Down Expand Up @@ -942,7 +946,8 @@ static const struct iio_info ad7195_info = {
.channel = _chan, \
.channel2 = _chan2, \
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
IIO_CHAN_INFO_SCALE_SHARED_BIT, \
IIO_CHAN_INFO_SCALE_SHARED_BIT | \
IIO_CHAN_INFO_OFFSET_SHARED_BIT, \
.address = _address, \
.scan_index = _si, \
.scan_type = IIO_ST('u', 24, 32, 0)}
Expand All @@ -952,7 +957,8 @@ static const struct iio_info ad7195_info = {
.indexed = 1, \
.channel = _chan, \
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
IIO_CHAN_INFO_SCALE_SHARED_BIT, \
IIO_CHAN_INFO_SCALE_SHARED_BIT | \
IIO_CHAN_INFO_OFFSET_SHARED_BIT, \
.address = _address, \
.scan_index = _si, \
.scan_type = IIO_ST('u', 24, 32, 0)}
Expand Down

0 comments on commit d8ae2e5

Please sign in to comment.