aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/of.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2008-11-19of: Add helpers for finding device nodes which have a given propertyMichael Ellerman1-0/+6
This commit adds a routine for finding a device node which has a certain property. The contents of the property are not taken into account, merely the presence or absence of the property. Based on that routine, we add a for_each_ macro for iterating over all nodes that have a certain property. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-10-13of: Add new helper of_parse_phandles_with_args()Anton Vorontsov1-0/+3
The helper is factored out of of_get_gpio(). Will be used by the QE pin multiplexing functions (they need to parse the gpios = <> too). Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2008-07-25of: adapt of_find_i2c_driver() to be usable by SPI alsoGrant Likely1-0/+1
SPI has a similar problem as I2C in that it needs to determine an appropriate modalias value for each device node. This patch adapts the of_i2c of_find_i2c_driver() function to be usable by of_spi also. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2008-04-07[POWERPC] Add of_device_is_available functionJosh Boyer1-0/+1
IEEE 1275 defined a standard "status" property to indicate the operational status of a device. The property has four possible values: okay, disabled, fail, fail-xxx. The absence of this property means the operational status of the device is unknown or okay. This adds a function called of_device_is_available that checks the state of the status property of a device. If the property is absent or set to either "okay" or "ok", it returns 1. Otherwise it returns 0. Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-02-06[POWERPC] Add of_get_next_parent()Michael Ellerman1-0/+1
Iterating through a device node's parents is simple enough, but dealing with the refcounts properly is a little ugly, and replicating that logic is asking for someone to get it wrong or forget it all together, eg: while (dn != NULL) { /* loop body */ tmp = of_get_parent(dn); of_node_put(dn); dn = tmp; } So add of_get_next_parent(), inspired by of_get_next_child(). The contract is that it returns the parent and drops the reference on the current node, this makes the loop look like: while (dn != NULL) { /* loop body */ dn = of_get_next_parent(dn); } Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-01-17[POWERPC] Add of_find_matching_node() helper functionGrant Likely1-0/+8
Similar to of_find_compatible_node(), of_find_matching_node() and for_each_matching_node() allow you to iterate over the device tree looking for specific nodes, except that they take of_device_id tables instead of strings. This also moves of_match_node() from driver/of/device.c to driver/of/base.c to colocate it with the of_find_matching_node which depends on it. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-12-11[POWERPC] Add for_each_child_of_node() helper for iterating over child nodesMichael Ellerman1-0/+4
Add for_each_child_of_node() to encapsulate the common idiom of iterating over the children of a device_node. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Acked-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-10-19remove asm/bitops.h includesJiri Slaby1-1/+1
remove asm/bitops.h includes including asm/bitops directly may cause compile errors. don't include it and include linux/bitops instead. next patch will deny including asm header directly. Cc: Adrian Bunk <bunk@kernel.org> Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-08-17[POWERPC] Remove get_property and device_is_compatibleStephen Rothwell1-1/+0
They were only needed for backwards compatibility and all in tree uses have now been changed. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-07-20Split out common parts of prom.hStephen Rothwell1-0/+61
This creates linux/of.h and includes asm/prom.h from it. We also include linux/of.h from asm/prom.h while we transition. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Paul Mackerras <paulus@samba.org> Acked-by: David S. Miller <davem@davemloft.net>