Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354409
b: refs/heads/master
c: 482bb4e
h: refs/heads/master
i:
  354407: f6eb072
v: v3
  • Loading branch information
Guenter Roeck authored and Jonathan Cameron committed Feb 2, 2013
1 parent 7f7b4df commit a39fd59
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 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: dcb9ca0a25e1ccab9ad6827887c08e2b6b65f38e
refs/heads/master: 482bb4e6c648a68598cde9d4a56b066df26d5ae6
5 changes: 3 additions & 2 deletions trunk/drivers/iio/adc/max1363.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ static int max1363_read_single_chan(struct iio_dev *indio_dev,
{
int ret = 0;
s32 data;
char rxbuf[2];
u8 rxbuf[2];
struct max1363_state *st = iio_priv(indio_dev);
struct i2c_client *client = st->client;

Expand Down Expand Up @@ -367,7 +367,8 @@ static int max1363_read_single_chan(struct iio_dev *indio_dev,
ret = data;
goto error_ret;
}
data = (s32)(rxbuf[1]) | ((s32)(rxbuf[0] & 0x0F)) << 8;
data = (rxbuf[1] | rxbuf[0] << 8) &
((1 << st->chip_info->bits) - 1);
} else {
/* Get reading */
data = i2c_master_recv(client, rxbuf, 1);
Expand Down

0 comments on commit a39fd59

Please sign in to comment.