Skip to content

Commit 0e9e19a

Browse files
mranostaygregkh
authored andcommitted
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>
1 parent 8a5b15e commit 0e9e19a

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/iio/proximity/as3935.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
#define AS3935_TUNE_CAP 0x08
5151
#define AS3935_CALIBRATE 0x3D
5252

53-
#define AS3935_WRITE_DATA BIT(15)
5453
#define AS3935_READ_DATA BIT(14)
5554
#define AS3935_ADDRESS(x) ((x) << 8)
5655

@@ -105,7 +104,7 @@ static int as3935_write(struct as3935_state *st,
105104
{
106105
u8 *buf = st->buf;
107106

108-
buf[0] = (AS3935_WRITE_DATA | AS3935_ADDRESS(reg)) >> 8;
107+
buf[0] = AS3935_ADDRESS(reg) >> 8;
109108
buf[1] = val;
110109

111110
return spi_write(st->spi, buf, 2);

0 commit comments

Comments
 (0)