Lines Matching refs:entity

25 bool vsp1_entity_is_streaming(struct vsp1_entity *entity)  in vsp1_entity_is_streaming()  argument
29 mutex_lock(&entity->lock); in vsp1_entity_is_streaming()
30 streaming = entity->streaming; in vsp1_entity_is_streaming()
31 mutex_unlock(&entity->lock); in vsp1_entity_is_streaming()
36 int vsp1_entity_set_streaming(struct vsp1_entity *entity, bool streaming) in vsp1_entity_set_streaming() argument
40 mutex_lock(&entity->lock); in vsp1_entity_set_streaming()
41 entity->streaming = streaming; in vsp1_entity_set_streaming()
42 mutex_unlock(&entity->lock); in vsp1_entity_set_streaming()
47 if (!entity->subdev.ctrl_handler) in vsp1_entity_set_streaming()
50 ret = v4l2_ctrl_handler_setup(entity->subdev.ctrl_handler); in vsp1_entity_set_streaming()
52 mutex_lock(&entity->lock); in vsp1_entity_set_streaming()
53 entity->streaming = false; in vsp1_entity_set_streaming()
54 mutex_unlock(&entity->lock); in vsp1_entity_set_streaming()
65 vsp1_entity_get_pad_format(struct vsp1_entity *entity, in vsp1_entity_get_pad_format() argument
71 return v4l2_subdev_get_try_format(&entity->subdev, cfg, pad); in vsp1_entity_get_pad_format()
73 return &entity->formats[pad]; in vsp1_entity_get_pad_format()
94 for (pad = 0; pad < subdev->entity.num_pads - 1; ++pad) { in vsp1_entity_init_formats()
121 static int vsp1_entity_link_setup(struct media_entity *entity, in vsp1_entity_link_setup() argument
130 source = container_of(local->entity, struct vsp1_entity, subdev.entity); in vsp1_entity_link_setup()
138 source->sink = remote->entity; in vsp1_entity_link_setup()
180 int vsp1_entity_init(struct vsp1_device *vsp1, struct vsp1_entity *entity, in vsp1_entity_init() argument
186 if (vsp1_routes[i].type == entity->type && in vsp1_entity_init()
187 vsp1_routes[i].index == entity->index) { in vsp1_entity_init()
188 entity->route = &vsp1_routes[i]; in vsp1_entity_init()
196 mutex_init(&entity->lock); in vsp1_entity_init()
198 entity->vsp1 = vsp1; in vsp1_entity_init()
199 entity->source_pad = num_pads - 1; in vsp1_entity_init()
202 entity->formats = devm_kzalloc(vsp1->dev, in vsp1_entity_init()
203 num_pads * sizeof(*entity->formats), in vsp1_entity_init()
205 if (entity->formats == NULL) in vsp1_entity_init()
208 entity->pads = devm_kzalloc(vsp1->dev, num_pads * sizeof(*entity->pads), in vsp1_entity_init()
210 if (entity->pads == NULL) in vsp1_entity_init()
215 entity->pads[i].flags = MEDIA_PAD_FL_SINK; in vsp1_entity_init()
217 entity->pads[num_pads - 1].flags = MEDIA_PAD_FL_SOURCE; in vsp1_entity_init()
220 return media_entity_init(&entity->subdev.entity, num_pads, in vsp1_entity_init()
221 entity->pads, 0); in vsp1_entity_init()
224 void vsp1_entity_destroy(struct vsp1_entity *entity) in vsp1_entity_destroy() argument
226 if (entity->video) in vsp1_entity_destroy()
227 vsp1_video_cleanup(entity->video); in vsp1_entity_destroy()
228 if (entity->subdev.ctrl_handler) in vsp1_entity_destroy()
229 v4l2_ctrl_handler_free(entity->subdev.ctrl_handler); in vsp1_entity_destroy()
230 media_entity_cleanup(&entity->subdev.entity); in vsp1_entity_destroy()
232 mutex_destroy(&entity->lock); in vsp1_entity_destroy()