summaryrefslogtreecommitdiffstats
path: root/libsensors
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-01-13 11:35:59 +0100
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-01-13 11:35:59 +0100
commit3da293a08c6f53958eb1339dcbead2976bb9949a (patch)
treef46923ebdae45adb28b24eb946042152a4ef856e /libsensors
parenta7adca16f465ba0119247785aaf3f9d45afd24d1 (diff)
downloaddevice_samsung_i9300-3da293a08c6f53958eb1339dcbead2976bb9949a.zip
device_samsung_i9300-3da293a08c6f53958eb1339dcbead2976bb9949a.tar.gz
device_samsung_i9300-3da293a08c6f53958eb1339dcbead2976bb9949a.tar.bz2
Revert "i9300: libsensors: fix a couple of poll_delay derps"
This reverts commit c6f16d5c1fc1a803cba6674cc0d67156c222efec.
Diffstat (limited to 'libsensors')
-rw-r--r--libsensors/AccelSensor.cpp2
-rw-r--r--libsensors/ProximitySensor.cpp14
2 files changed, 13 insertions, 3 deletions
diff --git a/libsensors/AccelSensor.cpp b/libsensors/AccelSensor.cpp
index fddb2cd..1a5510c 100644
--- a/libsensors/AccelSensor.cpp
+++ b/libsensors/AccelSensor.cpp
@@ -107,7 +107,7 @@ int AccelSensor::setDelay(int32_t handle, int64_t ns)
ns = 10000000; // Minimum on stock
}
- strcpy(&input_sysfs_path[input_sysfs_path_len], "poll_delay");
+ strcpy(&input_sysfs_path[input_sysfs_path_len], "acc_poll_delay");
fd = open(input_sysfs_path, O_RDWR);
if (fd >= 0) {
char buf[80];
diff --git a/libsensors/ProximitySensor.cpp b/libsensors/ProximitySensor.cpp
index 9e5d7d1..2ba56c1 100644
--- a/libsensors/ProximitySensor.cpp
+++ b/libsensors/ProximitySensor.cpp
@@ -73,8 +73,18 @@ int ProximitySensor::setInitialState() {
int ProximitySensor::setDelay(int32_t handle, int64_t ns)
{
- // unsupported
- return 0;
+ int fd;
+
+ strcpy(&input_sysfs_path[input_sysfs_path_len], "prox_poll_delay");
+ fd = open(input_sysfs_path, O_RDWR);
+ if (fd >= 0) {
+ char buf[80];
+ sprintf(buf, "%lld", ns);
+ write(fd, buf, strlen(buf)+1);
+ close(fd);
+ return 0;
+ }
+ return -1;
}
int ProximitySensor::enable(int32_t handle, int en) {