summaryrefslogtreecommitdiffstats
path: root/include/linux/property.h
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2019-04-02 06:30:37 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-04-18 10:44:05 -0400
commit0fcc2bdc8aff6e7feb3222930edb78b4b820cd3e (patch)
tree933368f7dc2a321af5d0efbc8fb6022e42b4236d /include/linux/property.h
parent5f21f3055a32878c0c9d9ebbbafef72d60a1ff49 (diff)
device property: Add fwnode_graph_get_endpoint_by_id()
fwnode_graph_get_endpoint_by_id() is intended for obtaining local endpoints by a given local port. fwnode_graph_get_endpoint_by_id() is slightly different from its OF counterpart, of_graph_get_endpoint_by_regs(): instead of using -1 as a value to indicate that a port or an endpoint number does not matter, it uses flags to look for equal or greater endpoint. The port number is always fixed. It also returns only remote endpoints that belong to an available device, a behaviour that can be turned off with a flag. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> [ rjw: Changelog ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/property.h')
-rw-r--r--include/linux/property.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/property.h b/include/linux/property.h
index 65d3420dd5d1..a29369c89e6e 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -13,6 +13,7 @@
13#ifndef _LINUX_PROPERTY_H_ 13#ifndef _LINUX_PROPERTY_H_
14#define _LINUX_PROPERTY_H_ 14#define _LINUX_PROPERTY_H_
15 15
16#include <linux/bits.h>
16#include <linux/fwnode.h> 17#include <linux/fwnode.h>
17#include <linux/types.h> 18#include <linux/types.h>
18 19
@@ -304,6 +305,23 @@ struct fwnode_handle *
304fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port, 305fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port,
305 u32 endpoint); 306 u32 endpoint);
306 307
308/*
309 * Fwnode lookup flags
310 *
311 * @FWNODE_GRAPH_ENDPOINT_NEXT: In the case of no exact match, look for the
312 * closest endpoint ID greater than the specified
313 * one.
314 * @FWNODE_GRAPH_DEVICE_DISABLED: That the device to which the remote
315 * endpoint of the given endpoint belongs to,
316 * may be disabled.
317 */
318#define FWNODE_GRAPH_ENDPOINT_NEXT BIT(0)
319#define FWNODE_GRAPH_DEVICE_DISABLED BIT(1)
320
321struct fwnode_handle *
322fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode,
323 u32 port, u32 endpoint, unsigned long flags);
324
307#define fwnode_graph_for_each_endpoint(fwnode, child) \ 325#define fwnode_graph_for_each_endpoint(fwnode, child) \
308 for (child = NULL; \ 326 for (child = NULL; \
309 (child = fwnode_graph_get_next_endpoint(fwnode, child)); ) 327 (child = fwnode_graph_get_next_endpoint(fwnode, child)); )