Lines Matching refs:entity

25 	struct media_entity *entity;  in v4l2_mc_create_media_graph()  local
36 media_device_for_each_entity(entity, mdev) { in v4l2_mc_create_media_graph()
37 switch (entity->function) { in v4l2_mc_create_media_graph()
39 if_vid = entity; in v4l2_mc_create_media_graph()
42 if_aud = entity; in v4l2_mc_create_media_graph()
45 tuner = entity; in v4l2_mc_create_media_graph()
48 decoder = entity; in v4l2_mc_create_media_graph()
51 io_v4l = entity; in v4l2_mc_create_media_graph()
54 io_vbi = entity; in v4l2_mc_create_media_graph()
57 io_swradio = entity; in v4l2_mc_create_media_graph()
84 media_device_for_each_entity(entity, mdev) { in v4l2_mc_create_media_graph()
85 if (entity->function != MEDIA_ENT_F_CAM_SENSOR) in v4l2_mc_create_media_graph()
87 ret = media_create_pad_link(entity, 0, in v4l2_mc_create_media_graph()
240 media_device_for_each_entity(entity, mdev) { in v4l2_mc_create_media_graph()
241 switch (entity->function) { in v4l2_mc_create_media_graph()
251 ret = media_create_pad_link(entity, 0, tuner, in v4l2_mc_create_media_graph()
264 ret = media_create_pad_link(entity, 0, decoder, in v4l2_mc_create_media_graph()
283 struct media_device *mdev = vdev->entity.graph_obj.mdev; in v4l_enable_media_source()
292 err = mdev->enable_source(&vdev->entity, &vdev->pipe); in v4l_enable_media_source()
303 struct media_device *mdev = vdev->entity.graph_obj.mdev; in v4l_disable_media_source()
308 mdev->disable_source(&vdev->entity); in v4l_disable_media_source()
337 src_idx = media_entity_get_fwnode_pad(&src_sd->entity, in v4l2_create_fwnode_links_to_pad()
351 sink_idx = media_entity_get_fwnode_pad(sink->entity, in v4l2_create_fwnode_links_to_pad()
367 src = &src_sd->entity.pads[src_idx]; in v4l2_create_fwnode_links_to_pad()
374 src_sd->entity.name, src_idx, in v4l2_create_fwnode_links_to_pad()
375 sink->entity->name, sink_idx); in v4l2_create_fwnode_links_to_pad()
377 ret = media_create_pad_link(&src_sd->entity, src_idx, in v4l2_create_fwnode_links_to_pad()
378 sink->entity, sink_idx, flags); in v4l2_create_fwnode_links_to_pad()
382 src_sd->entity.name, src_idx, in v4l2_create_fwnode_links_to_pad()
383 sink->entity->name, sink_idx, ret); in v4l2_create_fwnode_links_to_pad()
399 for (i = 0; i < sink_sd->entity.num_pads; i++) { in v4l2_create_fwnode_links()
400 struct media_pad *pad = &sink_sd->entity.pads[i]; in v4l2_create_fwnode_links()
442 static int pipeline_pm_use_count(struct media_entity *entity, in pipeline_pm_use_count() argument
447 media_graph_walk_start(graph, entity); in pipeline_pm_use_count()
449 while ((entity = media_graph_walk_next(graph))) { in pipeline_pm_use_count()
450 if (is_media_entity_v4l2_video_device(entity)) in pipeline_pm_use_count()
451 use += entity->use_count; in pipeline_pm_use_count()
468 static int pipeline_pm_power_one(struct media_entity *entity, int change) in pipeline_pm_power_one() argument
473 subdev = is_media_entity_v4l2_subdev(entity) in pipeline_pm_power_one()
474 ? media_entity_to_v4l2_subdev(entity) : NULL; in pipeline_pm_power_one()
476 if (entity->use_count == 0 && change > 0 && subdev != NULL) { in pipeline_pm_power_one()
482 entity->use_count += change; in pipeline_pm_power_one()
483 WARN_ON(entity->use_count < 0); in pipeline_pm_power_one()
485 if (entity->use_count == 0 && change < 0 && subdev != NULL) in pipeline_pm_power_one()
501 static int pipeline_pm_power(struct media_entity *entity, int change, in pipeline_pm_power() argument
504 struct media_entity *first = entity; in pipeline_pm_power()
510 media_graph_walk_start(graph, entity); in pipeline_pm_power()
512 while (!ret && (entity = media_graph_walk_next(graph))) in pipeline_pm_power()
513 if (is_media_entity_v4l2_subdev(entity)) in pipeline_pm_power()
514 ret = pipeline_pm_power_one(entity, change); in pipeline_pm_power()
522 && first != entity) in pipeline_pm_power()
529 static int v4l2_pipeline_pm_use(struct media_entity *entity, unsigned int use) in v4l2_pipeline_pm_use() argument
531 struct media_device *mdev = entity->graph_obj.mdev; in v4l2_pipeline_pm_use()
538 entity->use_count += change; in v4l2_pipeline_pm_use()
539 WARN_ON(entity->use_count < 0); in v4l2_pipeline_pm_use()
542 ret = pipeline_pm_power(entity, change, &mdev->pm_count_walk); in v4l2_pipeline_pm_use()
544 entity->use_count -= change; in v4l2_pipeline_pm_use()
551 int v4l2_pipeline_pm_get(struct media_entity *entity) in v4l2_pipeline_pm_get() argument
553 return v4l2_pipeline_pm_use(entity, 1); in v4l2_pipeline_pm_get()
557 void v4l2_pipeline_pm_put(struct media_entity *entity) in v4l2_pipeline_pm_put() argument
560 WARN_ON(v4l2_pipeline_pm_use(entity, 0)); in v4l2_pipeline_pm_put()
568 struct media_entity *source = link->source->entity; in v4l2_pipeline_link_notify()
569 struct media_entity *sink = link->sink->entity; in v4l2_pipeline_link_notify()