1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-19 21:04:26 +00:00
Hans de Goede abc3100fcb leds: led-class: Add generic [devm_]led_get()
Add a generic [devm_]led_get() method which can be used on both devicetree
and non devicetree platforms to get a LED classdev associated with
a specific function on a specific device, e.g. the privacy LED associated
with a specific camera sensor.

Note unlike of_led_get() this takes a string describing the function
rather then an index. This is done because e.g. camera sensors might
have a privacy LED, or a flash LED, or both and using an index
approach leaves it unclear what the function of index 0 is if there is
only 1 LED.

This uses a lookup-table mechanism for non devicetree platforms.
This allows the platform code to map specific LED class_dev-s to a specific
device,function combinations this way.

For devicetree platforms getting the LED by function-name could be made
to work using the standard devicetree pattern of adding a -names string
array to map names to the indexes.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20230120114524.408368-5-hdegoede@redhat.com
2023-01-27 11:07:11 +00:00
..
2022-12-21 09:37:14 -08:00
2022-12-15 09:45:51 -08:00
2022-12-11 21:25:58 +01:00
2022-12-21 09:19:24 -08:00
2022-12-15 13:12:15 -08:00
2022-12-12 15:19:38 -08:00
2022-12-17 14:06:53 -06:00
2022-12-13 15:47:48 -08:00
2022-12-19 08:47:33 -06:00
2022-12-13 10:43:59 -08:00
2022-12-13 10:43:59 -08:00
2022-12-13 10:43:59 -08:00
2022-12-08 18:25:31 -08:00
2022-12-12 15:48:36 -08:00
2022-12-13 15:47:48 -08:00
2022-12-13 19:29:45 -08:00
2022-12-11 18:12:17 -08:00
2022-12-16 03:54:54 -08:00
2022-12-13 10:33:08 -08:00
2022-12-17 14:06:53 -06:00
2022-12-13 09:47:48 -08:00
2022-12-12 19:30:18 -08:00
2022-12-14 09:15:43 -08:00
2022-12-16 03:54:54 -08:00
2022-12-11 19:30:20 -08:00
2022-12-15 11:12:21 -08:00
2022-12-13 09:47:48 -08:00
2022-12-13 09:47:48 -08:00
2022-12-15 11:12:21 -08:00
2022-12-13 19:29:45 -08:00
2022-12-13 15:47:48 -08:00
2022-12-15 11:12:21 -08:00
2022-12-14 09:54:10 -08:00
2022-12-17 14:06:53 -06:00
2022-12-20 03:13:45 +01:00
2022-12-16 03:54:54 -08:00
2022-12-21 09:41:28 -08:00
2022-12-13 15:47:48 -08:00
2022-12-12 09:01:36 -08:00
2022-12-13 19:29:45 -08:00
2022-12-13 09:47:48 -08:00
2022-12-09 19:47:41 -08:00
2022-12-12 09:13:06 -08:00
2022-12-11 18:12:19 -08:00
2022-12-10 13:36:05 -05:00
2022-12-13 10:43:59 -08:00
2022-12-16 03:54:54 -08:00
2022-12-15 13:12:15 -08:00