Linux Kernel
3.7.1
|
#include <linux/ctype.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <linux/proc_fs.h>
Go to the source code of this file.
Data Structures | |
struct | alias_prop |
Variables | |
struct device_node * | allnodes |
struct device_node * | of_chosen |
struct device_node * | of_aliases |
DEFINE_RWLOCK | ( | devtree_lock | ) |
EXPORT_SYMBOL | ( | of_n_addr_cells | ) |
EXPORT_SYMBOL | ( | of_n_size_cells | ) |
EXPORT_SYMBOL | ( | of_find_property | ) |
EXPORT_SYMBOL | ( | of_find_all_nodes | ) |
EXPORT_SYMBOL | ( | of_get_property | ) |
EXPORT_SYMBOL | ( | of_device_is_compatible | ) |
EXPORT_SYMBOL | ( | of_machine_is_compatible | ) |
EXPORT_SYMBOL | ( | of_device_is_available | ) |
EXPORT_SYMBOL | ( | of_get_parent | ) |
EXPORT_SYMBOL | ( | of_get_next_child | ) |
EXPORT_SYMBOL | ( | of_get_next_available_child | ) |
EXPORT_SYMBOL | ( | of_get_child_by_name | ) |
EXPORT_SYMBOL | ( | of_find_node_by_path | ) |
EXPORT_SYMBOL | ( | of_find_node_by_name | ) |
EXPORT_SYMBOL | ( | of_find_node_by_type | ) |
EXPORT_SYMBOL | ( | of_find_compatible_node | ) |
EXPORT_SYMBOL | ( | of_find_node_with_property | ) |
EXPORT_SYMBOL | ( | of_match_node | ) |
EXPORT_SYMBOL | ( | of_find_matching_node | ) |
EXPORT_SYMBOL | ( | of_find_node_by_phandle | ) |
EXPORT_SYMBOL | ( | of_parse_phandle | ) |
EXPORT_SYMBOL | ( | of_parse_phandle_with_args | ) |
EXPORT_SYMBOL_GPL | ( | of_modalias_node | ) |
EXPORT_SYMBOL_GPL | ( | of_property_read_u32_array | ) |
EXPORT_SYMBOL_GPL | ( | of_property_read_u64 | ) |
EXPORT_SYMBOL_GPL | ( | of_property_read_string | ) |
EXPORT_SYMBOL_GPL | ( | of_property_read_string_index | ) |
EXPORT_SYMBOL_GPL | ( | of_property_match_string | ) |
EXPORT_SYMBOL_GPL | ( | of_property_count_strings | ) |
EXPORT_SYMBOL_GPL | ( | of_alias_get_id | ) |
EXPORT_SYMBOL_GPL | ( | of_prop_next_u32 | ) |
EXPORT_SYMBOL_GPL | ( | of_prop_next_string | ) |
int of_alias_get_id | ( | struct device_node * | np, |
const char * | stem | ||
) |
of_alias_get_id - Get alias id for the given device_node : Pointer to the given device_node : Alias stem of the given device_node
The function travels the lookup table to get alias id for the given device_node and alias stem. It returns the alias id if find it.
of_alias_scan - Scan all properties of 'aliases' node
The function scans all the properties of 'aliases' node and populate the the global lookup table with the properties. It returns the number of alias_prop found, or error code in error case.
: An allocator that provides a virtual address to memory for the resulting tree
int of_device_is_available | ( | const struct device_node * | device | ) |
|
read |
|
read |
of_find_compatible_node - Find a node based on type and one of the tokens in its "compatible" property : 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 : The type string to match "device_type" or NULL to ignore : The string to match to one of the tokens in the device "compatible" list.
Returns a node pointer with refcount incremented, use of_node_put() on it when done.
|
read |
of_find_matching_node - Find a node based on an of_device_id match table. : 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 : array of of device match structures to search in
Returns a node pointer with refcount incremented, use of_node_put() on it when done.
|
read |
|
read |
|
read |
|
read |
of_find_node_by_type - Find a node by its "device_type" property : The node to start searching from, or NULL to start searching the entire device tree. 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 from for you. : The type string to match against
Returns a node pointer with refcount incremented, use of_node_put() on it when done.
|
read |
of_find_node_with_property - Find a node which has a property with the given name. : 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 : The name of the property to look for.
Returns a node pointer with refcount incremented, use of_node_put() on it when done.
|
read |
|
read |
|
read |
|
read |
of_get_next_parent - Iterate to a node's parent : Node to get parent of
This is like of_get_parent() except that it drops the refcount on the passed node, making it suitable for iterating through a node's parents.
Returns a node pointer with refcount incremented, use of_node_put() on it when done.
|
read |
|
read |
of_match_node - Tell if an device_node has a matching of_match structure : array of of device match structures to search in : the of device structure to match against
Low level utility function used by device matching.
int of_modalias_node | ( | struct device_node * | node, |
char * | modalias, | ||
int | len | ||
) |
of_modalias_node - Lookup appropriate modalias for a device node : pointer to a device tree node : Pointer to buffer that modalias value will be copied into : Length of modalias value
Based on the value of the compatible property, this routine will attempt to choose an appropriate modalias value for a particular device tree node. It does this by stripping the manufacturer prefix (as delimited by a ',') from the first entry in the compatible list property.
This routine returns 0 on success, <0 on failure.
int of_n_addr_cells | ( | struct device_node * | np | ) |
int of_n_size_cells | ( | struct device_node * | np | ) |
|
read |
of_parse_phandle - Resolve a phandle property to a device_node pointer : Pointer to device node holding phandle property : Name of property holding a phandle value : For properties holding a table of phandles, this is the index into the table
Returns the device_node pointer with refcount incremented. Use of_node_put() on it when done.
int of_parse_phandle_with_args | ( | struct device_node * | np, |
const char * | list_name, | ||
const char * | cells_name, | ||
int | index, | ||
struct of_phandle_args * | out_args | ||
) |
of_parse_phandle_with_args() - Find a node pointed by phandle in a list : pointer to a device tree node containing a list : property name that contains a list : property name that specifies phandles' arguments count : index of a phandle to parse out : optional pointer to output arguments structure (will be filled)
This function is useful to parse lists of phandles and their arguments. Returns 0 on success and fills out_args, on error returns appropriate errno value.
Caller is responsible to call of_node_put() on the returned out_args->node pointer.
Example:
phandle1: node1 { list-cells = <2>; }
phandle2: node2 { list-cells = <1>; }
node3 { list = <&phandle1 1 2 &phandle2 3>; }
To get a device_node of the `node2' node you may call this: of_parse_phandle_with_args(node3, "list", "#list-cells", 1, &args);
int of_property_count_strings | ( | struct device_node * | np, |
const char * | propname | ||
) |
of_property_count_strings - Find and return the number of strings from a multiple strings property. : device node from which the property value is to be read. : name of the property to be searched.
Search for a property in a device tree node and retrieve the number of null terminated string contain in it. Returns the number of strings on success, -EINVAL if the property does not exist, -ENODATA if property does not have a value, and -EILSEQ if the string is not null-terminated within the length of the property data.
int of_property_match_string | ( | struct device_node * | np, |
const char * | propname, | ||
const char * | string | ||
) |
of_property_match_string() - Find string in a list and return index : pointer to node containing string list property : string list property name : pointer to string to search for in string list
This function searches a string list property and returns the index of a specific string value.
int of_property_read_string | ( | struct device_node * | np, |
const char * | propname, | ||
const char ** | out_string | ||
) |
of_property_read_string - Find and read a string from a property : device node from which the property value is to be read. : name of the property to be searched. : pointer to null terminated return string, modified only if return value is 0.
Search for a property in a device tree node and retrieve a null terminated string value (pointer to data, not a copy). Returns 0 on success, -EINVAL if the property does not exist, -ENODATA if property does not have a value, and -EILSEQ if the string is not null-terminated within the length of the property data.
The out_string pointer is modified only if a valid string can be decoded.
int of_property_read_string_index | ( | struct device_node * | np, |
const char * | propname, | ||
int | index, | ||
const char ** | output | ||
) |
of_property_read_string_index - Find and read a string from a multiple strings property. : device node from which the property value is to be read. : name of the property to be searched. : index of the string in the list of strings : pointer to null terminated return string, modified only if return value is 0.
Search for a property in a device tree node and retrieve a null terminated string value (pointer to data, not a copy) in the list of strings contained in that property. Returns 0 on success, -EINVAL if the property does not exist, -ENODATA if property does not have a value, and -EILSEQ if the string is not null-terminated within the length of the property data.
The out_string pointer is modified only if a valid string can be decoded.
int of_property_read_u32_array | ( | const struct device_node * | np, |
const char * | propname, | ||
u32 * | out_values, | ||
size_t | sz | ||
) |
of_property_read_u32_array - Find and read an array of 32 bit integers from a property.
: device node from which the property value is to be read. : name of the property to be searched. : pointer to return value, modified only if return value is 0.
Search for a property in a device node and read 32-bit value(s) from it. Returns 0 on success, -EINVAL if the property does not exist, -ENODATA if property does not have a value, and -EOVERFLOW if the property data isn't large enough.
The out_value is modified only if a valid u32 value can be decoded.
of_property_read_u64 - Find and read a 64 bit integer from a property : device node from which the property value is to be read. : name of the property to be searched. : pointer to return value, modified only if return value is 0.
Search for a property in a device node and read a 64-bit value from it. Returns 0 on success, -EINVAL if the property does not exist, -ENODATA if property does not have a value, and -EOVERFLOW if the property data isn't large enough.
The out_value is modified only if a valid u64 value can be decoded.
int prom_add_property | ( | struct device_node * | np, |
struct property * | prop | ||
) |
int prom_remove_property | ( | struct device_node * | np, |
struct property * | prop | ||
) |
int prom_update_property | ( | struct device_node * | np, |
struct property * | newprop | ||
) |
struct device_node* allnodes |
struct device_node* of_aliases |
struct device_node* of_chosen |