summaryrefslogtreecommitdiffstats
path: root/sensors/lsm330dlc_acceleration.c
diff options
context:
space:
mode:
Diffstat (limited to 'sensors/lsm330dlc_acceleration.c')
-rw-r--r--sensors/lsm330dlc_acceleration.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/sensors/lsm330dlc_acceleration.c b/sensors/lsm330dlc_acceleration.c
index efb0388..5e571c7 100644
--- a/sensors/lsm330dlc_acceleration.c
+++ b/sensors/lsm330dlc_acceleration.c
@@ -20,6 +20,7 @@
#include <stdint.h>
#include <fcntl.h>
#include <errno.h>
+#include <string.h>
#include <hardware/sensors.h>
#include <hardware/hardware.h>
@@ -31,8 +32,6 @@
#include "ssp.h"
struct lsm330dlc_acceleration_data {
- struct smdk4x12_sensors_handlers *orientation_sensor;
-
char path_delay[PATH_MAX];
sensors_vec_t acceleration;
@@ -54,14 +53,6 @@ int lsm330dlc_acceleration_init(struct smdk4x12_sensors_handlers *handlers,
data = (struct lsm330dlc_acceleration_data *) calloc(1, sizeof(struct lsm330dlc_acceleration_data));
- for (i = 0; i < device->handlers_count; i++) {
- if (device->handlers[i] == NULL)
- continue;
-
- if (device->handlers[i]->handle == SENSOR_TYPE_ORIENTATION)
- data->orientation_sensor = device->handlers[i];
- }
-
input_fd = input_open("accelerometer_sensor");
if (input_fd < 0) {
ALOGE("%s: Unable to open input", __func__);
@@ -74,7 +65,7 @@ int lsm330dlc_acceleration_init(struct smdk4x12_sensors_handlers *handlers,
goto error;
}
- snprintf(data->path_delay, PATH_MAX, "%s/acc_poll_delay", path);
+ snprintf(data->path_delay, PATH_MAX, "%s/poll_delay", path);
handlers->poll_fd = input_fd;
handlers->data = (void *) data;
@@ -158,12 +149,12 @@ int lsm330dlc_acceleration_deactivate(struct smdk4x12_sensors_handlers *handlers
return 0;
}
-int lsm330dlc_acceleration_set_delay(struct smdk4x12_sensors_handlers *handlers, long int delay)
+int lsm330dlc_acceleration_set_delay(struct smdk4x12_sensors_handlers *handlers, int64_t delay)
{
struct lsm330dlc_acceleration_data *data;
int rc;
- ALOGD("%s(%p, %ld)", __func__, handlers, delay);
+ ALOGD("%s(%p, %" PRId64 ")", __func__, handlers, delay);
if (handlers == NULL || handlers->data == NULL)
return -EINVAL;
@@ -243,9 +234,6 @@ int lsm330dlc_acceleration_get_data(struct smdk4x12_sensors_handlers *handlers,
data->acceleration.y = event->acceleration.y;
data->acceleration.z = event->acceleration.z;
- if (data->orientation_sensor != NULL)
- orientation_fill(data->orientation_sensor, &event->acceleration, NULL);
-
return 0;
}