summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2023-02-03 12:10:48 +0300
committerHans de Goede <hdegoede@redhat.com>2023-02-03 12:10:48 +0300
commit39f09320500c74a9777fc274d15acd3f0bac41ae (patch)
treed99836f7ed13ac975dfdd35224208a0ca9054dfe /include/linux
parent391bb17d71d7c93987ccc55fa303127fe6cd6775 (diff)
parentabc3100fcba6827444ef4bdb17065ac3b6619dff (diff)
downloadlinux-39f09320500c74a9777fc274d15acd3f0bac41ae.tar.xz
Merge tag 'ib-leds-led_get-v6.3' into HEAD
Immutable branch from LEDs due for the v6.3 merge window
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/leds.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/leds.h b/include/linux/leds.h
index ba4861ec73d3..31cb74b90ffc 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -39,6 +39,21 @@ enum led_default_state {
LEDS_DEFSTATE_KEEP = 2,
};
+/**
+ * struct led_lookup_data - represents a single LED lookup entry
+ *
+ * @list: internal list of all LED lookup entries
+ * @provider: name of led_classdev providing the LED
+ * @dev_id: name of the device associated with this LED
+ * @con_id: name of the LED from the device's point of view
+ */
+struct led_lookup_data {
+ struct list_head list;
+ const char *provider;
+ const char *dev_id;
+ const char *con_id;
+};
+
struct led_init_data {
/* device fwnode handle */
struct fwnode_handle *fwnode;
@@ -211,6 +226,12 @@ void devm_led_classdev_unregister(struct device *parent,
void led_classdev_suspend(struct led_classdev *led_cdev);
void led_classdev_resume(struct led_classdev *led_cdev);
+void led_add_lookup(struct led_lookup_data *led_lookup);
+void led_remove_lookup(struct led_lookup_data *led_lookup);
+
+struct led_classdev *__must_check led_get(struct device *dev, char *con_id);
+struct led_classdev *__must_check devm_led_get(struct device *dev, char *con_id);
+
extern struct led_classdev *of_led_get(struct device_node *np, int index);
extern void led_put(struct led_classdev *led_cdev);
struct led_classdev *__must_check devm_of_led_get(struct device *dev,