summaryrefslogtreecommitdiff
path: root/include/als.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/als.h')
-rw-r--r--include/als.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/als.h b/include/als.h
new file mode 100644
index 0000000000..e229a3791f
--- /dev/null
+++ b/include/als.h
@@ -0,0 +1,32 @@
+/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef __CROS_EC_ALS_H
+#define __CROS_EC_ALS_H
+
+#include "common.h"
+
+/* Defined in board.h */
+enum als_id;
+
+/* Initialized in board.c */
+struct als_t {
+ const char const *name;
+ int (*read)(int *lux);
+};
+
+extern struct als_t als[];
+
+/**
+ * Read an ALS
+ *
+ * @param id Which one?
+ * @param lux Put value here
+ *
+ * @return EC_SUCCESS, or non-zero if error.
+ */
+int als_read(enum als_id id, int *lux);
+
+#endif /* __CROS_EC_ALS_H */