OSDN Git Service

[REVERTME] Revert "Pass iio provided timestamps without further processing."
[android-x86/hardware-intel-libsensors.git] / enumeration.h
1 /*
2  * Copyright (C) 2014-2015 Intel Corporation.
3  */
4
5 #ifndef __ENUMERATION_H__
6 #define __ENUMERATION_H__
7
8 #include "common.h"
9
10 /*
11  * Macros associating iio sysfs entries to to sensor types ; see
12  * linux/kernel/drivers/iio/industrialio-core.c and
13  * hardware/libhardware/include/hardware/sensor.h
14  */
15
16 #define DECLARE_VOID_CHANNEL(tag)       \
17                         tag,    \
18                         "",     \
19                         "",     \
20                         "",     \
21                         "",     \
22                         "",     \
23                         "",     \
24
25 #define DECLARE_CHANNEL(tag, spacer, name)              \
26                         name,                           \
27                         "in_"tag spacer name"_en",      \
28                         "in_"tag spacer name"_type",    \
29                         "in_"tag spacer name"_index",   \
30                         "in_"tag spacer name"_raw",     \
31                         "in_"tag spacer name"_input",   \
32                         "in_"tag spacer name"_scale",   \
33                         0, {{0}},
34
35 #define DECLARE_NAMED_CHANNEL(tag, name)        DECLARE_CHANNEL(tag, "_", name)
36
37 #define DECLARE_GENERIC_CHANNEL(tag)            DECLARE_CHANNEL(tag, "", "")
38
39 #define DECLARE_EVENT(tag, spacer1, name, spacer2, type, spacer3, dir)          \
40                       type, dir,                                                \
41                       "in_"tag spacer1 name spacer2 type spacer3 dir"_en",      \
42                       "in_"tag spacer1 name spacer2 type spacer3 dir"_value",   \
43
44 #define DECLARE_GENERIC_EVENT(tag, name, type, dir) \
45                 DECLARE_EVENT(tag, "_", name, "_", type, "_", dir)
46 #define DECLARE_NAMED_EVENT(tag, name) \
47                 DECLARE_EVENT(tag, "_", name, "","","","")
48
49 int     get_sensors_list        (struct sensors_module_t* module,
50                                  struct sensor_t const** list);
51
52 void    enumerate_sensors       (void);
53 void    delete_enumeration_data (void);
54
55 #endif