OSDN Git Service

Merge branch 'lineage-16.0' of https://github.com/me176c-dev/android_hardware_iio...
[android-x86/hardware-intel-libsensors.git] / enumeration.h
index 059213d..2ba6399 100644 (file)
@@ -1,91 +1,35 @@
 /*
- * Copyright (C) 2014 Intel Corporation.
- */
+// Copyright (c) 2015 Intel Corporation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+*/
 
 #ifndef __ENUMERATION_H__
 #define __ENUMERATION_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_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",   \
-                },
-
-#define DECLARE_NAMED_CHANNEL(tag, name)       DECLARE_CHANNEL(tag, "_", name)
-
-#define DECLARE_GENERIC_CHANNEL(tag)           DECLARE_CHANNEL(tag, "", "")
-
-#define DECLARE_VIRTUAL(type)                  \
-{                                                      \
-       "", type, 0, 1,                         \
-       {                                               \
-               DECLARE_GENERIC_CHANNEL("")             \
-       }                                               \
-},
-
-#define DECLARE_SENSOR0(tag, type)                     \
-{                                                      \
-       tag, type, 1, 0,                                        \
-       {                                               \
-               DECLARE_GENERIC_CHANNEL(tag)            \
-       }                                               \
-},
-
-#define DECLARE_SENSOR1(tag, type, ch1)                        \
-{                                                      \
-       tag, type, 1, 0,                                        \
-       {                                               \
-               DECLARE_NAMED_CHANNEL(tag, ch1)         \
-       }                                               \
-},
-
-#define DECLARE_SENSOR2(tag, type, ch1, ch2)           \
-{                                                      \
-       tag, type, 2, 0,                                        \
-       {                                               \
-               DECLARE_NAMED_CHANNEL(tag, ch1)         \
-               DECLARE_NAMED_CHANNEL(tag, ch2)         \
-       }                                               \
-},
-
-#define DECLARE_SENSOR3(tag, type, ch1, ch2, ch3)      \
-{                                                      \
-       tag, type, 3, 0,                                \
-       {                                               \
-               DECLARE_NAMED_CHANNEL(tag, ch1)         \
-               DECLARE_NAMED_CHANNEL(tag, ch2)         \
-               DECLARE_NAMED_CHANNEL(tag, ch3)         \
-       }                                               \
-},
-
-#define DECLARE_SENSOR4(tag, type, ch1, ch2, ch3, ch4) \
-{                                                      \
-       tag, type, 4, 0,                                        \
-       {                                               \
-               DECLARE_NAMED_CHANNEL(tag, ch1)         \
-               DECLARE_NAMED_CHANNEL(tag, ch2)         \
-               DECLARE_NAMED_CHANNEL(tag, ch3)         \
-               DECLARE_NAMED_CHANNEL(tag, ch4)         \
-       }                                               \
-},
-
 int    get_sensors_list        (struct sensors_module_t* module,
                                 struct sensor_t const** list);
 
 void   enumerate_sensors       (void);
 void   delete_enumeration_data (void);
 
+/*
+ * These are fine-grained type definitions that are used internally, in the sensor array, but mapped to an Android sensor type in the processing pipeline.
+ * The sensor array uses these, not the desc array.
+ */
+#define SENSOR_TYPE_INTERNAL_ILLUMINANCE       -1      /* Global illuminance, in lux                            */
+#define SENSOR_TYPE_INTERNAL_INTENSITY         -2      /* Global intensity, in sensor specific units            */
+
 #endif