Skip to content

Commit 78ed050

Browse files
nytowljic23
authored andcommitted
iio: light: vcnl4000 use word writes instead of byte writes
The VCNL4200 datasheet says that word read and writes should be used to access the registers. Signed-off-by: Angus Ainslie (Purism) <[email protected]> Tested-by: Tomas Novotny <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 37ada02 commit 78ed050

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/iio/light/vcnl4000.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ static int vcnl4200_init(struct vcnl4000_data *data)
140140
data->rev = (ret >> 8) & 0xf;
141141

142142
/* Set defaults and enable both channels */
143-
ret = i2c_smbus_write_byte_data(data->client, VCNL4200_AL_CONF, 0x00);
143+
ret = i2c_smbus_write_word_data(data->client, VCNL4200_AL_CONF, 0);
144144
if (ret < 0)
145145
return ret;
146-
ret = i2c_smbus_write_byte_data(data->client, VCNL4200_PS_CONF1, 0x00);
146+
ret = i2c_smbus_write_word_data(data->client, VCNL4200_PS_CONF1, 0);
147147
if (ret < 0)
148148
return ret;
149149

0 commit comments

Comments
 (0)