summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaadi Maalem <saadi.maalem@intel.com>2015-09-17 15:55:36 +0800
committerZhengyin Qian <qianzy@google.com>2015-09-23 13:33:24 -0700
commit3b77ab138a9c20edc4d6be12cf4ae7a3709cdf5d (patch)
tree53bd48508ac9c3822a0c2a8023c0298d649ae93f
parentaedbd2bfdcf85c9d2fdb4b95098c2c501048ef3f (diff)
downloadsensors-3b77ab138a9c20edc4d6be12cf4ae7a3709cdf5d.tar.gz
sensor: remove unnecessary set_delay and batch function implementation
set_delay and batch function is no necessary for tilt, removed to avoid unexpected change. Change-Id: If0efc779ac9f17c7ff0fc240b9aba6c5fd67fa0a Tracked-On: https://jira.ndg.intel.com/browse/MARVIN-746 Signed-off-by: Like Yan <like.yan@intel.com> Reviewed-on: https://android.intel.com/412303 Reviewed-by: Tasayco Loarte, VictorX <victorx.tasayco.loarte@intel.com> Reviewed-by: Hadjimegrian, MathieuX <mathieux.hadjimegrian@intel.com> Tested-by: Hadjimegrian, MathieuX <mathieux.hadjimegrian@intel.com> Reviewed-by: Maalem, Saadi <saadi.maalem@intel.com>
-rw-r--r--tilt/TiltSensor.cpp57
-rw-r--r--tilt/TiltSensor.h4
2 files changed, 0 insertions, 61 deletions
diff --git a/tilt/TiltSensor.cpp b/tilt/TiltSensor.cpp
index f4967b6..93aefc8 100644
--- a/tilt/TiltSensor.cpp
+++ b/tilt/TiltSensor.cpp
@@ -27,8 +27,6 @@
#include "TiltSensor.h"
-
-
TiltSensor::TiltSensor()
: SensorBase(NULL, "lis3dsh_acc"),
mEnabled(0),
@@ -46,32 +44,6 @@ TiltSensor::~TiltSensor() {
}
}
-int TiltSensor::setDelay(int32_t /* handle */, int64_t ns)
-{
- int fd;
- int n, len, ms, ret = 0;
- char buf[6];
- char sysfs_path[SYSFS_MAX_PATH_LEN];
-
- ms = ns / 1000000;
-
- snprintf(sysfs_path, SYSFS_MAX_PATH_LEN, "%s/%s", INPUT_SYSFS_BASE, POLL_PERIOD_MS);
- fd = open(sysfs_path, O_RDWR);
- if (fd > 0) {
- len = 6;
- memset(buf, 0, len);
- snprintf(buf, len, "%d", ms);
- write(fd, buf, sizeof(buf));
- close(fd);
- } else {
- ret = -EIO;
- ALOGE("file open failure\n");
- goto error_free;
- }
-
-error_free:
- return ret;
-}
int TiltSensor::enable(int32_t /* handle */, int en)
{
int ret = 0;
@@ -136,35 +108,6 @@ int TiltSensor::isActivated(int /* handle */)
return mEnabled;
}
-#ifdef HAL_VERSION_GT_1_0
-int TiltSensor::batch(int /* handle */, int /* flags */, int64_t period_ns, int64_t /* timeout */)
-{
- int fd;
- int n, len, ms, ret = 0;
- char buf[6];
- char sysfs_path[SYSFS_MAX_PATH_LEN];
-
- ms = period_ns / 1000000;
-
- snprintf(sysfs_path, SYSFS_MAX_PATH_LEN, "%s/%s", INPUT_SYSFS_BASE, POLL_PERIOD_MS);
- fd = open(sysfs_path, O_RDWR);
- if (fd > 0) {
- len = 6;
- memset(buf, 0, len);
- snprintf(buf, len, "%d", ms);
- write(fd, buf, sizeof(buf));
- close(fd);
- } else {
- ret = -EIO;
- ALOGE("file open failure\n");
- goto error_free;
- }
-
-error_free:
- return ret;
-}
-#endif
-
int TiltSensor::readEvents(sensors_event_t* data, int count)
{
if (count < 1)
diff --git a/tilt/TiltSensor.h b/tilt/TiltSensor.h
index 2d0b4e2..707ba8b 100644
--- a/tilt/TiltSensor.h
+++ b/tilt/TiltSensor.h
@@ -47,12 +47,8 @@ public:
virtual ~TiltSensor();
virtual int readEvents(sensors_event_t* data, int count);
- virtual int setDelay(int32_t handle, int64_t ns);
virtual int enable(int32_t handle, int enabled);
virtual int isActivated(int handle);
-#ifdef HAL_VERSION_GT_1_0
- virtual int batch(int handle, int flags, int64_t period_ns, int64_t timeout);
-#endif
private:
int mEnabled;