diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2017-04-14 02:21:56 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2017-04-14 09:48:58 -0400 |
commit | 84ca8e364acb26aba3292bc113ca8ed4335380fd (patch) | |
tree | 1a93378a623f0f70bbdb807330584c1031143662 | |
parent | ce420fd4251809b4c3119b3b20c8b13bd8eba150 (diff) |
iio: proximity: as3935: fix as3935_write
AS3935_WRITE_DATA macro bit is incorrect and the actual write
sequence is two leading zeros.
Cc: George McCollister <george.mccollister@gmail.com>
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r-- | drivers/iio/proximity/as3935.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/iio/proximity/as3935.c b/drivers/iio/proximity/as3935.c index 5656deb17261..020459513384 100644 --- a/drivers/iio/proximity/as3935.c +++ b/drivers/iio/proximity/as3935.c | |||
@@ -50,7 +50,6 @@ | |||
50 | #define AS3935_TUNE_CAP 0x08 | 50 | #define AS3935_TUNE_CAP 0x08 |
51 | #define AS3935_CALIBRATE 0x3D | 51 | #define AS3935_CALIBRATE 0x3D |
52 | 52 | ||
53 | #define AS3935_WRITE_DATA BIT(15) | ||
54 | #define AS3935_READ_DATA BIT(14) | 53 | #define AS3935_READ_DATA BIT(14) |
55 | #define AS3935_ADDRESS(x) ((x) << 8) | 54 | #define AS3935_ADDRESS(x) ((x) << 8) |
56 | 55 | ||
@@ -105,7 +104,7 @@ static int as3935_write(struct as3935_state *st, | |||
105 | { | 104 | { |
106 | u8 *buf = st->buf; | 105 | u8 *buf = st->buf; |
107 | 106 | ||
108 | buf[0] = (AS3935_WRITE_DATA | AS3935_ADDRESS(reg)) >> 8; | 107 | buf[0] = AS3935_ADDRESS(reg) >> 8; |
109 | buf[1] = val; | 108 | buf[1] = val; |
110 | 109 | ||
111 | return spi_write(st->spi, buf, 2); | 110 | return spi_write(st->spi, buf, 2); |