iio: proximity: as3935: fix as3935_write
authorMatt Ranostay <matt.ranostay@konsulko.com>
Fri, 14 Apr 2017 06:21:56 +0000 (23:21 -0700)
committerJonathan Cameron <jic23@kernel.org>
Fri, 14 Apr 2017 13:48:58 +0000 (14:48 +0100)
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>
drivers/iio/proximity/as3935.c

index 5656deb17261c63963bffddecaf8c48a98cd16e5..0204595133844acac292f8bfe5fa4a23dec44ca6 100644 (file)
@@ -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);