mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
Merge remote-tracking branch 'asoc/topic/rcar' into asoc-next
This commit is contained in:
commit
6bf4cd287d
28 changed files with 1960 additions and 382 deletions
|
|
@ -1601,6 +1601,7 @@ int of_phandle_iterator_init(struct of_phandle_iterator *it,
|
|||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(of_phandle_iterator_init);
|
||||
|
||||
int of_phandle_iterator_next(struct of_phandle_iterator *it)
|
||||
{
|
||||
|
|
@ -1670,6 +1671,7 @@ err:
|
|||
|
||||
return -EINVAL;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(of_phandle_iterator_next);
|
||||
|
||||
int of_phandle_iterator_args(struct of_phandle_iterator *it,
|
||||
uint32_t *args,
|
||||
|
|
@ -2484,6 +2486,41 @@ struct device_node *of_graph_get_endpoint_by_regs(
|
|||
}
|
||||
EXPORT_SYMBOL(of_graph_get_endpoint_by_regs);
|
||||
|
||||
/**
|
||||
* of_graph_get_remote_endpoint() - get remote endpoint node
|
||||
* @node: pointer to a local endpoint device_node
|
||||
*
|
||||
* Return: Remote endpoint node associated with remote endpoint node linked
|
||||
* to @node. Use of_node_put() on it when done.
|
||||
*/
|
||||
struct device_node *of_graph_get_remote_endpoint(const struct device_node *node)
|
||||
{
|
||||
/* Get remote endpoint node. */
|
||||
return of_parse_phandle(node, "remote-endpoint", 0);
|
||||
}
|
||||
EXPORT_SYMBOL(of_graph_get_remote_endpoint);
|
||||
|
||||
/**
|
||||
* of_graph_get_port_parent() - get port's parent node
|
||||
* @node: pointer to a local endpoint device_node
|
||||
*
|
||||
* Return: device node associated with endpoint node linked
|
||||
* to @node. Use of_node_put() on it when done.
|
||||
*/
|
||||
struct device_node *of_graph_get_port_parent(struct device_node *node)
|
||||
{
|
||||
unsigned int depth;
|
||||
|
||||
/* Walk 3 levels up only if there is 'ports' node. */
|
||||
for (depth = 3; depth && node; depth--) {
|
||||
node = of_get_next_parent(node);
|
||||
if (depth == 2 && of_node_cmp(node->name, "ports"))
|
||||
break;
|
||||
}
|
||||
return node;
|
||||
}
|
||||
EXPORT_SYMBOL(of_graph_get_port_parent);
|
||||
|
||||
/**
|
||||
* of_graph_get_remote_port_parent() - get remote port's parent node
|
||||
* @node: pointer to a local endpoint device_node
|
||||
|
|
@ -2495,18 +2532,11 @@ struct device_node *of_graph_get_remote_port_parent(
|
|||
const struct device_node *node)
|
||||
{
|
||||
struct device_node *np;
|
||||
unsigned int depth;
|
||||
|
||||
/* Get remote endpoint node. */
|
||||
np = of_parse_phandle(node, "remote-endpoint", 0);
|
||||
np = of_graph_get_remote_endpoint(node);
|
||||
|
||||
/* Walk 3 levels up only if there is 'ports' node. */
|
||||
for (depth = 3; depth && np; depth--) {
|
||||
np = of_get_next_parent(np);
|
||||
if (depth == 2 && of_node_cmp(np->name, "ports"))
|
||||
break;
|
||||
}
|
||||
return np;
|
||||
return of_graph_get_port_parent(np);
|
||||
}
|
||||
EXPORT_SYMBOL(of_graph_get_remote_port_parent);
|
||||
|
||||
|
|
@ -2522,13 +2552,25 @@ struct device_node *of_graph_get_remote_port(const struct device_node *node)
|
|||
struct device_node *np;
|
||||
|
||||
/* Get remote endpoint node. */
|
||||
np = of_parse_phandle(node, "remote-endpoint", 0);
|
||||
np = of_graph_get_remote_endpoint(node);
|
||||
if (!np)
|
||||
return NULL;
|
||||
return of_get_next_parent(np);
|
||||
}
|
||||
EXPORT_SYMBOL(of_graph_get_remote_port);
|
||||
|
||||
int of_graph_get_endpoint_count(const struct device_node *np)
|
||||
{
|
||||
struct device_node *endpoint;
|
||||
int num = 0;
|
||||
|
||||
for_each_endpoint_of_node(np, endpoint)
|
||||
num++;
|
||||
|
||||
return num;
|
||||
}
|
||||
EXPORT_SYMBOL(of_graph_get_endpoint_count);
|
||||
|
||||
/**
|
||||
* of_graph_get_remote_node() - get remote parent device_node for given port/endpoint
|
||||
* @node: pointer to parent device_node containing graph port/endpoint
|
||||
|
|
|
|||
Loading…
Reference in a new issue