summaryrefslogtreecommitdiffstats
path: root/sensors/k3dh.c
diff options
context:
space:
mode:
Diffstat (limited to 'sensors/k3dh.c')
-rw-r--r--sensors/k3dh.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/sensors/k3dh.c b/sensors/k3dh.c
index 955f33a..fb1db59 100644
--- a/sensors/k3dh.c
+++ b/sensors/k3dh.c
@@ -31,9 +31,7 @@
#include "k3dh.h"
struct k3dh_data {
- struct smdk4210_sensors_handlers *orientation_sensor;
-
- long int delay;
+ int64_t delay;
int device_fd;
int uinput_fd;
@@ -49,7 +47,7 @@ void *k3dh_thread(void *thread_data)
struct input_event event;
struct timeval time;
struct k3dh_acceldata acceleration_data;
- long int before, after;
+ int64_t before, after;
int diff;
int device_fd;
int uinput_fd;
@@ -130,14 +128,6 @@ int k3dh_init(struct smdk4210_sensors_handlers *handlers,
data = (struct k3dh_data *) calloc(1, sizeof(struct k3dh_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];
- }
-
device_fd = open("/dev/accelerometer", O_RDONLY);
if (device_fd < 0) {
ALOGE("%s: Unable to open device", __func__);
@@ -301,14 +291,14 @@ int k3dh_deactivate(struct smdk4210_sensors_handlers *handlers)
return 0;
}
-int k3dh_set_delay(struct smdk4210_sensors_handlers *handlers, long int delay)
+int k3dh_set_delay(struct smdk4210_sensors_handlers *handlers, int64_t delay)
{
struct k3dh_data *data;
int64_t d;
int device_fd;
int rc;
- ALOGD("%s(%p, %ld)", __func__, handlers, delay);
+ ALOGD("%s(%p, %" PRId64 ")", __func__, handlers, delay);
if (handlers == NULL || handlers->data == NULL)
return -EINVAL;
@@ -360,7 +350,7 @@ int k3dh_get_data(struct smdk4210_sensors_handlers *handlers,
event->sensor = handlers->handle;
event->type = handlers->handle;
- event->magnetic.status = SENSOR_STATUS_ACCURACY_MEDIUM;
+ event->acceleration.status = SENSOR_STATUS_ACCURACY_MEDIUM;
do {
rc = read(input_fd, &input_event, sizeof(input_event));
@@ -387,9 +377,6 @@ int k3dh_get_data(struct smdk4210_sensors_handlers *handlers,
}
} while (input_event.type != EV_SYN);
- if (data->orientation_sensor != NULL)
- orientation_fill(data->orientation_sensor, &event->acceleration, NULL);
-
return 0;
}