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) <angus@akkea.ca> Tested-by: Tomas Novotny <tomas@novotny.cz> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
37ada026be
commit
78ed050dd2
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue