Commit 78ed050d authored by Angus Ainslie (Purism)'s avatar Angus Ainslie (Purism) Committed by Jonathan Cameron

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: default avatarAngus Ainslie (Purism) <angus@akkea.ca>
Tested-by: default avatarTomas Novotny <tomas@novotny.cz>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 37ada026
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment