Lines Matching full:entity
24 #include <media/media-entity.h>
83 struct media_entity *entity; in find_entity() local
88 media_device_for_each_entity(entity, mdev) { in find_entity()
89 if (((media_entity_id(entity) == id) && !next) || in find_entity()
90 ((media_entity_id(entity) > id) && next)) { in find_entity()
91 return entity; in find_entity()
121 * do the wrong thing if the entity function doesn't belong to in media_device_enum_entities()
146 upad->entity = media_entity_id(kpad->entity); in media_device_kpad_to_upad()
154 struct media_entity *entity; in media_device_enum_links() local
156 entity = find_entity(mdev, links->entity); in media_device_enum_links()
157 if (entity == NULL) in media_device_enum_links()
163 for (p = 0; p < entity->num_pads; p++) { in media_device_enum_links()
167 media_device_kpad_to_upad(&entity->pads[p], &pad); in media_device_enum_links()
177 list_for_each_entry(link, &entity->links, list) { in media_device_enum_links()
181 if (link->source->entity != entity) in media_device_enum_links()
209 source = find_entity(mdev, linkd->source.entity); in media_device_setup_link()
210 sink = find_entity(mdev, linkd->sink.entity); in media_device_setup_link()
233 struct media_entity *entity; in media_device_get_topology() local
249 media_device_for_each_entity(entity, mdev) { in media_device_get_topology()
261 kentity.id = entity->graph_obj.id; in media_device_get_topology()
262 kentity.function = entity->function; in media_device_get_topology()
263 kentity.flags = entity->flags; in media_device_get_topology()
264 strscpy(kentity.name, entity->name, in media_device_get_topology()
327 kpad.entity_id = pad->entity->graph_obj.id; in media_device_get_topology()
487 __u32 entity; member
502 if (get_user(links.entity, &ulinks->entity) in media_device_enum_links32()
579 static void __media_device_unregister_entity(struct media_entity *entity) in __media_device_unregister_entity() argument
581 struct media_device *mdev = entity->graph_obj.mdev; in __media_device_unregister_entity()
586 ida_free(&mdev->entity_internal_idx, entity->internal_idx); in __media_device_unregister_entity()
588 /* Remove all interface links pointing to this entity */ in __media_device_unregister_entity()
591 if (link->entity == entity) in __media_device_unregister_entity()
596 /* Remove all data links that belong to this entity */ in __media_device_unregister_entity()
597 __media_entity_remove_links(entity); in __media_device_unregister_entity()
599 /* Remove all pads that belong to this entity */ in __media_device_unregister_entity()
600 media_entity_for_each_pad(entity, iter) in __media_device_unregister_entity()
603 /* Remove the entity */ in __media_device_unregister_entity()
604 media_gobj_destroy(&entity->graph_obj); in __media_device_unregister_entity()
606 /* invoke entity_notify callbacks to handle entity removal?? */ in __media_device_unregister_entity()
610 struct media_entity *entity) in media_device_register_entity() argument
616 if (entity->function == MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN || in media_device_register_entity()
617 entity->function == MEDIA_ENT_F_UNKNOWN) in media_device_register_entity()
619 "Entity type for entity %s was not initialized!\n", in media_device_register_entity()
620 entity->name); in media_device_register_entity()
622 /* Warn if we apparently re-register an entity */ in media_device_register_entity()
623 WARN_ON(entity->graph_obj.mdev != NULL); in media_device_register_entity()
624 entity->graph_obj.mdev = mdev; in media_device_register_entity()
625 INIT_LIST_HEAD(&entity->links); in media_device_register_entity()
626 entity->num_links = 0; in media_device_register_entity()
627 entity->num_backlinks = 0; in media_device_register_entity()
632 entity->internal_idx = ret; in media_device_register_entity()
636 max(mdev->entity_internal_idx_max, entity->internal_idx); in media_device_register_entity()
638 /* Initialize media_gobj embedded at the entity */ in media_device_register_entity()
639 media_gobj_create(mdev, MEDIA_GRAPH_ENTITY, &entity->graph_obj); in media_device_register_entity()
642 media_entity_for_each_pad(entity, iter) in media_device_register_entity()
647 notify->notify(entity, notify->notify_data); in media_device_register_entity()
660 __media_device_unregister_entity(entity); in media_device_register_entity()
673 void media_device_unregister_entity(struct media_entity *entity) in media_device_unregister_entity() argument
675 struct media_device *mdev = entity->graph_obj.mdev; in media_device_unregister_entity()
681 __media_device_unregister_entity(entity); in media_device_unregister_entity()
789 struct media_entity *entity; in media_device_unregister() local
809 list_for_each_entry_safe(entity, next, &mdev->entities, graph_obj.list) in media_device_unregister()
810 __media_device_unregister_entity(entity); in media_device_unregister()