summaryrefslogtreecommitdiff
path: root/include/led.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/led.h')
-rw-r--r--include/led.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/led.h b/include/led.h
index 8af87ea..bbab4d1 100644
--- a/include/led.h
+++ b/include/led.h
@@ -33,6 +33,14 @@ struct led_ops {
* @return 0 if OK, -ve on error
*/
int (*set_state)(struct udevice *dev, enum led_state_t state);
+
+ /**
+ * led_get_state() - get the state of an LED
+ *
+ * @dev: LED device to change
+ * @return LED state led_state_t, or -ve on error
+ */
+ enum led_state_t (*get_state)(struct udevice *dev);
};
#define led_get_ops(dev) ((struct led_ops *)(dev)->driver->ops)
@@ -55,4 +63,12 @@ int led_get_by_label(const char *label, struct udevice **devp);
*/
int led_set_state(struct udevice *dev, enum led_state_t state);
+/**
+ * led_get_state() - get the state of an LED
+ *
+ * @dev: LED device to change
+ * @return LED state led_state_t, or -ve on error
+ */
+enum led_state_t led_get_state(struct udevice *dev);
+
#endif