diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2021-12-01 14:59:33 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2021-12-17 18:41:29 +0100 |
commit | c87b8fc569667610b4891cad1e4a663e5a94d8f8 (patch) | |
tree | 990e02b4cb0640f4e6deed740025f5906c403e83 /include/linux/property.h | |
parent | 59f3f98284baa29da60410d04e498467c044aac2 (diff) |
device property: Implement fwnode_graph_get_endpoint_count()
Add fwnode_graph_get_endpoint_count() function to provide generic
implementation of of_graph_get_endpoint_count(). The former by default
only counts endpoints to available devices which is consistent with the
rest of the fwnode graph API. By providing FWNODE_GRAPH_DEVICE_DISABLED
flag, also unconnected endpoints and endpoints to disabled devices are
counted.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/property.h')
-rw-r--r-- | include/linux/property.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/property.h b/include/linux/property.h index 7a2df45ec3ae..8c0104871252 100644 --- a/include/linux/property.h +++ b/include/linux/property.h @@ -423,6 +423,8 @@ static inline bool fwnode_graph_is_endpoint(struct fwnode_handle *fwnode) struct fwnode_handle * fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode, u32 port, u32 endpoint, unsigned long flags); +unsigned int fwnode_graph_get_endpoint_count(struct fwnode_handle *fwnode, + unsigned long flags); #define fwnode_graph_for_each_endpoint(fwnode, child) \ for (child = NULL; \ |