Commit f87fa261 authored by Mikko Koivunen's avatar Mikko Koivunen Committed by Jonathan Cameron

iio: light: rpr0521 disable sensor -bugfix

Sensor was marked enabled on each call even if the call was for disabling
sensor.
Signed-off-by: default avatarMikko Koivunen <mikko.koivunen@fi.rohmeurope.com>
Acked-by: default avatarDaniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 52325ff4
......@@ -197,7 +197,10 @@ static int rpr0521_als_enable(struct rpr0521_data *data, u8 status)
if (ret < 0)
return ret;
data->als_dev_en = true;
if (status & RPR0521_MODE_ALS_MASK)
data->als_dev_en = true;
else
data->als_dev_en = false;
return 0;
}
......@@ -212,7 +215,10 @@ static int rpr0521_pxs_enable(struct rpr0521_data *data, u8 status)
if (ret < 0)
return ret;
data->pxs_dev_en = true;
if (status & RPR0521_MODE_PXS_MASK)
data->pxs_dev_en = true;
else
data->pxs_dev_en = false;
return 0;
}
......
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