]> git.baikalelectronics.ru Git - kernel.git/commit
iio: hid-sensor: Store restore poll and hysteresis on S3
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Sat, 8 Apr 2017 00:13:17 +0000 (17:13 -0700)
committerJonathan Cameron <jic23@kernel.org>
Sat, 8 Apr 2017 14:13:36 +0000 (15:13 +0100)
commitb0aa35e51d98409b9109049ff997935e08c5d2b1
tree305609e2526bcb3432b5b0abc98efe074c822d48
parent37dcbf9c5f55a9337339c1188bc30976efdc11d4
iio: hid-sensor: Store restore poll and hysteresis on S3

This change undo the change done by 'commit b711f2908c29
("iio: hid-sensor-trigger: Change get poll value function order to avoid
sensor properties losing after resume from S3")' as this breaks some
USB/i2c sensor hubs.

Instead of relying on HW for restoring poll and hysteresis, driver stores
and restores on resume (S3). In this way user space modified settings are
not lost for any kind of sensor hub behavior.

In this change, whenever user space modifies sampling frequency or
hysteresis driver will get the feature value from the hub and store in the
per device hid_sensor_common data structure. On resume callback from S3,
system will set the feature to sensor hub, if user space ever modified the
feature value.

Fixes: b711f2908c29 ("iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3")
Reported-by: Ritesh Raj Sarraf <rrs@researchut.com>
Tested-by: Ritesh Raj Sarraf <rrs@researchut.com>
Tested-by: Song, Hongyan <hongyan.song@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/common/hid-sensors/hid-sensor-attributes.c
drivers/iio/common/hid-sensors/hid-sensor-trigger.c
include/linux/hid-sensor-hub.h