summaryrefslogtreecommitdiff
path: root/drivers/iio
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2017-04-13 23:21:56 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-25 15:44:41 +0200
commita99462b13dff9de2aa7941aaad8b4ed10edbb629 (patch)
treef977d773688aed2ec269f19493a2534c1c1afcb3 /drivers/iio
parent820adccd0e3be9bdd2384ca8fc4712108cfdf28b (diff)
iio: proximity: as3935: fix as3935_write
commit 84ca8e364acb26aba3292bc113ca8ed4335380fd upstream. 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> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/proximity/as3935.c3
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 @@
#define AS3935_TUNE_CAP 0x08
#define AS3935_CALIBRATE 0x3D
-#define AS3935_WRITE_DATA BIT(15)
#define AS3935_READ_DATA BIT(14)
#define AS3935_ADDRESS(x) ((x) << 8)
@@ -105,7 +104,7 @@ static int as3935_write(struct as3935_state *st,
{
u8 *buf = st->buf;
- buf[0] = (AS3935_WRITE_DATA | AS3935_ADDRESS(reg)) >> 8;
+ buf[0] = AS3935_ADDRESS(reg) >> 8;
buf[1] = val;
return spi_write(st->spi, buf, 2);