mirror of
https://github.com/analogdevicesinc/linux.git
synced 2026-05-30 00:55:04 +08:00
media: entity: Add media_entity_has_route() function
This is a wrapper around the media entity has_route operation. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> State: pending
This commit is contained in:
committed by
Michal Simek
parent
e75720bc65
commit
2ffcaf17d5
@@ -314,6 +314,35 @@ static struct media_entity *stack_pop(struct media_graph *graph)
|
||||
#define link_top(en) ((en)->stack[(en)->top].link)
|
||||
#define stack_top(en) ((en)->stack[(en)->top].entity)
|
||||
|
||||
/**
|
||||
* media_entity_has_route - Check if two entity pads are connected internally
|
||||
* @entity: The entity
|
||||
* @pad0: The first pad index
|
||||
* @pad1: The second pad index
|
||||
*
|
||||
* This function can be used to check whether two pads of an entity are
|
||||
* connected internally in the entity.
|
||||
*
|
||||
* The caller must hold entity->source->parent->mutex.
|
||||
*
|
||||
* Return: true if the pads are connected internally and false otherwise.
|
||||
*/
|
||||
bool media_entity_has_route(struct media_entity *entity, unsigned int pad0,
|
||||
unsigned int pad1)
|
||||
{
|
||||
if (pad0 >= entity->num_pads || pad1 >= entity->num_pads)
|
||||
return false;
|
||||
|
||||
if (pad0 == pad1)
|
||||
return true;
|
||||
|
||||
if (!entity->ops || !entity->ops->has_route)
|
||||
return true;
|
||||
|
||||
return entity->ops->has_route(entity, pad0, pad1);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(media_entity_has_route);
|
||||
|
||||
/**
|
||||
* media_graph_walk_init - Allocate resources for graph walk
|
||||
* @graph: Media graph structure that will be used to walk the graph
|
||||
|
||||
@@ -1110,6 +1110,9 @@ __must_check int media_graph_walk_init(
|
||||
*/
|
||||
void media_graph_walk_cleanup(struct media_graph *graph);
|
||||
|
||||
bool media_entity_has_route(struct media_entity *entity, unsigned int sink,
|
||||
unsigned int source);
|
||||
|
||||
/**
|
||||
* media_graph_walk_start - Start walking the media graph at a
|
||||
* given entity
|
||||
|
||||
Reference in New Issue
Block a user