Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 249255
b: refs/heads/master
c: 232b164
h: refs/heads/master
i:
  249253: 89ad660
  249251: 27e23bf
  249247: 0d1a4d3
v: v3
  • Loading branch information
Michael Hennerich authored and Greg Kroah-Hartman committed May 3, 2011
1 parent 2e6e037 commit 6d3c3c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: caca8c89c24d1fe1470aafacebe7d80910888235
refs/heads/master: 232b1648e5d54b1e3f73463b0b26348889f12ae3
7 changes: 7 additions & 0 deletions trunk/drivers/staging/iio/gyro/adxrs450_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ static int adxrs450_spi_read_reg_16(struct device *dev,
st->tx[2] = 0;
st->tx[3] = 0;

if (!(hweight32(be32_to_cpu(*(u32 *)st->tx)) & 1))
st->tx[3] |= ADXRS450_P;

spi_message_init(&msg);
spi_message_add_tail(&xfers[0], &msg);
spi_message_add_tail(&xfers[1], &msg);
Expand Down Expand Up @@ -103,6 +106,10 @@ static int adxrs450_spi_write_reg_16(struct device *dev,
st->tx[1] = reg_address << 1 | val >> 15;
st->tx[2] = val >> 7;
st->tx[3] = val << 1;

if (!(hweight32(be32_to_cpu(*(u32 *)st->tx)) & 1))
st->tx[3] |= ADXRS450_P;

spi_message_init(&msg);
spi_message_add_tail(&xfers, &msg);
ret = spi_sync(st->us, &msg);
Expand Down

0 comments on commit 6d3c3c7

Please sign in to comment.