Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336562
b: refs/heads/master
c: 07c1211
h: refs/heads/master
v: v3
  • Loading branch information
Marek Belisko authored and Grant Likely committed Nov 21, 2012
1 parent 79c9a18 commit 01d2bac
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 37 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 50c8af4cf98fd97d6779f244215154e4c89699c7
refs/heads/master: 07c121149cb30405b37ceae3cd29e5b6b6e65cc0
14 changes: 4 additions & 10 deletions trunk/Documentation/devicetree/bindings/gpio/led.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,10 @@ LED sub-node properties:
- gpios : Should specify the LED's GPIO, see "gpios property" in
Documentation/devicetree/bindings/gpio/gpio.txt. Active low LEDs should be
indicated using flags in the GPIO specifier.
- label : (optional) The label for this LED. If omitted, the label is
taken from the node name (excluding the unit address).
- linux,default-trigger : (optional) This parameter, if present, is a
string defining the trigger assigned to the LED. Current triggers are:
"backlight" - LED will act as a back-light, controlled by the framebuffer
system
"default-on" - LED will turn on, but see "default-state" below
"heartbeat" - LED "double" flashes at a load average based rate
"ide-disk" - LED indicates disk activity
"timer" - LED flashes at a fixed, configurable rate
- label : (optional)
see Documentation/devicetree/bindings/leds/common.txt
- linux,default-trigger : (optional)
see Documentation/devicetree/bindings/leds/common.txt
- default-state: (optional) The initial state of the LED. Valid
values are "on", "off", and "keep". If the LED is already on or off
and the default-state property is set the to same value, then no
Expand Down
23 changes: 23 additions & 0 deletions trunk/Documentation/devicetree/bindings/leds/common.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Common leds properties.

Optional properties for child nodes:
- label : The label for this LED. If omitted, the label is
taken from the node name (excluding the unit address).

- linux,default-trigger : This parameter, if present, is a
string defining the trigger assigned to the LED. Current triggers are:
"backlight" - LED will act as a back-light, controlled by the framebuffer
system
"default-on" - LED will turn on (but for leds-gpio see "default-state"
property in Documentation/devicetree/bindings/gpio/led.txt)
"heartbeat" - LED "double" flashes at a load average based rate
"ide-disk" - LED indicates disk activity
"timer" - LED flashes at a fixed, configurable rate

Examples:

system-status {
label = "Status";
linux,default-trigger = "heartbeat";
...
};
18 changes: 5 additions & 13 deletions trunk/drivers/of/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,35 +594,27 @@ const struct of_device_id *of_match_node(const struct of_device_id *matches,
EXPORT_SYMBOL(of_match_node);

/**
* of_find_matching_node_and_match - Find a node based on an of_device_id
* match table.
* of_find_matching_node - Find a node based on an of_device_id match
* table.
* @from: The node to start searching from or NULL, the node
* you pass will not be searched, only the next one
* will; typically, you pass what the previous call
* returned. of_node_put() will be called on it
* @matches: array of of device match structures to search in
* @match Updated to point at the matches entry which matched
*
* Returns a node pointer with refcount incremented, use
* of_node_put() on it when done.
*/
struct device_node *of_find_matching_node_and_match(struct device_node *from,
const struct of_device_id *matches,
const struct of_device_id **match)
struct device_node *of_find_matching_node(struct device_node *from,
const struct of_device_id *matches)
{
struct device_node *np;

if (match)
*match = NULL;

read_lock(&devtree_lock);
np = from ? from->allnext : allnodes;
for (; np; np = np->allnext) {
if (of_match_node(matches, np) && of_node_get(np)) {
if (match)
*match = matches;
if (of_match_node(matches, np) && of_node_get(np))
break;
}
}
of_node_put(from);
read_unlock(&devtree_lock);
Expand Down
15 changes: 2 additions & 13 deletions trunk/include/linux/of.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,22 +179,11 @@ extern struct device_node *of_find_compatible_node(struct device_node *from,
#define for_each_compatible_node(dn, type, compatible) \
for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
dn = of_find_compatible_node(dn, type, compatible))
extern struct device_node *of_find_matching_node_and_match(
struct device_node *from,
const struct of_device_id *matches,
const struct of_device_id **match);
static inline struct device_node *of_find_matching_node(
struct device_node *from,
const struct of_device_id *matches)
{
return of_find_matching_node_and_match(from, matches, NULL);
}
extern struct device_node *of_find_matching_node(struct device_node *from,
const struct of_device_id *matches);
#define for_each_matching_node(dn, matches) \
for (dn = of_find_matching_node(NULL, matches); dn; \
dn = of_find_matching_node(dn, matches))
#define for_each_matching_node_and_match(dn, matches, match) \
for (dn = of_find_matching_node_and_match(NULL, matches, match); \
dn; dn = of_find_matching_node_and_match(dn, matches, match))
extern struct device_node *of_find_node_by_path(const char *path);
extern struct device_node *of_find_node_by_phandle(phandle handle);
extern struct device_node *of_get_parent(const struct device_node *node);
Expand Down

0 comments on commit 01d2bac

Please sign in to comment.