forked from torvalds/linux
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
leds: Add common LED binding parsing support to LED class/core
Qucik grep for 'for_each' or 'linux,default-trigger' or 'default-state' under drivers/leds can tell quite a lot. It seems multiple LED controller drivers implement the very similar looping through the child nodes in order to locate the LED nodes and read and support the common LED dt bindings. Implementing this same stuff for all LED controllers gets old pretty fast. This commit adds support for locating the LED node (based on known node names - or linux,led-compatible property) and handling of few common LED properties. linux,default-trigger, default-state (with the exception of keep), (in addition to already handled function-enumerator, function, color and label). Regarding the node look-up: If no init_data is given, then no node-lookup is done and cdev name is used as such. If init_data is goven but no starting point for node lookup - then (parent) device's own DT node is used. If no led-compatible is given, then of_match is searched for. If neither led-compatible not of_match is given then device's own node or passed starting point are used as such. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
- Loading branch information
1 parent
4f0bd16
commit 7b8033c
Showing
3 changed files
with
360 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.