summaryrefslogtreecommitdiff
path: root/include/power_led.h
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-10-25 12:35:49 -0700
committerGerrit <chrome-bot@google.com>2012-10-25 14:12:11 -0700
commitd4bd167c33e205cab8e01b22975984c668d083b1 (patch)
tree162b5735b45a33e8e901e630307a23cf008e672d /include/power_led.h
parente228692eb2b3828ee39adf5a668e71208478226a (diff)
downloadchrome-ec-d4bd167c33e205cab8e01b22975984c668d083b1.tar.gz
Clean up LED and onewire modules
No functional changes. BUG=chrome-os-partner:15579 BRANCH=none TEST=powerled red, then powerled green Change-Id: I595b725c14d94133f7f151d0b92cabe0e0bcf4ca Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36577 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'include/power_led.h')
-rw-r--r--include/power_led.h42
1 files changed, 33 insertions, 9 deletions
diff --git a/include/power_led.h b/include/power_led.h
index ccee086f70..2fd7322095 100644
--- a/include/power_led.h
+++ b/include/power_led.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+/* Copyright (c) 2012 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.
*/
@@ -10,6 +10,8 @@
#include "common.h"
+/* Interface for LM4-based boards */
+
enum powerled_color {
POWERLED_OFF = 0,
POWERLED_RED,
@@ -18,6 +20,25 @@ enum powerled_color {
POWERLED_COLOR_COUNT /* Number of colors, not a color itself */
};
+#ifdef CONFIG_POWER_LED
+
+/**
+ * Set the power adapter LED
+ *
+ * @param color Color to set LED
+ *
+ * @return EC_SUCCESS, or non-zero if error.
+ */
+int powerled_set(enum powerled_color color);
+
+#else
+
+static inline int powerled_set(enum powerled_color color) { return 0; }
+
+#endif
+
+/* Interface for STM32-based boards */
+
enum powerled_state {
POWERLED_STATE_OFF,
POWERLED_STATE_ON,
@@ -31,16 +52,19 @@ enum powerled_config {
POWERLED_CONFIG_PWM,
};
-#if defined(CONFIG_TASK_POWERLED) || defined(CONFIG_POWER_LED)
-/* Set the power adapter LED to the specified color. */
-int powerled_set(enum powerled_color color);
+#ifdef CONFIG_TASK_POWERLED
-/* Set the power LED according to the specified state. */
+/**
+ * Set the power LED
+ *
+ * @param state Target state
+ */
void powerled_set_state(enum powerled_state state);
-#else /* CONFIG_TASK_POWERLED */
-static inline int powerled_set(enum powerled_color color) { return 0; }
+#else
+
static inline void powerled_set_state(enum powerled_state state) {}
-#endif /* CONFIG_TASK_POWERLED */
-#endif /* __CROS_EC_POWER_LED_H */
+#endif
+
+#endif /* __CROS_EC_POWER_LED_H */