Lines Matching refs:entity
25 bool vsp1_entity_is_streaming(struct vsp1_entity *entity) in vsp1_entity_is_streaming() argument
30 spin_lock_irqsave(&entity->lock, flags); in vsp1_entity_is_streaming()
31 streaming = entity->streaming; in vsp1_entity_is_streaming()
32 spin_unlock_irqrestore(&entity->lock, flags); in vsp1_entity_is_streaming()
37 int vsp1_entity_set_streaming(struct vsp1_entity *entity, bool streaming) in vsp1_entity_set_streaming() argument
42 spin_lock_irqsave(&entity->lock, flags); in vsp1_entity_set_streaming()
43 entity->streaming = streaming; in vsp1_entity_set_streaming()
44 spin_unlock_irqrestore(&entity->lock, flags); in vsp1_entity_set_streaming()
49 if (!entity->subdev.ctrl_handler) in vsp1_entity_set_streaming()
52 ret = v4l2_ctrl_handler_setup(entity->subdev.ctrl_handler); in vsp1_entity_set_streaming()
54 spin_lock_irqsave(&entity->lock, flags); in vsp1_entity_set_streaming()
55 entity->streaming = false; in vsp1_entity_set_streaming()
56 spin_unlock_irqrestore(&entity->lock, flags); in vsp1_entity_set_streaming()
67 vsp1_entity_get_pad_format(struct vsp1_entity *entity, in vsp1_entity_get_pad_format() argument
73 return v4l2_subdev_get_try_format(&entity->subdev, cfg, pad); in vsp1_entity_get_pad_format()
75 return &entity->formats[pad]; in vsp1_entity_get_pad_format()
96 for (pad = 0; pad < subdev->entity.num_pads - 1; ++pad) { in vsp1_entity_init_formats()
123 static int vsp1_entity_link_setup(struct media_entity *entity, in vsp1_entity_link_setup() argument
132 source = container_of(local->entity, struct vsp1_entity, subdev.entity); in vsp1_entity_link_setup()
140 source->sink = remote->entity; in vsp1_entity_link_setup()
182 int vsp1_entity_init(struct vsp1_device *vsp1, struct vsp1_entity *entity, in vsp1_entity_init() argument
188 if (vsp1_routes[i].type == entity->type && in vsp1_entity_init()
189 vsp1_routes[i].index == entity->index) { in vsp1_entity_init()
190 entity->route = &vsp1_routes[i]; in vsp1_entity_init()
198 spin_lock_init(&entity->lock); in vsp1_entity_init()
200 entity->vsp1 = vsp1; in vsp1_entity_init()
201 entity->source_pad = num_pads - 1; in vsp1_entity_init()
204 entity->formats = devm_kzalloc(vsp1->dev, in vsp1_entity_init()
205 num_pads * sizeof(*entity->formats), in vsp1_entity_init()
207 if (entity->formats == NULL) in vsp1_entity_init()
210 entity->pads = devm_kzalloc(vsp1->dev, num_pads * sizeof(*entity->pads), in vsp1_entity_init()
212 if (entity->pads == NULL) in vsp1_entity_init()
217 entity->pads[i].flags = MEDIA_PAD_FL_SINK; in vsp1_entity_init()
219 entity->pads[num_pads - 1].flags = MEDIA_PAD_FL_SOURCE; in vsp1_entity_init()
222 return media_entity_init(&entity->subdev.entity, num_pads, in vsp1_entity_init()
223 entity->pads, 0); in vsp1_entity_init()
226 void vsp1_entity_destroy(struct vsp1_entity *entity) in vsp1_entity_destroy() argument
228 if (entity->video) in vsp1_entity_destroy()
229 vsp1_video_cleanup(entity->video); in vsp1_entity_destroy()
230 if (entity->subdev.ctrl_handler) in vsp1_entity_destroy()
231 v4l2_ctrl_handler_free(entity->subdev.ctrl_handler); in vsp1_entity_destroy()
232 media_entity_cleanup(&entity->subdev.entity); in vsp1_entity_destroy()