Skip to content

Commit

Permalink
media: device property: Add a function to test is a fwnode is a graph…
Browse files Browse the repository at this point in the history
… endpoint

Drivers may need to test if a fwnode is a graph endpoint. To avoid
hand-written solutions that wouldn't work for all fwnode types, add a
new fwnode_graph_is_endpoint() function for this purpose. We don't need
to wire it up to different backends for OF and ACPI for now, as the
implementation can simply be based on checkout the presence of a
remote-endpoint property.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Niklas Söderlund <[email protected]>
Reviewed-by: Lad Prabhakar <[email protected]>
Reviewed-by: Kieran Bingham <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
Laurent Pinchart authored and sigmaris committed Aug 3, 2020
1 parent 8eb4bea commit db966e8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/linux/property.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,11 @@ struct fwnode_handle *
fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port,
u32 endpoint);

static inline bool fwnode_graph_is_endpoint(struct fwnode_handle *fwnode)
{
return fwnode_property_present(fwnode, "remote-endpoint");
}

/*
* Fwnode lookup flags
*
Expand Down

0 comments on commit db966e8

Please sign in to comment.