OSDN Git Service

Merge branch e35fc5677585eb789efb5c02e2de084fbedcd67d into android/master
[android-x86/hardware-intel-libsensors.git] / common.h
index 09788a2..ddb27cd 100644 (file)
--- a/common.h
+++ b/common.h
@@ -5,6 +5,8 @@
 #ifndef __COMMON_H__
 #define __COMMON_H__
 
+#include <string.h>
+
 #define MAX_DEVICES    9       /* Check iio devices 0 to MAX_DEVICES-1 */
 #define MAX_SENSORS    12      /* We can handle as many sensors */
 #define MAX_CHANNELS   4       /* We can handle as many channels per sensor */
 #define DEV_FILE_PATH          "/dev/iio:device%d"
 #define BASE_PATH              "/sys/bus/iio/devices/iio:device%d/"
 #define TRIGGER_FILE_PATH      "/sys/bus/iio/devices/trigger%d/name"
+#define IIO_DEVICES            "/sys/bus/iio/devices/"
 
 #define CHANNEL_PATH           BASE_PATH "scan_elements/"
 #define ENABLE_PATH            BASE_PATH "buffer/enable"
+#define BUFFER_LENGTH_PATH     BASE_PATH "buffer/length"
 #define NAME_PATH              BASE_PATH "name"
 #define TRIGGER_PATH           BASE_PATH "trigger/current_trigger"
 #define EVENTS_PATH            BASE_PATH "events/"
@@ -30,6 +34,8 @@
 #define SENSOR_CALIB_BIAS_PATH BASE_PATH "in_%s_calibbias"
 #define MOUNTING_MATRIX_PATH   BASE_PATH "mounting_matrix"
 
+#define CONFIGFS_TRIGGER_PATH  "/sys/kernel/config/iio/triggers/"
+
 #define PROP_BASE              "ro.iio.%s.%s" /* Note: PROPERTY_KEY_MAX is small */
 
 #define MAX_TYPE_SPEC_LEN      32      /* Channel type spec len; ex: "le:u10/16>>0" */
@@ -153,6 +159,8 @@ typedef struct
        char vendor_name[MAX_NAME_SIZE];        /* ex: Intel                 */
        char init_trigger_name[MAX_NAME_SIZE];  /* ex: accel-name-dev1       */
        char motion_trigger_name[MAX_NAME_SIZE];/* ex: accel-any-motion-dev1 */
+       char hrtimer_trigger_name[MAX_NAME_SIZE]; /*ex: accel-hr-dev1 */
+       int trigger_nr; /* trigger number associated with this device */
        float max_range;
        float resolution;
        float power;
@@ -272,6 +280,12 @@ typedef struct
         */
        float mounting_matrix[9];
 
+       /** Count of available frequencies */
+       int avail_freqs_count;
+
+       /** Array of available frequencies */
+       float* avail_freqs;
+
        /*
         * Event counter - will be used to check if we have a significant sample for noisy sensors. We want to make sure we do not send any wrong
         * events before filtering kicks in. We can also use it for statistics.