OSDN Git Service

sens: update properties name and value max size
[android-x86/hardware-intel-libsensors.git] / entry.c
diff --git a/entry.c b/entry.c
index df449db..5868c4c 100644 (file)
--- a/entry.c
+++ b/entry.c
@@ -58,7 +58,18 @@ static int poll(struct sensors_poll_device_t* dev, sensors_event_t* data,
        return sensor_poll(data, count);
 }
 
+static int batch (struct sensors_poll_device_1* dev,
+            int sensor_handle, int flags, int64_t sampling_period_ns,
+            int64_t max_report_latency_ns)
+{
+       return set_delay ((struct sensors_poll_device_t*)dev,
+               sensor_handle, sampling_period_ns);
+}
 
+static int flush(struct sensors_poll_device_1* dev, int handle)
+{
+       return sensor_flush (handle);
+}
 static int close_module(hw_device_t *device)
 {
        if (init_count == 0)
@@ -79,19 +90,21 @@ static int close_module(hw_device_t *device)
 static int initialize_module(const struct hw_module_t *module, const char *id,
                                struct hw_device_t** device)
 {
-       static struct sensors_poll_device_t poll_device;
+       static struct sensors_poll_device_1 poll_device;
 
        if (strcmp(id, SENSORS_HARDWARE_POLL))
                 return -EINVAL;
 
        poll_device.common.tag          = HARDWARE_DEVICE_TAG;
-       poll_device.common.version      = SENSORS_DEVICE_API_VERSION_0_1;
+       poll_device.common.version      = SENSORS_DEVICE_API_VERSION_1_3;
        poll_device.common.module       = (struct hw_module_t*) module;
        poll_device.common.close        = close_module;
 
        poll_device.activate            = activate;
        poll_device.setDelay            = set_delay;
        poll_device.poll                = poll;
+       poll_device.batch               = batch;
+       poll_device.flush               = flush;
 
        *device = &poll_device.common;
 
@@ -117,7 +130,7 @@ struct sensors_module_t __attribute__ ((visibility ("default")))
                .common = {
                        .tag = HARDWARE_MODULE_TAG,
                        .version_major = 1,
-                       .version_minor = 0,
+                       .version_minor = 3,
                        .id = SENSORS_HARDWARE_MODULE_ID,
                        .name = "IIO sensors HAL",
                        .author = "Intel",