OSDN Git Service

[Activity HAL] Separation of common macros
authorCristina Ciocan <cristina.ciocan@intel.com>
Thu, 12 Feb 2015 13:35:39 +0000 (15:35 +0200)
committerAdriana Reus <adriana.reus@intel.com>
Fri, 27 Feb 2015 16:25:16 +0000 (18:25 +0200)
Moved in common.h all the DECLARE_* macros needed to define sensor catalog
entry, since we will be needing it in activity HAL's catalog as well.

Change-Id: I435d0a968980e6eb5e8414ddcf1b60f19476b894
Signed-off-by: Cristina Ciocan <cristina.ciocan@intel.com>
Reviewed-on: https://android.intel.com:443/331749

common.h
enumeration.h

index 9fcb914..809400b 100644 (file)
--- a/common.h
+++ b/common.h
@@ -293,5 +293,43 @@ void check_event_sensors (int i, char *sysfs_file, char map[catalog_size]);
 void discover_sensors(int dev_num, char *sysfs_base_path, char map[catalog_size],
                      void (*discover_sensor)(int, char*, char*));
 
 void discover_sensors(int dev_num, char *sysfs_base_path, char map[catalog_size],
                      void (*discover_sensor)(int, char*, char*));
 
+/*
+ * Macros associating iio sysfs entries to to sensor types ; see
+ * linux/kernel/drivers/iio/industrialio-core.c and
+ * hardware/libhardware/include/hardware/sensor.h
+ */
+
+#define DECLARE_VOID_CHANNEL(tag)      \
+                       tag,    \
+                       "",     \
+                       "",     \
+                       "",     \
+                       "",     \
+                       "",     \
+                       "",     \
+
+#define DECLARE_CHANNEL(tag, spacer, name)             \
+                       name,                           \
+                       "in_"tag spacer name"_en",      \
+                       "in_"tag spacer name"_type",    \
+                       "in_"tag spacer name"_index",   \
+                       "in_"tag spacer name"_raw",     \
+                       "in_"tag spacer name"_input",   \
+                       "in_"tag spacer name"_scale",   \
+                       0, {{0}},
+
+#define DECLARE_NAMED_CHANNEL(tag, name)       DECLARE_CHANNEL(tag, "_", name)
+
+#define DECLARE_GENERIC_CHANNEL(tag)           DECLARE_CHANNEL(tag, "", "")
+
+#define DECLARE_EVENT(tag, spacer1, name, spacer2, type, spacer3, dir)         \
+                     type, dir,                                                \
+                     "in_"tag spacer1 name spacer2 type spacer3 dir"_en",      \
+                     "in_"tag spacer1 name spacer2 type spacer3 dir"_value",   \
+
+#define DECLARE_GENERIC_EVENT(tag, name, type, dir) \
+               DECLARE_EVENT(tag, "_", name, "_", type, "_", dir)
+#define DECLARE_NAMED_EVENT(tag, name) \
+               DECLARE_EVENT(tag, "_", name, "","","","")
 
 #endif
 
 #endif
index fa79166..1915249 100644 (file)
@@ -7,45 +7,6 @@
 
 #include "common.h"
 
 
 #include "common.h"
 
-/*
- * Macros associating iio sysfs entries to to sensor types ; see
- * linux/kernel/drivers/iio/industrialio-core.c and
- * hardware/libhardware/include/hardware/sensor.h
- */
-
-#define DECLARE_VOID_CHANNEL(tag)      \
-                       tag,    \
-                       "",     \
-                       "",     \
-                       "",     \
-                       "",     \
-                       "",     \
-                       "",     \
-
-#define DECLARE_CHANNEL(tag, spacer, name)             \
-                       name,                           \
-                       "in_"tag spacer name"_en",      \
-                       "in_"tag spacer name"_type",    \
-                       "in_"tag spacer name"_index",   \
-                       "in_"tag spacer name"_raw",     \
-                       "in_"tag spacer name"_input",   \
-                       "in_"tag spacer name"_scale",   \
-                       0, {{0}},
-
-#define DECLARE_NAMED_CHANNEL(tag, name)       DECLARE_CHANNEL(tag, "_", name)
-
-#define DECLARE_GENERIC_CHANNEL(tag)           DECLARE_CHANNEL(tag, "", "")
-
-#define DECLARE_EVENT(tag, spacer1, name, spacer2, type, spacer3, dir)         \
-                     type, dir,                                                \
-                     "in_"tag spacer1 name spacer2 type spacer3 dir"_en",      \
-                     "in_"tag spacer1 name spacer2 type spacer3 dir"_value",   \
-
-#define DECLARE_GENERIC_EVENT(tag, name, type, dir) \
-               DECLARE_EVENT(tag, "_", name, "_", type, "_", dir)
-#define DECLARE_NAMED_EVENT(tag, name) \
-               DECLARE_EVENT(tag, "_", name, "","","","")
-
 int    get_sensors_list        (struct sensors_module_t* module,
                                 struct sensor_t const** list);
 
 int    get_sensors_list        (struct sensors_module_t* module,
                                 struct sensor_t const** list);