Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354217
b: refs/heads/master
c: 3c80372
h: refs/heads/master
i:
  354215: 800c45a
v: v3
  • Loading branch information
Lars-Peter Clausen authored and Jonathan Cameron committed Jan 26, 2013
1 parent d3f1d79 commit a606b67
Show file tree
Hide file tree
Showing 2 changed files with 4 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: 9ab82f071125e340a052570df90813b11574f8d4
refs/heads/master: 3c80372dae17cb1a5a493c9ed02f7ca2a8d9ce53
7 changes: 3 additions & 4 deletions trunk/drivers/staging/iio/gyro/adis16080_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct adis16080_state {
struct spi_device *us;
struct mutex buf_lock;

u8 buf[2] ____cacheline_aligned;
__be16 buf ____cacheline_aligned;
};

static int adis16080_read_sample(struct iio_dev *indio_dev,
Expand All @@ -60,16 +60,15 @@ static int adis16080_read_sample(struct iio_dev *indio_dev,
};

mutex_lock(&st->buf_lock);
st->buf[0] = addr >> 8;
st->buf[1] = addr;
st->buf = cpu_to_be16(addr | ADIS16080_DIN_WRITE);

spi_message_init(&m);
spi_message_add_tail(&t[0], &m);
spi_message_add_tail(&t[1], &m);

ret = spi_sync(st->us, &m);
if (ret == 0)
*val = sign_extend32(((st->buf[0] & 0xF) << 8) | st->buf[1], 11);
*val = sign_extend32(be16_to_cpu(st->buf), 11);
mutex_unlock(&st->buf_lock);

return ret;
Expand Down

0 comments on commit a606b67

Please sign in to comment.