OSDN Git Service

Add quirk for passing timestamps
authorAdriana Reus <adriana.reus@intel.com>
Mon, 2 Mar 2015 15:45:05 +0000 (17:45 +0200)
committerAdriana Reus <adriana.reus@intel.com>
Mon, 9 Mar 2015 10:14:29 +0000 (12:14 +0200)
I'd like to pass the timestamps we get from the iio channel unmodified
and without covering up potential issues. As much as possible.

Change-Id: I12303cec2d333638ef037dbf9c95318c0ec5461e
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
control.c
description.c
description.h

index 781d648..79856c6 100644 (file)
--- a/control.c
+++ b/control.c
@@ -1171,8 +1171,12 @@ static void stamp_reports (int dev_num, int64_t ts)
        int s;
 
        for (s=0; s<MAX_SENSORS; s++)
-               if (sensor[s].dev_num == dev_num && is_enabled(s) && sensor[s].mode != MODE_POLL)
-                       set_report_ts(s, ts);
+               if (sensor[s].dev_num == dev_num && is_enabled(s) && sensor[s].mode != MODE_POLL) {
+                       if (sensor[s].quirks & QUIRK_SPOTTY)
+                               set_report_ts(s, ts);
+                       else
+                               sensor[s].report_ts = ts;
+               }
 }
 
 
index cc3bdb7..9e0702d 100644 (file)
@@ -374,6 +374,9 @@ uint32_t sensor_get_quirks (int s)
                if (strstr(quirks_buf, "biased"))
                        sensor[s].quirks |= QUIRK_BIASED;
 
+               if (strstr(quirks_buf, "spotty"))
+                       sensor[s].quirks |= QUIRK_SPOTTY;
+
                sensor[s].quirks |= QUIRK_ALREADY_DECODED;
        }
 
index ab45c2b..9dffeec 100644 (file)
@@ -14,6 +14,7 @@
 #define QUIRK_NOISY            0x10  /* High noise level on readings         */
 #define QUIRK_FORCE_CONTINUOUS 0x20  /* Force usage of continuous trigger    */
 #define QUIRK_BIASED           0x40  /* Biased sensor, requires compensation */
+#define QUIRK_SPOTTY           0x80  /* Driver may lose events */
 
 #ifdef __LP64__
        typedef uint64_t        flag_t;