summaryrefslogtreecommitdiff
path: root/include/led_common.h
diff options
context:
space:
mode:
authorParth Malkan <parthmalkan@google.com>2022-04-15 08:53:38 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-04-15 20:38:14 +0000
commite97d2fc6ba6d88fa0c65ba9bb659bf8130a0478f (patch)
tree722693a128b559d8a292ffbc827063e3f28d52be /include/led_common.h
parent65e8633dfad7fdc4b69ba88cd1ada34b122ca269 (diff)
downloadchrome-ec-e97d2fc6ba6d88fa0c65ba9bb659bf8130a0478f.tar.gz
led: Make led_is_supported function overridable
Zephyr led code doesn't rely on hard coded led_ids and overrides led_is_supported function with custom implementation BRANCH=none BUG=b:227798487 TEST=BUILD Cq-Depend: chromium:3579759 Signed-off-by: Parth Malkan <parthmalkan@google.com> Change-Id: Idde6f522589bdff9c29c63b06983ac38329dbbf1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3585081 Reviewed-by: Wai-Hong Tam <waihong@google.com>
Diffstat (limited to 'include/led_common.h')
-rw-r--r--include/led_common.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/led_common.h b/include/led_common.h
index 1e4629a606..8e9f1441f3 100644
--- a/include/led_common.h
+++ b/include/led_common.h
@@ -10,13 +10,23 @@
#include "ec_commands.h"
-/* Defined in led_<board>.c */
+/* Defined in led_<board>.c, not needed if led_is_supported is overridden */
extern const enum ec_led_id supported_led_ids[];
-/* Defined in led_<board>.c */
+/* Defined in led_<board>.c, not needed if led_is_supported is overridden */
extern const int supported_led_ids_count;
/**
+ * Whether an LED is supported.
+ *
+ * @param led_id ID of LED to query.
+ *
+ * @returns 1 if LED is supported. 0 if it is not.
+ *
+ */
+__override_proto int led_is_supported(enum ec_led_id led_id);
+
+/**
* Enable or disable automatic control of an LED.
*
* @param led_id ID of LED to enable or disable automatic control.