summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/led.h24
-rw-r--r--include/tables_csum.h23
2 files changed, 25 insertions, 22 deletions
diff --git a/include/led.h b/include/led.h
index 8eeb5a7c6d3..43acca85719 100644
--- a/include/led.h
+++ b/include/led.h
@@ -9,13 +9,26 @@
struct udevice;
+enum led_state_t {
+ LEDST_OFF = 0,
+ LEDST_ON = 1,
+ LEDST_TOGGLE,
+#ifdef CONFIG_LED_BLINK
+ LEDST_BLINK,
+#endif
+
+ LEDST_COUNT,
+};
+
/**
* struct led_uc_plat - Platform data the uclass stores about each device
*
* @label: LED label
+ * @default_state: LED default state
*/
struct led_uc_plat {
const char *label;
+ enum led_state_t default_state;
};
/**
@@ -27,17 +40,6 @@ struct led_uc_priv {
int period_ms;
};
-enum led_state_t {
- LEDST_OFF = 0,
- LEDST_ON = 1,
- LEDST_TOGGLE,
-#ifdef CONFIG_LED_BLINK
- LEDST_BLINK,
-#endif
-
- LEDST_COUNT,
-};
-
struct led_ops {
/**
* set_state() - set the state of an LED
diff --git a/include/tables_csum.h b/include/tables_csum.h
index 5f7edc419ba..4812333093a 100644
--- a/include/tables_csum.h
+++ b/include/tables_csum.h
@@ -6,16 +6,17 @@
#ifndef _TABLES_CSUM_H_
#define _TABLES_CSUM_H_
-static inline u8 table_compute_checksum(void *v, int len)
-{
- u8 *bytes = v;
- u8 checksum = 0;
- int i;
-
- for (i = 0; i < len; i++)
- checksum -= bytes[i];
-
- return checksum;
-}
+/**
+ * table_compute_checksum() - Compute a table checksum
+ *
+ * This computes an 8-bit checksum for the configuration table.
+ * All bytes in the configuration table, including checksum itself and
+ * reserved bytes must add up to zero.
+ *
+ * @v: configuration table base address
+ * @len: configuration table size
+ * @return: the 8-bit checksum
+ */
+u8 table_compute_checksum(void *v, int len);
#endif