Commit bd7bd0cc authored by Hartmut Knaack's avatar Hartmut Knaack Committed by Jonathan Cameron

iio:light:cm3323: clear bitmask before set

When setting the bits for integration time, the appropriate bitmask needs
to be cleared first.
Signed-off-by: default avatarHartmut Knaack <knaack.h@gmx.de>
Cc: <Stable@vger.kernel.org>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 815983e9
...@@ -123,7 +123,7 @@ static int cm3323_set_it_bits(struct cm3323_data *data, int val, int val2) ...@@ -123,7 +123,7 @@ static int cm3323_set_it_bits(struct cm3323_data *data, int val, int val2)
for (i = 0; i < ARRAY_SIZE(cm3323_int_time); i++) { for (i = 0; i < ARRAY_SIZE(cm3323_int_time); i++) {
if (val == cm3323_int_time[i].val && if (val == cm3323_int_time[i].val &&
val2 == cm3323_int_time[i].val2) { val2 == cm3323_int_time[i].val2) {
reg_conf = data->reg_conf; reg_conf = data->reg_conf & ~CM3323_CONF_IT_MASK;
reg_conf |= i << CM3323_CONF_IT_SHIFT; reg_conf |= i << CM3323_CONF_IT_SHIFT;
ret = i2c_smbus_write_word_data(data->client, ret = i2c_smbus_write_word_data(data->client,
......
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