Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 268850
b: refs/heads/master
c: 021c0a3
h: refs/heads/master
v: v3
  • Loading branch information
Lars-Peter Clausen authored and Greg Kroah-Hartman committed Oct 19, 2011
1 parent 0ab92df commit ad7a81c
Show file tree
Hide file tree
Showing 2 changed files with 5 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: 1b992320775691ba0124bd37c5fffe16172743cd
refs/heads/master: 021c0a381c5c1ae457bb9316669736d2ec66f972
8 changes: 4 additions & 4 deletions trunk/drivers/staging/iio/dac/ad5791.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,11 @@ static int ad5791_read_raw(struct iio_dev *indio_dev,
return ret;
*val &= AD5791_DAC_MASK;
*val >>= chan->scan_type.shift;
*val -= (1 << (chan->scan_type.storagebits - 1));
*val -= (1 << (chan->scan_type.realbits - 1));
return IIO_VAL_INT;
case (1 << IIO_CHAN_INFO_SCALE_SHARED):
*val = 0;
*val2 = (st->vref_mv * 1000) >> chan->scan_type.storagebits;
*val2 = (st->vref_mv * 1000) >> chan->scan_type.realbits;
return IIO_VAL_INT_PLUS_MICRO;
default:
return -EINVAL;
Expand All @@ -257,8 +257,8 @@ static int ad5791_write_raw(struct iio_dev *indio_dev,

switch (mask) {
case 0:
val += (1 << (chan->scan_type.storagebits - 1));
val &= AD5791_RES_MASK(chan->scan_type.storagebits);
val += (1 << (chan->scan_type.realbits - 1));
val &= AD5791_RES_MASK(chan->scan_type.realbits);
val <<= chan->scan_type.shift;

return ad5791_spi_write(st->spi, chan->address, val);
Expand Down

0 comments on commit ad7a81c

Please sign in to comment.