Skip to content

Commit

Permalink
iio: light: vcnl4000 use word writes instead of byte writes
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
nytowl authored and jic23 committed Apr 4, 2019
1 parent 37ada02 commit 78ed050
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/iio/light/vcnl4000.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ static int vcnl4200_init(struct vcnl4000_data *data)
data->rev = (ret >> 8) & 0xf;

/* Set defaults and enable both channels */
ret = i2c_smbus_write_byte_data(data->client, VCNL4200_AL_CONF, 0x00);
ret = i2c_smbus_write_word_data(data->client, VCNL4200_AL_CONF, 0);
if (ret < 0)
return ret;
ret = i2c_smbus_write_byte_data(data->client, VCNL4200_PS_CONF1, 0x00);
ret = i2c_smbus_write_word_data(data->client, VCNL4200_PS_CONF1, 0);
if (ret < 0)
return ret;

Expand Down

0 comments on commit 78ed050

Please sign in to comment.