This patch prevents disable sensor after read info raw data when
events are enabled.
Change-Id: Ifc160e7aa5a633c5dc976ea8b775a790a0efaf69
Signed-off-by: Lukasz Czerwinski <l.czerwinski@samsung.com>
*val = *val >> ch->scan_type.shift;
- err = st_sensors_set_enable(indio_dev, false);
+ /*
+ * When events are enabled sensor should be always enabled.
+ * It prevents unnecessary sensor off.
+ */
+ if (!sdata->events_flag)
+ err = st_sensors_set_enable(indio_dev, false);
}
mutex_unlock(&indio_dev->mlock);