Searched refs:entity (Results 1 - 200 of 276) sorted by relevance

12

/linux-4.4.14/drivers/media/usb/uvc/
H A Duvc_entity.c27 struct uvc_entity *entity) uvc_mc_register_entity()
34 sink = (UVC_ENTITY_TYPE(entity) == UVC_TT_STREAMING) uvc_mc_register_entity()
35 ? (entity->vdev ? &entity->vdev->entity : NULL) uvc_mc_register_entity()
36 : &entity->subdev.entity; uvc_mc_register_entity()
40 for (i = 0; i < entity->num_pads; ++i) { uvc_mc_register_entity()
45 if (!(entity->pads[i].flags & MEDIA_PAD_FL_SINK)) uvc_mc_register_entity()
48 remote = uvc_entity_by_id(chain->dev, entity->baSourceID[i]); uvc_mc_register_entity()
53 ? (remote->vdev ? &remote->vdev->entity : NULL) uvc_mc_register_entity()
54 : &remote->subdev.entity; uvc_mc_register_entity()
65 if (UVC_ENTITY_TYPE(entity) == UVC_TT_STREAMING) uvc_mc_register_entity()
68 return v4l2_device_register_subdev(&chain->dev->vdev, &entity->subdev); uvc_mc_register_entity()
74 void uvc_mc_cleanup_entity(struct uvc_entity *entity) uvc_mc_cleanup_entity() argument
76 if (UVC_ENTITY_TYPE(entity) != UVC_TT_STREAMING) uvc_mc_cleanup_entity()
77 media_entity_cleanup(&entity->subdev.entity); uvc_mc_cleanup_entity()
78 else if (entity->vdev != NULL) uvc_mc_cleanup_entity()
79 media_entity_cleanup(&entity->vdev->entity); uvc_mc_cleanup_entity()
82 static int uvc_mc_init_entity(struct uvc_entity *entity) uvc_mc_init_entity() argument
86 if (UVC_ENTITY_TYPE(entity) != UVC_TT_STREAMING) { uvc_mc_init_entity()
87 v4l2_subdev_init(&entity->subdev, &uvc_subdev_ops); uvc_mc_init_entity()
88 strlcpy(entity->subdev.name, entity->name, uvc_mc_init_entity()
89 sizeof(entity->subdev.name)); uvc_mc_init_entity()
91 ret = media_entity_init(&entity->subdev.entity, uvc_mc_init_entity()
92 entity->num_pads, entity->pads, 0); uvc_mc_init_entity()
93 } else if (entity->vdev != NULL) { uvc_mc_init_entity()
94 ret = media_entity_init(&entity->vdev->entity, uvc_mc_init_entity()
95 entity->num_pads, entity->pads, 0); uvc_mc_init_entity()
96 if (entity->flags & UVC_ENTITY_FLAG_DEFAULT) uvc_mc_init_entity()
97 entity->vdev->entity.flags |= MEDIA_ENT_FL_DEFAULT; uvc_mc_init_entity()
106 struct uvc_entity *entity; uvc_mc_register_entities() local
109 list_for_each_entry(entity, &chain->entities, chain) { uvc_mc_register_entities()
110 ret = uvc_mc_init_entity(entity); uvc_mc_register_entities()
112 uvc_printk(KERN_INFO, "Failed to initialize entity for " uvc_mc_register_entities()
113 "entity %u\n", entity->id); uvc_mc_register_entities()
118 list_for_each_entry(entity, &chain->entities, chain) { uvc_mc_register_entities()
119 ret = uvc_mc_register_entity(chain, entity); uvc_mc_register_entities()
121 uvc_printk(KERN_INFO, "Failed to register entity for " uvc_mc_register_entities()
122 "entity %u\n", entity->id); uvc_mc_register_entities()
26 uvc_mc_register_entity(struct uvc_video_chain *chain, struct uvc_entity *entity) uvc_mc_register_entity() argument
H A Duvc_ctrl.c42 .entity = UVC_GUID_UVC_PROCESSING,
51 .entity = UVC_GUID_UVC_PROCESSING,
60 .entity = UVC_GUID_UVC_PROCESSING,
70 .entity = UVC_GUID_UVC_PROCESSING,
79 .entity = UVC_GUID_UVC_PROCESSING,
88 .entity = UVC_GUID_UVC_PROCESSING,
97 .entity = UVC_GUID_UVC_PROCESSING,
107 .entity = UVC_GUID_UVC_PROCESSING,
117 .entity = UVC_GUID_UVC_PROCESSING,
126 .entity = UVC_GUID_UVC_PROCESSING,
135 .entity = UVC_GUID_UVC_PROCESSING,
143 .entity = UVC_GUID_UVC_PROCESSING,
151 .entity = UVC_GUID_UVC_PROCESSING,
159 .entity = UVC_GUID_UVC_PROCESSING,
167 .entity = UVC_GUID_UVC_PROCESSING,
176 .entity = UVC_GUID_UVC_PROCESSING,
185 .entity = UVC_GUID_UVC_PROCESSING,
192 .entity = UVC_GUID_UVC_PROCESSING,
199 .entity = UVC_GUID_UVC_CAMERA,
207 .entity = UVC_GUID_UVC_CAMERA,
216 .entity = UVC_GUID_UVC_CAMERA,
224 .entity = UVC_GUID_UVC_CAMERA,
233 .entity = UVC_GUID_UVC_CAMERA,
240 .entity = UVC_GUID_UVC_CAMERA,
250 .entity = UVC_GUID_UVC_CAMERA,
260 .entity = UVC_GUID_UVC_CAMERA,
270 .entity = UVC_GUID_UVC_CAMERA,
278 .entity = UVC_GUID_UVC_CAMERA,
288 .entity = UVC_GUID_UVC_CAMERA,
298 .entity = UVC_GUID_UVC_CAMERA,
308 .entity = UVC_GUID_UVC_CAMERA,
317 .entity = UVC_GUID_UVC_CAMERA,
327 .entity = UVC_GUID_UVC_CAMERA,
337 .entity = UVC_GUID_UVC_CAMERA,
345 .entity = UVC_GUID_UVC_CAMERA,
426 .entity = UVC_GUID_UVC_PROCESSING,
436 .entity = UVC_GUID_UVC_PROCESSING,
446 .entity = UVC_GUID_UVC_PROCESSING,
458 .entity = UVC_GUID_UVC_PROCESSING,
468 .entity = UVC_GUID_UVC_PROCESSING,
478 .entity = UVC_GUID_UVC_PROCESSING,
488 .entity = UVC_GUID_UVC_PROCESSING,
498 .entity = UVC_GUID_UVC_PROCESSING,
508 .entity = UVC_GUID_UVC_PROCESSING,
520 .entity = UVC_GUID_UVC_PROCESSING,
531 .entity = UVC_GUID_UVC_CAMERA,
544 .entity = UVC_GUID_UVC_CAMERA,
554 .entity = UVC_GUID_UVC_CAMERA,
566 .entity = UVC_GUID_UVC_PROCESSING,
577 .entity = UVC_GUID_UVC_PROCESSING,
589 .entity = UVC_GUID_UVC_PROCESSING,
601 .entity = UVC_GUID_UVC_PROCESSING,
613 .entity = UVC_GUID_UVC_PROCESSING,
625 .entity = UVC_GUID_UVC_CAMERA,
637 .entity = UVC_GUID_UVC_CAMERA,
648 .entity = UVC_GUID_UVC_CAMERA,
658 .entity = UVC_GUID_UVC_CAMERA,
668 .entity = UVC_GUID_UVC_CAMERA,
678 .entity = UVC_GUID_UVC_CAMERA,
690 .entity = UVC_GUID_UVC_CAMERA,
700 .entity = UVC_GUID_UVC_CAMERA,
710 .entity = UVC_GUID_UVC_CAMERA,
722 .entity = UVC_GUID_UVC_CAMERA,
734 .entity = UVC_GUID_UVC_CAMERA,
833 static int uvc_entity_match_guid(const struct uvc_entity *entity, uvc_entity_match_guid() argument
836 switch (UVC_ENTITY_TYPE(entity)) { uvc_entity_match_guid()
847 return memcmp(entity->extension.guidExtensionCode, uvc_entity_match_guid()
859 static void __uvc_find_control(struct uvc_entity *entity, __u32 v4l2_id, __uvc_find_control() argument
867 if (entity == NULL) __uvc_find_control()
870 for (i = 0; i < entity->ncontrols; ++i) { __uvc_find_control()
871 ctrl = &entity->controls[i]; __uvc_find_control()
895 struct uvc_entity *entity; uvc_find_control() local
904 list_for_each_entry(entity, &chain->entities, chain) { uvc_find_control()
905 __uvc_find_control(entity, v4l2_id, mapping, &ctrl, next); uvc_find_control()
923 ret = uvc_query_ctrl(chain->dev, UVC_GET_DEF, ctrl->entity->id, uvc_ctrl_populate_cache()
932 ret = uvc_query_ctrl(chain->dev, UVC_GET_MIN, ctrl->entity->id, uvc_ctrl_populate_cache()
940 ret = uvc_query_ctrl(chain->dev, UVC_GET_MAX, ctrl->entity->id, uvc_ctrl_populate_cache()
948 ret = uvc_query_ctrl(chain->dev, UVC_GET_RES, ctrl->entity->id, uvc_ctrl_populate_cache()
953 if (UVC_ENTITY_TYPE(ctrl->entity) != uvc_ctrl_populate_cache()
985 ret = uvc_query_ctrl(chain->dev, UVC_GET_CUR, ctrl->entity->id, __uvc_ctrl_get()
1033 __uvc_find_control(ctrl->entity, mapping->master_id, __uvc_query_v4l2_ctrl()
1257 __uvc_find_control(master->entity, slave_id, &mapping, &ctrl, 0); uvc_ctrl_send_slave_event()
1390 struct uvc_entity *entity, int rollback) uvc_ctrl_commit_entity()
1396 if (entity == NULL) uvc_ctrl_commit_entity()
1399 for (i = 0; i < entity->ncontrols; ++i) { uvc_ctrl_commit_entity()
1400 ctrl = &entity->controls[i]; uvc_ctrl_commit_entity()
1418 ret = uvc_query_ctrl(dev, UVC_SET_CUR, ctrl->entity->id, uvc_ctrl_commit_entity()
1444 struct uvc_entity *entity; __uvc_ctrl_commit() local
1448 list_for_each_entry(entity, &chain->entities, chain) { __uvc_ctrl_commit()
1449 ret = uvc_ctrl_commit_entity(chain->dev, entity, rollback); __uvc_ctrl_commit()
1562 ctrl->entity->id, chain->dev->intfnum, uvc_ctrl_set()
1597 u8 entity; uvc_ctrl_fixup_xu_info() member in struct:uvc_ctrl_fixup
1623 if (fixups[i].entity == ctrl->entity->id && uvc_ctrl_fixup_xu_info()
1644 memcpy(info->entity, ctrl->entity->extension.guidExtensionCode, uvc_ctrl_fill_xu_info()
1645 sizeof(info->entity)); uvc_ctrl_fill_xu_info()
1650 ret = uvc_query_ctrl(dev, UVC_GET_LEN, ctrl->entity->id, dev->intfnum, uvc_ctrl_fill_xu_info()
1655 info->entity, info->selector, ret); uvc_ctrl_fill_xu_info()
1662 ret = uvc_query_ctrl(dev, UVC_GET_INFO, ctrl->entity->id, dev->intfnum, uvc_ctrl_fill_xu_info()
1667 info->entity, info->selector, ret); uvc_ctrl_fill_xu_info()
1684 info->entity, info->selector, info->size, uvc_ctrl_fill_xu_info()
1713 "%pUl/%u on device %s entity %u\n", info.entity, uvc_ctrl_init_xu_ctrl()
1714 info.selector, dev->udev->devpath, ctrl->entity->id); uvc_ctrl_init_xu_ctrl()
1722 struct uvc_entity *entity; uvc_xu_ctrl_query() local
1731 list_for_each_entry(entity, &chain->entities, chain) { uvc_xu_ctrl_query()
1732 if (UVC_ENTITY_TYPE(entity) == UVC_VC_EXTENSION_UNIT && uvc_xu_ctrl_query()
1733 entity->id == xqry->unit) uvc_xu_ctrl_query()
1737 if (entity->id != xqry->unit) { uvc_xu_ctrl_query()
1744 for (i = 0; i < entity->ncontrols; ++i) { uvc_xu_ctrl_query()
1745 ctrl = &entity->controls[i]; uvc_xu_ctrl_query()
1754 entity->extension.guidExtensionCode, xqry->selector); uvc_xu_ctrl_query()
1853 struct uvc_entity *entity; uvc_ctrl_restore_values() local
1858 list_for_each_entry(entity, &dev->entities, list) { uvc_ctrl_restore_values()
1860 for (i = 0; i < entity->ncontrols; ++i) { uvc_ctrl_restore_values()
1861 ctrl = &entity->controls[i]; uvc_ctrl_restore_values()
1868 ctrl->info.entity, ctrl->info.index, uvc_ctrl_restore_values()
1873 ret = uvc_ctrl_commit_entity(dev, entity, 0); uvc_ctrl_restore_values()
1907 "entity %u\n", ctrl->info.entity, ctrl->info.selector, uvc_ctrl_add_info()
1908 dev->udev->devpath, ctrl->entity->id); uvc_ctrl_add_info()
1950 map->name, ctrl->info.entity, ctrl->info.selector); __uvc_ctrl_add_mapping()
1960 struct uvc_entity *entity; uvc_ctrl_add_mapping() local
1973 list_for_each_entry(entity, &chain->entities, chain) { uvc_ctrl_add_mapping()
1976 if (UVC_ENTITY_TYPE(entity) != UVC_VC_EXTENSION_UNIT || uvc_ctrl_add_mapping()
1977 !uvc_entity_match_guid(entity, mapping->entity)) uvc_ctrl_add_mapping()
1980 for (i = 0; i < entity->ncontrols; ++i) { uvc_ctrl_add_mapping()
1981 ctrl = &entity->controls[i]; uvc_ctrl_add_mapping()
2034 * Prune an entity of its bogus controls using a blacklist. Bogus controls
2039 struct uvc_entity *entity) uvc_ctrl_prune_entity()
2061 switch (UVC_ENTITY_TYPE(entity)) { uvc_ctrl_prune_entity()
2065 controls = entity->processing.bmControls; uvc_ctrl_prune_entity()
2066 size = entity->processing.bControlSize; uvc_ctrl_prune_entity()
2072 controls = entity->camera.bmControls; uvc_ctrl_prune_entity()
2073 size = entity->camera.bControlSize; uvc_ctrl_prune_entity()
2089 "removing it.\n", entity->id, blacklist[i].index); uvc_ctrl_prune_entity()
2112 if (UVC_ENTITY_TYPE(ctrl->entity) == UVC_VC_EXTENSION_UNIT) uvc_ctrl_init_ctrl()
2116 if (uvc_entity_match_guid(ctrl->entity, info->entity) && uvc_ctrl_init_ctrl()
2127 if (uvc_entity_match_guid(ctrl->entity, mapping->entity) && uvc_ctrl_init_ctrl()
2138 struct uvc_entity *entity; uvc_ctrl_init_device() local
2142 list_for_each_entry(entity, &dev->entities, list) { uvc_ctrl_init_device()
2147 if (UVC_ENTITY_TYPE(entity) == UVC_VC_EXTENSION_UNIT) { uvc_ctrl_init_device()
2148 bmControls = entity->extension.bmControls; uvc_ctrl_init_device()
2149 bControlSize = entity->extension.bControlSize; uvc_ctrl_init_device()
2150 } else if (UVC_ENTITY_TYPE(entity) == UVC_VC_PROCESSING_UNIT) { uvc_ctrl_init_device()
2151 bmControls = entity->processing.bmControls; uvc_ctrl_init_device()
2152 bControlSize = entity->processing.bControlSize; uvc_ctrl_init_device()
2153 } else if (UVC_ENTITY_TYPE(entity) == UVC_ITT_CAMERA) { uvc_ctrl_init_device()
2154 bmControls = entity->camera.bmControls; uvc_ctrl_init_device()
2155 bControlSize = entity->camera.bControlSize; uvc_ctrl_init_device()
2159 uvc_ctrl_prune_entity(dev, entity); uvc_ctrl_init_device()
2166 entity->controls = kcalloc(ncontrols, sizeof(*ctrl), uvc_ctrl_init_device()
2168 if (entity->controls == NULL) uvc_ctrl_init_device()
2170 entity->ncontrols = ncontrols; uvc_ctrl_init_device()
2173 ctrl = entity->controls; uvc_ctrl_init_device()
2178 ctrl->entity = entity; uvc_ctrl_init_device()
2206 struct uvc_entity *entity; uvc_ctrl_cleanup_device() local
2210 list_for_each_entry(entity, &dev->entities, list) { uvc_ctrl_cleanup_device()
2211 for (i = 0; i < entity->ncontrols; ++i) { uvc_ctrl_cleanup_device()
2212 struct uvc_control *ctrl = &entity->controls[i]; uvc_ctrl_cleanup_device()
2221 kfree(entity->controls); uvc_ctrl_cleanup_device()
1389 uvc_ctrl_commit_entity(struct uvc_device *dev, struct uvc_entity *entity, int rollback) uvc_ctrl_commit_entity() argument
2038 uvc_ctrl_prune_entity(struct uvc_device *dev, struct uvc_entity *entity) uvc_ctrl_prune_entity() argument
H A Duvc_driver.c288 struct uvc_entity *entity; uvc_entity_by_id() local
290 list_for_each_entry(entity, &dev->entities, list) { uvc_entity_by_id()
291 if (entity->id == id) uvc_entity_by_id()
292 return entity; uvc_entity_by_id()
299 int id, struct uvc_entity *entity) uvc_entity_by_reference()
303 if (entity == NULL) uvc_entity_by_reference()
304 entity = list_entry(&dev->entities, struct uvc_entity, list); uvc_entity_by_reference()
306 list_for_each_entry_continue(entity, &dev->entities, list) { uvc_entity_by_reference()
307 for (i = 0; i < entity->bNrInPins; ++i) uvc_entity_by_reference()
308 if (entity->baSourceID[i] == id) uvc_entity_by_reference()
309 return entity; uvc_entity_by_reference()
846 struct uvc_entity *entity; uvc_alloc_entity() local
851 extra_size = ALIGN(extra_size, sizeof(*entity->pads)); uvc_alloc_entity()
853 size = sizeof(*entity) + extra_size + sizeof(*entity->pads) * num_pads uvc_alloc_entity()
855 entity = kzalloc(size, GFP_KERNEL); uvc_alloc_entity()
856 if (entity == NULL) uvc_alloc_entity()
859 entity->id = id; uvc_alloc_entity()
860 entity->type = type; uvc_alloc_entity()
862 entity->num_links = 0; uvc_alloc_entity()
863 entity->num_pads = num_pads; uvc_alloc_entity()
864 entity->pads = ((void *)(entity + 1)) + extra_size; uvc_alloc_entity()
867 entity->pads[i].flags = MEDIA_PAD_FL_SINK; uvc_alloc_entity()
868 if (!UVC_ENTITY_IS_OTERM(entity)) uvc_alloc_entity()
869 entity->pads[num_pads-1].flags = MEDIA_PAD_FL_SOURCE; uvc_alloc_entity()
871 entity->bNrInPins = num_inputs; uvc_alloc_entity()
872 entity->baSourceID = (__u8 *)(&entity->pads[num_pads]); uvc_alloc_entity()
874 return entity; uvc_alloc_entity()
1287 struct uvc_entity *entity) uvc_scan_chain_entity()
1289 switch (UVC_ENTITY_TYPE(entity)) { uvc_scan_chain_entity()
1292 printk(" <- XU %d", entity->id); uvc_scan_chain_entity()
1294 if (entity->bNrInPins != 1) { uvc_scan_chain_entity()
1296 "than 1 input pin.\n", entity->id); uvc_scan_chain_entity()
1304 printk(" <- PU %d", entity->id); uvc_scan_chain_entity()
1312 chain->processing = entity; uvc_scan_chain_entity()
1317 printk(" <- SU %d", entity->id); uvc_scan_chain_entity()
1320 if (entity->bNrInPins == 1) uvc_scan_chain_entity()
1329 chain->selector = entity; uvc_scan_chain_entity()
1336 printk(" <- IT %d\n", entity->id); uvc_scan_chain_entity()
1344 printk(" OT %d", entity->id); uvc_scan_chain_entity()
1349 if (UVC_ENTITY_IS_ITERM(entity)) { uvc_scan_chain_entity()
1351 printk(" <- IT %d\n", entity->id); uvc_scan_chain_entity()
1354 printk(" OT %d", entity->id); uvc_scan_chain_entity()
1360 uvc_trace(UVC_TRACE_DESCR, "Unsupported entity type " uvc_scan_chain_entity()
1361 "0x%04x found in chain.\n", UVC_ENTITY_TYPE(entity)); uvc_scan_chain_entity()
1365 list_add_tail(&entity->chain, &chain->entities); uvc_scan_chain_entity()
1370 struct uvc_entity *entity, struct uvc_entity *prev) uvc_scan_chain_forward()
1380 forward = uvc_entity_by_reference(chain->dev, entity->id, uvc_scan_chain_forward()
1392 entity->id); uvc_scan_chain_forward()
1436 struct uvc_entity *entity = *_entity; uvc_scan_chain_backward() local
1440 switch (UVC_ENTITY_TYPE(entity)) { uvc_scan_chain_backward()
1443 id = entity->baSourceID[0]; uvc_scan_chain_backward()
1448 if (entity->bNrInPins == 1) { uvc_scan_chain_backward()
1449 id = entity->baSourceID[0]; uvc_scan_chain_backward()
1456 chain->selector = entity; uvc_scan_chain_backward()
1457 for (i = 0; i < entity->bNrInPins; ++i) { uvc_scan_chain_backward()
1458 id = entity->baSourceID[i]; uvc_scan_chain_backward()
1463 "input terminal\n", entity->id, i); uvc_scan_chain_backward()
1471 uvc_scan_chain_forward(chain, term, entity); uvc_scan_chain_backward()
1487 id = UVC_ENTITY_IS_OTERM(entity) ? entity->baSourceID[0] : 0; uvc_scan_chain_backward()
1496 entity = uvc_entity_by_id(chain->dev, id); uvc_scan_chain_backward()
1497 if (entity == NULL) { uvc_scan_chain_backward()
1499 "unknown entity %d.\n", id); uvc_scan_chain_backward()
1503 *_entity = entity; uvc_scan_chain_backward()
1510 struct uvc_entity *entity, *prev; uvc_scan_chain() local
1514 entity = term; uvc_scan_chain()
1517 while (entity != NULL) { uvc_scan_chain()
1519 if (entity->chain.next || entity->chain.prev) { uvc_scan_chain()
1521 "entity %d already in chain.\n", entity->id); uvc_scan_chain()
1525 /* Process entity */ uvc_scan_chain()
1526 if (uvc_scan_chain_entity(chain, entity) < 0) uvc_scan_chain()
1530 if (uvc_scan_chain_forward(chain, entity, prev) < 0) uvc_scan_chain()
1534 prev = entity; uvc_scan_chain()
1535 if (uvc_scan_chain_backward(chain, &entity) < 0) uvc_scan_chain()
1668 struct uvc_entity *entity; uvc_delete() local
1669 entity = list_entry(p, struct uvc_entity, list); uvc_delete()
1671 uvc_mc_cleanup_entity(entity); uvc_delete()
1673 kfree(entity); uvc_delete()
298 uvc_entity_by_reference(struct uvc_device *dev, int id, struct uvc_entity *entity) uvc_entity_by_reference() argument
1286 uvc_scan_chain_entity(struct uvc_video_chain *chain, struct uvc_entity *entity) uvc_scan_chain_entity() argument
1369 uvc_scan_chain_forward(struct uvc_video_chain *chain, struct uvc_entity *entity, struct uvc_entity *prev) uvc_scan_chain_forward() argument
H A Duvcvideo.h28 #define UVC_ENTITY_TYPE(entity) ((entity)->type & 0x7fff)
29 #define UVC_ENTITY_IS_UNIT(entity) (((entity)->type & 0xff00) == 0)
30 #define UVC_ENTITY_IS_TERM(entity) (((entity)->type & 0xff00) != 0)
31 #define UVC_ENTITY_IS_ITERM(entity) \
32 (UVC_ENTITY_IS_TERM(entity) && \
33 ((entity)->type & 0x8000) == UVC_TERM_INPUT)
34 #define UVC_ENTITY_IS_OTERM(entity) \
35 (UVC_ENTITY_IS_TERM(entity) && \
36 ((entity)->type & 0x8000) == UVC_TERM_OUTPUT)
172 __u8 entity[16]; member in struct:uvc_control_info
186 __u8 entity[16]; member in struct:uvc_control_mapping
208 struct uvc_entity *entity; member in struct:uvc_control
228 /* The term 'entity' refers to both UVC units and UVC terminals.
665 extern void uvc_mc_cleanup_entity(struct uvc_entity *entity);
H A Duvc_v4l2.c49 memcpy(map->entity, xmap->entity, sizeof map->entity); uvc_ioctl_ctrl_map()
1240 __u8 entity[16]; member in struct:uvc_xu_control_mapping32
/linux-4.4.14/drivers/media/platform/vsp1/
H A Dvsp1_entity.c17 #include <media/media-entity.h>
25 bool vsp1_entity_is_streaming(struct vsp1_entity *entity) vsp1_entity_is_streaming() argument
30 spin_lock_irqsave(&entity->lock, flags); vsp1_entity_is_streaming()
31 streaming = entity->streaming; vsp1_entity_is_streaming()
32 spin_unlock_irqrestore(&entity->lock, flags); vsp1_entity_is_streaming()
37 int vsp1_entity_set_streaming(struct vsp1_entity *entity, bool streaming) vsp1_entity_set_streaming() argument
42 spin_lock_irqsave(&entity->lock, flags); vsp1_entity_set_streaming()
43 entity->streaming = streaming; vsp1_entity_set_streaming()
44 spin_unlock_irqrestore(&entity->lock, flags); vsp1_entity_set_streaming()
49 if (!entity->subdev.ctrl_handler) vsp1_entity_set_streaming()
52 ret = v4l2_ctrl_handler_setup(entity->subdev.ctrl_handler); vsp1_entity_set_streaming()
54 spin_lock_irqsave(&entity->lock, flags); vsp1_entity_set_streaming()
55 entity->streaming = false; vsp1_entity_set_streaming()
56 spin_unlock_irqrestore(&entity->lock, flags); vsp1_entity_set_streaming()
67 vsp1_entity_get_pad_format(struct vsp1_entity *entity, vsp1_entity_get_pad_format() argument
73 return v4l2_subdev_get_try_format(&entity->subdev, cfg, pad); vsp1_entity_get_pad_format()
75 return &entity->formats[pad]; vsp1_entity_get_pad_format()
96 for (pad = 0; pad < subdev->entity.num_pads - 1; ++pad) { vsp1_entity_init_formats()
123 static int vsp1_entity_link_setup(struct media_entity *entity, vsp1_entity_link_setup() argument
132 source = container_of(local->entity, struct vsp1_entity, subdev.entity); vsp1_entity_link_setup()
140 source->sink = remote->entity; vsp1_entity_link_setup()
182 int vsp1_entity_init(struct vsp1_device *vsp1, struct vsp1_entity *entity, vsp1_entity_init() argument
188 if (vsp1_routes[i].type == entity->type && vsp1_entity_init()
189 vsp1_routes[i].index == entity->index) { vsp1_entity_init()
190 entity->route = &vsp1_routes[i]; vsp1_entity_init()
198 spin_lock_init(&entity->lock); vsp1_entity_init()
200 entity->vsp1 = vsp1; vsp1_entity_init()
201 entity->source_pad = num_pads - 1; vsp1_entity_init()
204 entity->formats = devm_kzalloc(vsp1->dev, vsp1_entity_init()
205 num_pads * sizeof(*entity->formats), vsp1_entity_init()
207 if (entity->formats == NULL) vsp1_entity_init()
210 entity->pads = devm_kzalloc(vsp1->dev, num_pads * sizeof(*entity->pads), vsp1_entity_init()
212 if (entity->pads == NULL) vsp1_entity_init()
217 entity->pads[i].flags = MEDIA_PAD_FL_SINK; vsp1_entity_init()
219 entity->pads[num_pads - 1].flags = MEDIA_PAD_FL_SOURCE; vsp1_entity_init()
221 /* Initialize the media entity. */ vsp1_entity_init()
222 return media_entity_init(&entity->subdev.entity, num_pads, vsp1_entity_init()
223 entity->pads, 0); vsp1_entity_init()
226 void vsp1_entity_destroy(struct vsp1_entity *entity) vsp1_entity_destroy() argument
228 if (entity->video) vsp1_entity_destroy()
229 vsp1_video_cleanup(entity->video); vsp1_entity_destroy()
230 if (entity->subdev.ctrl_handler) vsp1_entity_destroy()
231 v4l2_ctrl_handler_free(entity->subdev.ctrl_handler); vsp1_entity_destroy()
232 media_entity_cleanup(&entity->subdev.entity); vsp1_entity_destroy()
H A Dvsp1_wpf.c31 return vsp1_read(wpf->entity.vsp1, vsp1_wpf_read()
32 reg + wpf->entity.index * VI6_WPF_OFFSET); vsp1_wpf_read()
37 vsp1_write(wpf->entity.vsp1, vsp1_wpf_write()
38 reg + wpf->entity.index * VI6_WPF_OFFSET, data); vsp1_wpf_write()
51 if (!vsp1_entity_is_streaming(&wpf->entity)) wpf_s_ctrl()
76 struct vsp1_pipeline *pipe = to_vsp1_pipeline(&subdev->entity); wpf_s_stream()
78 struct vsp1_device *vsp1 = wpf->entity.vsp1; wpf_s_stream()
85 ret = vsp1_entity_set_streaming(&wpf->entity, enable); wpf_s_stream()
90 vsp1_write(vsp1, VI6_WPF_IRQ_ENB(wpf->entity.index), 0); wpf_s_stream()
104 ? VI6_WPF_SRCRPF_RPF_ACT_MST(input->entity.index) wpf_s_stream()
105 : VI6_WPF_SRCRPF_RPF_ACT_SUB(input->entity.index); wpf_s_stream()
147 if (wpf->entity.formats[RWPF_PAD_SINK].code != wpf_s_stream()
148 wpf->entity.formats[RWPF_PAD_SOURCE].code) wpf_s_stream()
159 vsp1_write(vsp1, VI6_DPR_WPF_FPORCH(wpf->entity.index), wpf_s_stream()
165 vsp1_write(vsp1, VI6_WPF_IRQ_STA(wpf->entity.index), 0); wpf_s_stream()
166 vsp1_write(vsp1, VI6_WPF_IRQ_ENB(wpf->entity.index), wpf_s_stream()
233 wpf->entity.type = VSP1_ENTITY_WPF; vsp1_wpf_create()
234 wpf->entity.index = index; vsp1_wpf_create()
236 ret = vsp1_entity_init(vsp1, &wpf->entity, 2); vsp1_wpf_create()
241 subdev = &wpf->entity.subdev; vsp1_wpf_create()
244 subdev->entity.ops = &vsp1_media_ops; vsp1_wpf_create()
258 wpf->entity.subdev.ctrl_handler = &wpf->ctrls; vsp1_wpf_create()
274 ret = vsp1_video_init(video, &wpf->entity); vsp1_wpf_create()
278 wpf->entity.video = video; vsp1_wpf_create()
287 ret = media_entity_create_link(&wpf->entity.subdev.entity, vsp1_wpf_create()
289 &wpf->video.video.entity, 0, flags); vsp1_wpf_create()
293 wpf->entity.sink = &wpf->video.video.entity; vsp1_wpf_create()
298 vsp1_entity_destroy(&wpf->entity); vsp1_wpf_create()
H A Dvsp1_hsit.h16 #include <media/media-entity.h>
27 struct vsp1_entity entity; member in struct:vsp1_hsit
33 return container_of(subdev, struct vsp1_hsit, entity.subdev); to_hsit()
H A Dvsp1_lif.h16 #include <media/media-entity.h>
27 struct vsp1_entity entity; member in struct:vsp1_lif
32 return container_of(subdev, struct vsp1_lif, entity.subdev); to_lif()
H A Dvsp1_lut.h16 #include <media/media-entity.h>
27 struct vsp1_entity entity; member in struct:vsp1_lut
33 return container_of(subdev, struct vsp1_lut, entity.subdev); to_lut()
H A Dvsp1_sru.h16 #include <media/media-entity.h>
28 struct vsp1_entity entity; member in struct:vsp1_sru
35 return container_of(subdev, struct vsp1_sru, entity.subdev); to_sru()
H A Dvsp1_drv.c51 pipe = to_vsp1_pipeline(&wpf->entity.subdev.entity); vsp1_irq_handler()
76 * - from an entity to itself (no loops are allowed)
80 struct media_entity *entity = &sink->subdev.entity; vsp1_create_links() local
100 for (pad = 0; pad < entity->num_pads; ++pad) { vsp1_create_links()
101 if (!(entity->pads[pad].flags & MEDIA_PAD_FL_SINK)) vsp1_create_links()
104 ret = media_entity_create_link(&source->subdev.entity, vsp1_create_links()
106 entity, pad, flags); vsp1_create_links()
111 source->sink = entity; vsp1_create_links()
120 struct vsp1_entity *entity; vsp1_destroy_entities() local
123 list_for_each_entry_safe(entity, next, &vsp1->entities, list_dev) { vsp1_destroy_entities()
124 list_del(&entity->list_dev); vsp1_destroy_entities()
125 vsp1_entity_destroy(entity); vsp1_destroy_entities()
136 struct vsp1_entity *entity; vsp1_create_entities() local
166 list_add_tail(&vsp1->bru->entity.list_dev, &vsp1->entities); vsp1_create_entities()
174 list_add_tail(&vsp1->hsi->entity.list_dev, &vsp1->entities); vsp1_create_entities()
182 list_add_tail(&vsp1->hst->entity.list_dev, &vsp1->entities); vsp1_create_entities()
191 list_add_tail(&vsp1->lif->entity.list_dev, &vsp1->entities); vsp1_create_entities()
201 list_add_tail(&vsp1->lut->entity.list_dev, &vsp1->entities); vsp1_create_entities()
214 list_add_tail(&rpf->entity.list_dev, &vsp1->entities); vsp1_create_entities()
224 list_add_tail(&vsp1->sru->entity.list_dev, &vsp1->entities); vsp1_create_entities()
237 list_add_tail(&uds->entity.list_dev, &vsp1->entities); vsp1_create_entities()
250 list_add_tail(&wpf->entity.list_dev, &vsp1->entities); vsp1_create_entities()
254 list_for_each_entry(entity, &vsp1->entities, list_dev) { vsp1_create_entities()
255 if (entity->type == VSP1_ENTITY_LIF || vsp1_create_entities()
256 entity->type == VSP1_ENTITY_RPF) vsp1_create_entities()
259 ret = vsp1_create_links(vsp1, entity); vsp1_create_entities()
266 &vsp1->wpf[0]->entity.subdev.entity, RWPF_PAD_SOURCE, vsp1_create_entities()
267 &vsp1->lif->entity.subdev.entity, LIF_PAD_SINK, 0); vsp1_create_entities()
273 list_for_each_entry(entity, &vsp1->entities, list_dev) { vsp1_create_entities()
275 &entity->subdev); vsp1_create_entities()
H A Dvsp1_entity.h43 * Each $vsp1_route entry describes routing configuration for the entity
45 * holds output routing configuration for the entity, and the @inputs array
46 * store the target node value for each input of the entity.
85 int vsp1_entity_init(struct vsp1_device *vsp1, struct vsp1_entity *entity,
87 void vsp1_entity_destroy(struct vsp1_entity *entity);
93 vsp1_entity_get_pad_format(struct vsp1_entity *entity,
99 bool vsp1_entity_is_streaming(struct vsp1_entity *entity);
100 int vsp1_entity_set_streaming(struct vsp1_entity *entity, bool streaming);
H A Dvsp1_rpf.c31 return vsp1_read(rpf->entity.vsp1, vsp1_rpf_read()
32 reg + rpf->entity.index * VI6_RPF_OFFSET); vsp1_rpf_read()
37 vsp1_write(rpf->entity.vsp1, vsp1_rpf_write()
38 reg + rpf->entity.index * VI6_RPF_OFFSET, data); vsp1_rpf_write()
51 if (!vsp1_entity_is_streaming(&rpf->entity)) rpf_s_ctrl()
59 pipe = to_vsp1_pipeline(&rpf->entity.subdev.entity); rpf_s_ctrl()
60 vsp1_pipeline_propagate_alpha(pipe, &rpf->entity, ctrl->val); rpf_s_ctrl()
85 ret = vsp1_entity_set_streaming(&rpf->entity, enable); rpf_s_stream()
138 if (rpf->entity.formats[RWPF_PAD_SINK].code != rpf_s_stream()
139 rpf->entity.formats[RWPF_PAD_SOURCE].code) rpf_s_stream()
198 if (!vsp1_entity_is_streaming(&rpf->entity)) rpf_vdev_queue()
233 rpf->entity.type = VSP1_ENTITY_RPF; vsp1_rpf_create()
234 rpf->entity.index = index; vsp1_rpf_create()
236 ret = vsp1_entity_init(vsp1, &rpf->entity, 2); vsp1_rpf_create()
241 subdev = &rpf->entity.subdev; vsp1_rpf_create()
244 subdev->entity.ops = &vsp1_media_ops; vsp1_rpf_create()
258 rpf->entity.subdev.ctrl_handler = &rpf->ctrls; vsp1_rpf_create()
274 ret = vsp1_video_init(video, &rpf->entity); vsp1_rpf_create()
278 rpf->entity.video = video; vsp1_rpf_create()
281 ret = media_entity_create_link(&rpf->video.video.entity, 0, vsp1_rpf_create()
282 &rpf->entity.subdev.entity, vsp1_rpf_create()
292 vsp1_entity_destroy(&rpf->entity); vsp1_rpf_create()
H A Dvsp1_bru.h16 #include <media/media-entity.h>
29 struct vsp1_entity entity; member in struct:vsp1_bru
41 return container_of(subdev, struct vsp1_bru, entity.subdev); to_bru()
H A Dvsp1_lif.c31 return vsp1_read(lif->entity.vsp1, reg); vsp1_lif_read()
36 vsp1_write(lif->entity.vsp1, reg, data); vsp1_lif_write()
56 format = &lif->entity.formats[LIF_PAD_SOURCE]; lif_s_stream()
100 format = vsp1_entity_get_pad_format(&lif->entity, cfg, lif_enum_mbus_code()
115 format = vsp1_entity_get_pad_format(&lif->entity, cfg, LIF_PAD_SINK, lif_enum_frame_size()
141 fmt->format = *vsp1_entity_get_pad_format(&lif->entity, cfg, fmt->pad, lif_get_format()
158 format = vsp1_entity_get_pad_format(&lif->entity, cfg, fmt->pad, lif_set_format()
180 format = vsp1_entity_get_pad_format(&lif->entity, cfg, LIF_PAD_SOURCE, lif_set_format()
221 lif->entity.type = VSP1_ENTITY_LIF; vsp1_lif_create()
223 ret = vsp1_entity_init(vsp1, &lif->entity, 2); vsp1_lif_create()
228 subdev = &lif->entity.subdev; vsp1_lif_create()
231 subdev->entity.ops = &vsp1_media_ops; vsp1_lif_create()
H A Dvsp1_lut.c32 return vsp1_read(lut->entity.vsp1, reg); vsp1_lut_read()
37 vsp1_write(lut->entity.vsp1, reg, data); vsp1_lut_write()
46 memcpy_toio(lut->entity.vsp1->mmio + VI6_LUT_TABLE, config->lut, lut_configure()
108 format = vsp1_entity_get_pad_format(&lut->entity, cfg, lut_enum_mbus_code()
123 format = vsp1_entity_get_pad_format(&lut->entity, cfg, lut_enum_frame_size()
152 fmt->format = *vsp1_entity_get_pad_format(&lut->entity, cfg, fmt->pad, lut_get_format()
170 format = vsp1_entity_get_pad_format(&lut->entity, cfg, fmt->pad, lut_set_format()
189 format = vsp1_entity_get_pad_format(&lut->entity, cfg, LUT_PAD_SOURCE, lut_set_format()
235 lut->entity.type = VSP1_ENTITY_LUT; vsp1_lut_create()
237 ret = vsp1_entity_init(vsp1, &lut->entity, 2); vsp1_lut_create()
242 subdev = &lut->entity.subdev; vsp1_lut_create()
245 subdev->entity.ops = &vsp1_media_ops; vsp1_lut_create()
H A Dvsp1_uds.h16 #include <media/media-entity.h>
27 struct vsp1_entity entity; member in struct:vsp1_uds
33 return container_of(subdev, struct vsp1_uds, entity.subdev); to_uds()
H A Dvsp1_video.c22 #include <media/media-entity.h>
164 media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV) vsp1_video_remote_subdev()
170 return media_entity_to_v4l2_subdev(remote->entity); vsp1_video_remote_subdev()
314 struct vsp1_entity *entity; vsp1_pipeline_validate_branch() local
322 pad = media_entity_remote_pad(&input->entity.pads[RWPF_PAD_SOURCE]); vsp1_pipeline_validate_branch()
329 if (media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) vsp1_pipeline_validate_branch()
332 entity = to_vsp1_entity(media_entity_to_v4l2_subdev(pad->entity)); vsp1_pipeline_validate_branch()
337 if (entity->type == VSP1_ENTITY_BRU) { vsp1_pipeline_validate_branch()
338 struct vsp1_bru *bru = to_bru(&entity->subdev); vsp1_pipeline_validate_branch()
351 if (entity->type == VSP1_ENTITY_WPF) vsp1_pipeline_validate_branch()
355 if (entities & (1 << entity->subdev.entity.id)) vsp1_pipeline_validate_branch()
358 entities |= 1 << entity->subdev.entity.id; vsp1_pipeline_validate_branch()
361 if (entity->type == VSP1_ENTITY_UDS) { vsp1_pipeline_validate_branch()
365 pipe->uds = entity; vsp1_pipeline_validate_branch()
367 : &input->entity; vsp1_pipeline_validate_branch()
375 pad = &entity->pads[entity->source_pad]; vsp1_pipeline_validate_branch()
379 /* The last entity must be the output WPF. */ vsp1_pipeline_validate_branch()
380 if (entity != &output->entity) vsp1_pipeline_validate_branch()
411 struct media_entity *entity = &video->video.entity; vsp1_pipeline_validate() local
412 struct media_device *mdev = entity->parent; vsp1_pipeline_validate()
419 media_entity_graph_walk_start(&graph, entity); vsp1_pipeline_validate()
421 while ((entity = media_entity_graph_walk_next(&graph))) { vsp1_pipeline_validate()
426 if (media_entity_type(entity) != MEDIA_ENT_T_V4L2_SUBDEV) { vsp1_pipeline_validate()
431 subdev = media_entity_to_v4l2_subdev(entity); vsp1_pipeline_validate()
510 struct vsp1_device *vsp1 = pipe->output->entity.vsp1; vsp1_pipeline_run()
512 vsp1_write(vsp1, VI6_CMD(pipe->output->entity.index), VI6_CMD_STRCMD); vsp1_pipeline_run()
531 struct vsp1_entity *entity; vsp1_pipeline_stop() local
544 list_for_each_entry(entity, &pipe->entities, list_pipe) { vsp1_pipeline_stop()
545 if (entity->route && entity->route->reg) vsp1_pipeline_stop()
546 vsp1_write(entity->vsp1, entity->route->reg, vsp1_pipeline_stop()
549 v4l2_subdev_call(&entity->subdev, video, s_stream, 0); vsp1_pipeline_stop()
583 struct vsp1_pipeline *pipe = to_vsp1_pipeline(&video->video.entity); vsp1_video_complete_buffer()
689 struct vsp1_entity *entity; vsp1_pipeline_propagate_alpha() local
695 if (media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) vsp1_pipeline_propagate_alpha()
698 entity = to_vsp1_entity(media_entity_to_v4l2_subdev(pad->entity)); vsp1_pipeline_propagate_alpha()
703 if (entity->type == VSP1_ENTITY_BRU) vsp1_pipeline_propagate_alpha()
706 if (entity->type == VSP1_ENTITY_UDS) { vsp1_pipeline_propagate_alpha()
707 struct vsp1_uds *uds = to_uds(&entity->subdev); vsp1_pipeline_propagate_alpha()
713 pad = &entity->pads[entity->source_pad]; vsp1_pipeline_propagate_alpha()
735 pipe = to_vsp1_pipeline(&wpf->entity.subdev.entity); vsp1_pipelines_suspend()
752 pipe = to_vsp1_pipeline(&wpf->entity.subdev.entity); vsp1_pipelines_suspend()
760 wpf->entity.index); vsp1_pipelines_suspend()
776 pipe = to_vsp1_pipeline(&wpf->entity.subdev.entity); vsp1_pipelines_resume()
848 struct vsp1_pipeline *pipe = to_vsp1_pipeline(&video->video.entity); vsp1_video_buffer_queue()
880 sink = container_of(source->sink, struct vsp1_entity, subdev.entity); vsp1_entity_route_setup()
888 struct vsp1_pipeline *pipe = to_vsp1_pipeline(&video->video.entity); vsp1_video_start_streaming()
889 struct vsp1_entity *entity; vsp1_video_start_streaming() local
914 list_for_each_entry(entity, &pipe->entities, list_pipe) { vsp1_video_start_streaming()
915 vsp1_entity_route_setup(entity); vsp1_video_start_streaming()
917 ret = v4l2_subdev_call(&entity->subdev, video, vsp1_video_start_streaming()
940 struct vsp1_pipeline *pipe = to_vsp1_pipeline(&video->video.entity); vsp1_video_stop_streaming()
955 media_entity_pipeline_stop(&video->video.entity); vsp1_video_stop_streaming()
1075 /* Start streaming on the pipeline. No link touching an entity in the vsp1_video_streamon()
1081 pipe = video->video.entity.pipe vsp1_video_streamon()
1082 ? to_vsp1_pipeline(&video->video.entity) : &video->pipe; vsp1_video_streamon()
1084 ret = media_entity_pipeline_start(&video->video.entity, &pipe->pipe); vsp1_video_streamon()
1109 media_entity_pipeline_stop(&video->video.entity); vsp1_video_streamon()
1226 /* Initialize the media entity... */ vsp1_video_init()
1227 ret = media_entity_init(&video->video.entity, 1, &video->pad, 0); vsp1_video_init()
1298 media_entity_cleanup(&video->video.entity); vsp1_video_cleanup()
H A Dvsp1_uds.c34 return vsp1_read(uds->entity.vsp1, vsp1_uds_read()
35 reg + uds->entity.index * VI6_UDS_OFFSET); vsp1_uds_read()
40 vsp1_write(uds->entity.vsp1, vsp1_uds_write()
41 reg + uds->entity.index * VI6_UDS_OFFSET, data); vsp1_uds_write()
129 input = &uds->entity.formats[UDS_PAD_SINK]; uds_s_stream()
130 output = &uds->entity.formats[UDS_PAD_SOURCE]; uds_s_stream()
135 dev_dbg(uds->entity.vsp1->dev, "hscale %u vscale %u\n", hscale, vscale); uds_s_stream()
195 format = vsp1_entity_get_pad_format(&uds->entity, cfg, uds_enum_mbus_code()
210 format = vsp1_entity_get_pad_format(&uds->entity, cfg, uds_enum_frame_size()
236 fmt->format = *vsp1_entity_get_pad_format(&uds->entity, cfg, fmt->pad, uds_get_format()
263 format = vsp1_entity_get_pad_format(&uds->entity, cfg, uds_try_format()
286 format = vsp1_entity_get_pad_format(&uds->entity, cfg, fmt->pad, uds_set_format()
292 format = vsp1_entity_get_pad_format(&uds->entity, cfg, uds_set_format()
336 uds->entity.type = VSP1_ENTITY_UDS; vsp1_uds_create()
337 uds->entity.index = index; vsp1_uds_create()
339 ret = vsp1_entity_init(vsp1, &uds->entity, 2); vsp1_uds_create()
344 subdev = &uds->entity.subdev; vsp1_uds_create()
347 subdev->entity.ops = &vsp1_media_ops; vsp1_uds_create()
H A Dvsp1_sru.c31 return vsp1_read(sru->entity.vsp1, reg); vsp1_sru_read()
36 vsp1_write(sru->entity.vsp1, reg, data); vsp1_sru_write()
132 ret = vsp1_entity_set_streaming(&sru->entity, enable); sru_s_stream()
139 input = &sru->entity.formats[SRU_PAD_SINK]; sru_s_stream()
140 output = &sru->entity.formats[SRU_PAD_SOURCE]; sru_s_stream()
192 format = vsp1_entity_get_pad_format(&sru->entity, cfg, sru_enum_mbus_code()
207 format = vsp1_entity_get_pad_format(&sru->entity, cfg, sru_enum_frame_size()
239 fmt->format = *vsp1_entity_get_pad_format(&sru->entity, cfg, fmt->pad, sru_get_format()
266 format = vsp1_entity_get_pad_format(&sru->entity, cfg, sru_try_format()
304 format = vsp1_entity_get_pad_format(&sru->entity, cfg, fmt->pad, sru_set_format()
310 format = vsp1_entity_get_pad_format(&sru->entity, cfg, sru_set_format()
354 sru->entity.type = VSP1_ENTITY_SRU; vsp1_sru_create()
356 ret = vsp1_entity_init(vsp1, &sru->entity, 2); vsp1_sru_create()
361 subdev = &sru->entity.subdev; vsp1_sru_create()
364 subdev->entity.ops = &vsp1_media_ops; vsp1_sru_create()
377 sru->entity.subdev.ctrl_handler = &sru->ctrls; vsp1_sru_create()
382 vsp1_entity_destroy(&sru->entity); vsp1_sru_create()
H A Dvsp1_hsit.c31 vsp1_write(hsit->entity.vsp1, reg, data); vsp1_hsit_write()
82 format = vsp1_entity_get_pad_format(&hsit->entity, cfg, fse->pad, hsit_enum_frame_size()
112 fmt->format = *vsp1_entity_get_pad_format(&hsit->entity, cfg, fmt->pad, hsit_get_format()
125 format = vsp1_entity_get_pad_format(&hsit->entity, cfg, fmt->pad, hsit_set_format()
148 format = vsp1_entity_get_pad_format(&hsit->entity, cfg, HSIT_PAD_SOURCE, hsit_set_format()
194 hsit->entity.type = VSP1_ENTITY_HSI; vsp1_hsit_create()
196 hsit->entity.type = VSP1_ENTITY_HST; vsp1_hsit_create()
198 ret = vsp1_entity_init(vsp1, &hsit->entity, 2); vsp1_hsit_create()
203 subdev = &hsit->entity.subdev; vsp1_hsit_create()
206 subdev->entity.ops = &vsp1_media_ops; vsp1_hsit_create()
H A Dvsp1_bru.c32 return vsp1_read(bru->entity.vsp1, reg); vsp1_bru_read()
37 vsp1_write(bru->entity.vsp1, reg, data); vsp1_bru_write()
49 if (!vsp1_entity_is_streaming(&bru->entity)) bru_s_ctrl()
72 struct vsp1_pipeline *pipe = to_vsp1_pipeline(&subdev->entity); bru_s_stream()
79 ret = vsp1_entity_set_streaming(&bru->entity, enable); bru_s_stream()
86 format = &bru->entity.formats[BRU_PAD_SOURCE]; bru_s_stream()
205 format = vsp1_entity_get_pad_format(&bru->entity, cfg, bru_enum_mbus_code()
238 return v4l2_subdev_get_try_crop(&bru->entity.subdev, cfg, pad); bru_get_compose()
251 fmt->format = *vsp1_entity_get_pad_format(&bru->entity, cfg, fmt->pad, bru_get_format()
273 format = vsp1_entity_get_pad_format(&bru->entity, cfg, bru_try_format()
293 format = vsp1_entity_get_pad_format(&bru->entity, cfg, fmt->pad, bru_set_format()
313 format = vsp1_entity_get_pad_format(&bru->entity, cfg, bru_set_format()
365 format = vsp1_entity_get_pad_format(&bru->entity, cfg, BRU_PAD_SOURCE, bru_set_selection()
373 format = vsp1_entity_get_pad_format(&bru->entity, cfg, sel->pad, bru_set_selection()
420 bru->entity.type = VSP1_ENTITY_BRU; vsp1_bru_create()
422 ret = vsp1_entity_init(vsp1, &bru->entity, 5); vsp1_bru_create()
427 subdev = &bru->entity.subdev; vsp1_bru_create()
430 subdev->entity.ops = &vsp1_media_ops; vsp1_bru_create()
444 bru->entity.subdev.ctrl_handler = &bru->ctrls; vsp1_bru_create()
449 vsp1_entity_destroy(&bru->entity); vsp1_bru_create()
H A Dvsp1_rwpf.h16 #include <media/media-entity.h>
28 struct vsp1_entity entity; member in struct:vsp1_rwpf
47 return container_of(subdev, struct vsp1_rwpf, entity.subdev); to_rwpf()
H A Dvsp1_rwpf.c51 format = vsp1_entity_get_pad_format(&rwpf->entity, cfg, fse->pad, vsp1_rwpf_enum_frame_size()
80 return v4l2_subdev_get_try_crop(&rwpf->entity.subdev, cfg, RWPF_PAD_SINK); vsp1_rwpf_get_crop()
93 fmt->format = *vsp1_entity_get_pad_format(&rwpf->entity, cfg, fmt->pad, vsp1_rwpf_get_format()
111 format = vsp1_entity_get_pad_format(&rwpf->entity, cfg, fmt->pad, vsp1_rwpf_set_format()
141 format = vsp1_entity_get_pad_format(&rwpf->entity, cfg, RWPF_PAD_SOURCE, vsp1_rwpf_set_format()
165 format = vsp1_entity_get_pad_format(&rwpf->entity, cfg, vsp1_rwpf_get_selection()
198 format = vsp1_entity_get_pad_format(&rwpf->entity, cfg, RWPF_PAD_SINK, vsp1_rwpf_set_selection()
213 if (rwpf->entity.type == VSP1_ENTITY_WPF) { vsp1_rwpf_set_selection()
226 format = vsp1_entity_get_pad_format(&rwpf->entity, cfg, RWPF_PAD_SOURCE, vsp1_rwpf_set_selection()
H A Dvsp1_video.h20 #include <media/media-entity.h>
/linux-4.4.14/drivers/gpu/drm/amd/scheduler/
H A Dgpu_scheduler.c33 static bool amd_sched_entity_is_ready(struct amd_sched_entity *entity);
48 struct amd_sched_entity *entity) amd_sched_rq_add_entity()
51 list_add_tail(&entity->list, &rq->entities); amd_sched_rq_add_entity()
56 struct amd_sched_entity *entity) amd_sched_rq_remove_entity()
59 list_del_init(&entity->list); amd_sched_rq_remove_entity()
60 if (rq->current_entity == entity) amd_sched_rq_remove_entity()
66 * Select an entity which could provide a job to run
70 * Try to find a ready entity, returns NULL if none found.
75 struct amd_sched_entity *entity; amd_sched_rq_select_entity() local
79 entity = rq->current_entity; amd_sched_rq_select_entity()
80 if (entity) { amd_sched_rq_select_entity()
81 list_for_each_entry_continue(entity, &rq->entities, list) { amd_sched_rq_select_entity()
82 if (amd_sched_entity_is_ready(entity)) { amd_sched_rq_select_entity()
83 rq->current_entity = entity; amd_sched_rq_select_entity()
85 return entity; amd_sched_rq_select_entity()
90 list_for_each_entry(entity, &rq->entities, list) { amd_sched_rq_select_entity()
92 if (amd_sched_entity_is_ready(entity)) { amd_sched_rq_select_entity()
93 rq->current_entity = entity; amd_sched_rq_select_entity()
95 return entity; amd_sched_rq_select_entity()
98 if (entity == rq->current_entity) amd_sched_rq_select_entity()
108 * Init a context entity used by scheduler when submit to HW ring.
111 * @entity The pointer to a valid amd_sched_entity
112 * @rq The run queue this entity belongs
113 * @kernel If this is an entity for the kernel
119 struct amd_sched_entity *entity, amd_sched_entity_init()
125 if (!(sched && entity && rq)) amd_sched_entity_init()
128 memset(entity, 0, sizeof(struct amd_sched_entity)); amd_sched_entity_init()
129 INIT_LIST_HEAD(&entity->list); amd_sched_entity_init()
130 entity->rq = rq; amd_sched_entity_init()
131 entity->sched = sched; amd_sched_entity_init()
133 spin_lock_init(&entity->queue_lock); amd_sched_entity_init()
134 r = kfifo_alloc(&entity->job_queue, jobs * sizeof(void *), GFP_KERNEL); amd_sched_entity_init()
138 atomic_set(&entity->fence_seq, 0); amd_sched_entity_init()
139 entity->fence_context = fence_context_alloc(1); amd_sched_entity_init()
141 /* Add the entity to the run queue */ amd_sched_entity_init()
142 amd_sched_rq_add_entity(rq, entity); amd_sched_entity_init()
148 * Query if entity is initialized
151 * @entity The pointer to a valid scheduler entity
153 * return true if entity is initialized, false otherwise
156 struct amd_sched_entity *entity) amd_sched_entity_is_initialized()
158 return entity->sched == sched && amd_sched_entity_is_initialized()
159 entity->rq != NULL; amd_sched_entity_is_initialized()
163 * Check if entity is idle
165 * @entity The pointer to a valid scheduler entity
167 * Return true if entity don't has any unscheduled jobs.
169 static bool amd_sched_entity_is_idle(struct amd_sched_entity *entity) amd_sched_entity_is_idle() argument
172 if (kfifo_is_empty(&entity->job_queue)) amd_sched_entity_is_idle()
179 * Check if entity is ready
181 * @entity The pointer to a valid scheduler entity
183 * Return true if entity could provide a job.
185 static bool amd_sched_entity_is_ready(struct amd_sched_entity *entity) amd_sched_entity_is_ready() argument
187 if (kfifo_is_empty(&entity->job_queue)) amd_sched_entity_is_ready()
190 if (ACCESS_ONCE(entity->dependency)) amd_sched_entity_is_ready()
197 * Destroy a context entity
200 * @entity The pointer to a valid scheduler entity
205 struct amd_sched_entity *entity) amd_sched_entity_fini()
207 struct amd_sched_rq *rq = entity->rq; amd_sched_entity_fini()
209 if (!amd_sched_entity_is_initialized(sched, entity)) amd_sched_entity_fini()
216 wait_event(sched->job_scheduled, amd_sched_entity_is_idle(entity)); amd_sched_entity_fini()
218 amd_sched_rq_remove_entity(rq, entity); amd_sched_entity_fini()
219 kfifo_free(&entity->job_queue); amd_sched_entity_fini()
224 struct amd_sched_entity *entity = amd_sched_entity_wakeup() local
226 entity->dependency = NULL; amd_sched_entity_wakeup()
228 amd_sched_wakeup(entity->sched); amd_sched_entity_wakeup()
231 static bool amd_sched_entity_add_dependency_cb(struct amd_sched_entity *entity) amd_sched_entity_add_dependency_cb() argument
233 struct amd_gpu_scheduler *sched = entity->sched; amd_sched_entity_add_dependency_cb()
234 struct fence * fence = entity->dependency; amd_sched_entity_add_dependency_cb()
237 if (fence->context == entity->fence_context) { amd_sched_entity_add_dependency_cb()
239 fence_put(entity->dependency); amd_sched_entity_add_dependency_cb()
248 fence_put(entity->dependency); amd_sched_entity_add_dependency_cb()
253 entity->cb.func = amd_sched_entity_wakeup; amd_sched_entity_add_dependency_cb()
254 list_add_tail(&entity->cb.node, &s_fence->scheduled_cb); amd_sched_entity_add_dependency_cb()
258 if (!fence_add_callback(entity->dependency, &entity->cb, amd_sched_entity_add_dependency_cb()
262 fence_put(entity->dependency); amd_sched_entity_add_dependency_cb()
267 amd_sched_entity_pop_job(struct amd_sched_entity *entity) amd_sched_entity_pop_job() argument
269 struct amd_gpu_scheduler *sched = entity->sched; amd_sched_entity_pop_job()
272 if (!kfifo_out_peek(&entity->job_queue, &sched_job, sizeof(sched_job))) amd_sched_entity_pop_job()
275 while ((entity->dependency = sched->ops->dependency(sched_job))) amd_sched_entity_pop_job()
276 if (amd_sched_entity_add_dependency_cb(entity)) amd_sched_entity_pop_job()
292 struct amd_sched_entity *entity = sched_job->s_entity; amd_sched_entity_in() local
295 spin_lock(&entity->queue_lock); amd_sched_entity_in()
296 added = kfifo_in(&entity->job_queue, &sched_job, amd_sched_entity_in()
299 if (added && kfifo_len(&entity->job_queue) == sizeof(sched_job)) amd_sched_entity_in()
302 spin_unlock(&entity->queue_lock); amd_sched_entity_in()
320 struct amd_sched_entity *entity = sched_job->s_entity; amd_sched_entity_push_job() local
323 wait_event(entity->sched->job_scheduled, amd_sched_entity_push_job()
346 * Select next entity to process
351 struct amd_sched_entity *entity; amd_sched_select_entity() local
357 entity = amd_sched_rq_select_entity(&sched->kernel_rq); amd_sched_select_entity()
358 if (entity == NULL) amd_sched_select_entity()
359 entity = amd_sched_rq_select_entity(&sched->sched_rq); amd_sched_select_entity()
361 return entity; amd_sched_select_entity()
389 struct amd_sched_fence *entity, *tmp; amd_sched_fence_work_func() local
396 list_for_each_entry_safe(entity, tmp, &sched->fence_list, list) { amd_sched_fence_work_func()
397 DRM_ERROR(" fence no %d\n", entity->base.seqno); amd_sched_fence_work_func()
398 cancel_delayed_work(&entity->dwork); amd_sched_fence_work_func()
399 list_del_init(&entity->list); amd_sched_fence_work_func()
400 fence_put(&entity->base); amd_sched_fence_work_func()
416 struct amd_sched_entity *entity; amd_sched_main() local
423 (entity = amd_sched_select_entity(sched)) || amd_sched_main()
426 if (!entity) amd_sched_main()
429 sched_job = amd_sched_entity_pop_job(entity); amd_sched_main()
459 count = kfifo_out(&entity->job_queue, &sched_job, amd_sched_main()
47 amd_sched_rq_add_entity(struct amd_sched_rq *rq, struct amd_sched_entity *entity) amd_sched_rq_add_entity() argument
55 amd_sched_rq_remove_entity(struct amd_sched_rq *rq, struct amd_sched_entity *entity) amd_sched_rq_remove_entity() argument
118 amd_sched_entity_init(struct amd_gpu_scheduler *sched, struct amd_sched_entity *entity, struct amd_sched_rq *rq, uint32_t jobs) amd_sched_entity_init() argument
155 amd_sched_entity_is_initialized(struct amd_gpu_scheduler *sched, struct amd_sched_entity *entity) amd_sched_entity_is_initialized() argument
204 amd_sched_entity_fini(struct amd_gpu_scheduler *sched, struct amd_sched_entity *entity) amd_sched_entity_fini() argument
H A Dgpu_sched_trace.h18 __field(struct amd_sched_entity *, entity)
27 __entry->entity = sched_job->s_entity;
36 TP_printk("entity=%p, sched job=%p, fence=%p, ring=%s, job count:%u, hw job count:%d",
37 __entry->entity, __entry->sched_job, __entry->fence, __entry->name,
H A Dgpu_scheduler.h39 * A scheduler entity is a wrapper around a job queue or a group
62 * the next entity to emit commands from.
131 struct amd_sched_entity *entity,
135 struct amd_sched_entity *entity);
/linux-4.4.14/drivers/media/
H A Dmedia-entity.c2 * Media entity
26 #include <media/media-entity.h>
30 * media_entity_init - Initialize a media entity
37 * entity driver, while the total number of links depends on hardware design
38 * and is an extrinsic property unknown to the entity driver. However, in most
39 * use cases the entity driver can guess the number of links which can safely
42 * For those reasons the links array can be preallocated based on the entity
50 * The pads array is managed by the entity driver and passed to
51 * media_entity_init() where its pointer will be stored in the entity structure.
54 media_entity_init(struct media_entity *entity, u16 num_pads, media_entity_init() argument
65 entity->group_id = 0; media_entity_init()
66 entity->max_links = max_links; media_entity_init()
67 entity->num_links = 0; media_entity_init()
68 entity->num_backlinks = 0; media_entity_init()
69 entity->num_pads = num_pads; media_entity_init()
70 entity->pads = pads; media_entity_init()
71 entity->links = links; media_entity_init()
74 pads[i].entity = entity; media_entity_init()
83 media_entity_cleanup(struct media_entity *entity) media_entity_cleanup() argument
85 kfree(entity->links); media_entity_cleanup()
94 media_entity_other(struct media_entity *entity, struct media_link *link) media_entity_other() argument
96 if (link->source->entity == entity) media_entity_other()
97 return link->sink->entity; media_entity_other()
99 return link->source->entity; media_entity_other()
102 /* push an entity to traversal stack */ stack_push()
104 struct media_entity *entity) stack_push()
112 graph->stack[graph->top].entity = entity; stack_push()
117 struct media_entity *entity; stack_pop() local
119 entity = graph->stack[graph->top].entity; stack_pop()
122 return entity; stack_pop()
126 #define stack_top(en) ((en)->stack[(en)->top].entity)
129 * media_entity_graph_walk_start - Start walking the media graph at a given entity
131 * @entity: Starting entity
134 * graph starting at the given entity. The traversal structure must not be
139 struct media_entity *entity) media_entity_graph_walk_start()
142 graph->stack[graph->top].entity = NULL; media_entity_graph_walk_start()
145 if (WARN_ON(entity->id >= MEDIA_ENTITY_ENUM_MAX_ID)) media_entity_graph_walk_start()
148 __set_bit(entity->id, graph->entities); media_entity_graph_walk_start()
149 stack_push(graph, entity); media_entity_graph_walk_start()
154 * media_entity_graph_walk_next - Get the next entity in the graph
162 * Return the next entity in the graph or NULL if the whole graph have been
172 * Depth first search. Push entity to stack and continue from media_entity_graph_walk_next()
177 struct media_entity *entity = stack_top(graph); media_entity_graph_walk_next() local
178 struct media_link *link = &entity->links[link_top(graph)]; media_entity_graph_walk_next()
187 /* Get the entity in the other end of the link . */ media_entity_graph_walk_next()
188 next = media_entity_other(entity, link); media_entity_graph_walk_next()
192 /* Has the entity already been visited? */ media_entity_graph_walk_next()
198 /* Push the new entity to stack and start over. */ media_entity_graph_walk_next()
213 * @entity: Starting entity
216 * Mark all entities connected to a given entity through enabled links, either
218 * every entity in the pipeline and stored in the media_entity pipe field.
225 __must_check int media_entity_pipeline_start(struct media_entity *entity, media_entity_pipeline_start() argument
228 struct media_device *mdev = entity->parent; media_entity_pipeline_start()
230 struct media_entity *entity_err = entity; media_entity_pipeline_start()
235 media_entity_graph_walk_start(&graph, entity); media_entity_pipeline_start()
237 while ((entity = media_entity_graph_walk_next(&graph))) { media_entity_pipeline_start()
242 entity->stream_count++; media_entity_pipeline_start()
243 WARN_ON(entity->pipe && entity->pipe != pipe); media_entity_pipeline_start()
244 entity->pipe = pipe; media_entity_pipeline_start()
247 if (entity->stream_count > 1) media_entity_pipeline_start()
250 if (!entity->ops || !entity->ops->link_validate) media_entity_pipeline_start()
253 bitmap_zero(active, entity->num_pads); media_entity_pipeline_start()
254 bitmap_fill(has_no_links, entity->num_pads); media_entity_pipeline_start()
256 for (i = 0; i < entity->num_links; i++) { media_entity_pipeline_start()
257 struct media_link *link = &entity->links[i]; media_entity_pipeline_start()
258 struct media_pad *pad = link->sink->entity == entity media_entity_pipeline_start()
281 ret = entity->ops->link_validate(link); media_entity_pipeline_start()
283 dev_dbg(entity->parent->dev, media_entity_pipeline_start()
285 link->source->entity->name, media_entity_pipeline_start()
287 entity->name, link->sink->index, ret); media_entity_pipeline_start()
293 bitmap_or(active, active, has_no_links, entity->num_pads); media_entity_pipeline_start()
295 if (!bitmap_full(active, entity->num_pads)) { media_entity_pipeline_start()
297 dev_dbg(entity->parent->dev, media_entity_pipeline_start()
299 entity->name, media_entity_pipeline_start()
301 active, entity->num_pads)); media_entity_pipeline_start()
326 if (entity_err == entity) media_entity_pipeline_start()
338 * @entity: Starting entity
340 * Mark all entities connected to a given entity through enabled links, either
348 void media_entity_pipeline_stop(struct media_entity *entity) media_entity_pipeline_stop() argument
350 struct media_device *mdev = entity->parent; media_entity_pipeline_stop()
355 media_entity_graph_walk_start(&graph, entity); media_entity_pipeline_stop()
357 while ((entity = media_entity_graph_walk_next(&graph))) { media_entity_pipeline_stop()
358 entity->stream_count--; media_entity_pipeline_stop()
359 if (entity->stream_count == 0) media_entity_pipeline_stop()
360 entity->pipe = NULL; media_entity_pipeline_stop()
373 * @entity: The entity
377 * The function will return immediately if @entity is NULL.
379 * Return a pointer to the entity on success or NULL on failure.
381 struct media_entity *media_entity_get(struct media_entity *entity) media_entity_get() argument
383 if (entity == NULL) media_entity_get()
386 if (entity->parent->dev && media_entity_get()
387 !try_module_get(entity->parent->dev->driver->owner)) media_entity_get()
390 return entity; media_entity_get()
396 * @entity: The entity
400 * The function will return immediately if @entity is NULL.
402 void media_entity_put(struct media_entity *entity) media_entity_put() argument
404 if (entity == NULL) media_entity_put()
407 if (entity->parent->dev) media_entity_put()
408 module_put(entity->parent->dev->driver->owner); media_entity_put()
416 static struct media_link *media_entity_add_link(struct media_entity *entity) media_entity_add_link() argument
418 if (entity->num_links >= entity->max_links) { media_entity_add_link()
419 struct media_link *links = entity->links; media_entity_add_link()
420 unsigned int max_links = entity->max_links + 2; media_entity_add_link()
427 for (i = 0; i < entity->num_links; i++) media_entity_add_link()
430 entity->max_links = max_links; media_entity_add_link()
431 entity->links = links; media_entity_add_link()
434 return &entity->links[entity->num_links++]; media_entity_add_link()
478 void __media_entity_remove_links(struct media_entity *entity) __media_entity_remove_links() argument
482 for (i = 0; i < entity->num_links; i++) { __media_entity_remove_links()
483 struct media_link *link = &entity->links[i]; __media_entity_remove_links()
487 if (link->source->entity == entity) __media_entity_remove_links()
488 remote = link->sink->entity; __media_entity_remove_links()
490 remote = link->source->entity; __media_entity_remove_links()
500 if (link->source->entity == entity) __media_entity_remove_links()
511 entity->num_links = 0; __media_entity_remove_links()
512 entity->num_backlinks = 0; __media_entity_remove_links()
516 void media_entity_remove_links(struct media_entity *entity) media_entity_remove_links() argument
518 /* Do nothing if the entity is not registered. */ media_entity_remove_links()
519 if (entity->parent == NULL) media_entity_remove_links()
522 mutex_lock(&entity->parent->graph_mutex); media_entity_remove_links()
523 __media_entity_remove_links(entity); media_entity_remove_links()
524 mutex_unlock(&entity->parent->graph_mutex); media_entity_remove_links()
533 ret = media_entity_call(link->source->entity, link_setup, __media_entity_setup_link_notify()
538 ret = media_entity_call(link->sink->entity, link_setup, __media_entity_setup_link_notify()
541 media_entity_call(link->source->entity, link_setup, __media_entity_setup_link_notify()
586 source = link->source->entity; __media_entity_setup_link()
587 sink = link->sink->entity; __media_entity_setup_link()
614 mutex_lock(&link->source->entity->parent->graph_mutex); media_entity_setup_link()
616 mutex_unlock(&link->source->entity->parent->graph_mutex); media_entity_setup_link()
636 for (i = 0; i < source->entity->num_links; ++i) { media_entity_find_link()
637 link = &source->entity->links[i]; media_entity_find_link()
639 if (link->source->entity == source->entity && media_entity_find_link()
641 link->sink->entity == sink->entity && media_entity_find_link()
664 for (i = 0; i < pad->entity->num_links; i++) { media_entity_remote_pad()
665 struct media_link *link = &pad->entity->links[i]; media_entity_remote_pad()
103 stack_push(struct media_entity_graph *graph, struct media_entity *entity) stack_push() argument
138 media_entity_graph_walk_start(struct media_entity_graph *graph, struct media_entity *entity) media_entity_graph_walk_start() argument
H A Dmedia-device.c31 #include <media/media-entity.h>
70 struct media_entity *entity; find_entity() local
77 media_device_for_each_entity(entity, mdev) { media_device_for_each_entity()
78 if ((entity->id == id && !next) || media_device_for_each_entity()
79 (entity->id > id && next)) { media_device_for_each_entity()
81 return entity; media_device_for_each_entity()
123 upad->entity = kpad->entity->id; media_device_kpad_to_upad()
131 struct media_entity *entity; __media_device_enum_links() local
133 entity = find_entity(mdev, links->entity); __media_device_enum_links()
134 if (entity == NULL) __media_device_enum_links()
140 for (p = 0; p < entity->num_pads; p++) { __media_device_enum_links()
144 media_device_kpad_to_upad(&entity->pads[p], &pad); __media_device_enum_links()
154 for (l = 0, ulink = links->links; l < entity->num_links; l++) { __media_device_enum_links()
158 if (entity->links[l].source->entity != entity) __media_device_enum_links()
162 media_device_kpad_to_upad(entity->links[l].source, __media_device_enum_links()
164 media_device_kpad_to_upad(entity->links[l].sink, __media_device_enum_links()
166 link.flags = entity->links[l].flags; __media_device_enum_links()
209 source = find_entity(mdev, ulink.source.entity); media_device_setup_link()
210 sink = find_entity(mdev, ulink.sink.entity); media_device_setup_link()
275 __u32 entity; member in struct:media_links_enum32
289 if (get_user(links.entity, &ulinks->entity) media_device_enum_links32()
410 struct media_entity *entity; media_device_unregister() local
413 list_for_each_entry_safe(entity, next, &mdev->entities, list) media_device_unregister()
414 media_device_unregister_entity(entity); media_device_unregister()
422 * media_device_register_entity - Register an entity with a media device
424 * @entity: The entity
427 struct media_entity *entity) media_device_register_entity()
429 /* Warn if we apparently re-register an entity */ media_device_register_entity()
430 WARN_ON(entity->parent != NULL); media_device_register_entity()
431 entity->parent = mdev; media_device_register_entity()
434 if (entity->id == 0) media_device_register_entity()
435 entity->id = mdev->entity_id++; media_device_register_entity()
437 mdev->entity_id = max(entity->id + 1, mdev->entity_id); media_device_register_entity()
438 list_add_tail(&entity->list, &mdev->entities); media_device_register_entity()
446 * media_device_unregister_entity - Unregister an entity
447 * @entity: The entity
449 * If the entity has never been registered this function will return
452 void media_device_unregister_entity(struct media_entity *entity) media_device_unregister_entity() argument
454 struct media_device *mdev = entity->parent; media_device_unregister_entity()
460 list_del(&entity->list); media_device_unregister_entity()
462 entity->parent = NULL; media_device_unregister_entity()
426 media_device_register_entity(struct media_device *mdev, struct media_entity *entity) media_device_register_entity() argument
H A DMakefile5 media-objs := media-device.o media-devnode.o media-entity.o
/linux-4.4.14/drivers/isdn/hardware/eicon/
H A Dum_idi.h13 int divas_um_idi_delete_entity(int adapter_nr, void *entity);
24 int diva_um_idi_read(void *entity,
29 int diva_um_idi_write(void *entity,
34 int diva_user_mode_idi_ind_ready(void *entity, void *os_handle);
35 void *diva_um_id_get_os_context(void *entity);
37 int divas_um_idi_entity_assigned(void *entity);
38 int divas_um_idi_entity_start_remove(void *entity);
40 void diva_um_idi_start_wdog(void *entity);
41 void diva_um_idi_stop_wdog(void *entity);
H A Ddivasi.c80 static int remove_entity(void *entity);
468 DBG_ERR(("entity removal watchdog")) diva_um_timer_function()
472 ** If application exits without entity removal this function will remove
473 ** entity and block until removal is complete
475 static int remove_entity(void *entity) remove_entity() argument
480 diva_um_idi_stop_wdog(entity); remove_entity()
482 if (!entity) { remove_entity()
483 DBG_FTL(("Zero entity on remove")) remove_entity()
489 diva_um_id_get_os_context(entity))) { remove_entity()
490 DBG_FTL(("Zero entity os context on remove")) remove_entity()
494 if (!divas_um_idi_entity_assigned(entity) || p_os->aborted) { remove_entity()
501 DBG_TRC(("E(%08x) check remove", entity)) remove_entity()
507 diva_um_idi_start_wdog(entity); remove_entity()
515 if (!divas_um_idi_entity_start_remove(entity) remove_entity()
525 DBG_TRC(("E(%08x) start remove", entity)) DBG_TRC()
532 if (!divas_um_idi_entity_assigned(entity) DBG_TRC()
542 DBG_TRC(("E(%08x) remove complete, aborted:%d", entity,
545 diva_um_idi_stop_wdog(entity);
555 void diva_um_idi_start_wdog(void *entity) diva_um_idi_start_wdog() argument
559 if (entity && diva_um_idi_start_wdog()
562 diva_um_id_get_os_context(entity)))) { diva_um_idi_start_wdog()
567 void diva_um_idi_stop_wdog(void *entity) diva_um_idi_stop_wdog() argument
571 if (entity && diva_um_idi_stop_wdog()
574 diva_um_id_get_os_context(entity)))) { diva_um_idi_stop_wdog()
H A Dentity.h1 /* $Id: entity.h,v 1.4 2004/03/21 17:26:01 armin Exp $ */
H A Dum_idi.c8 #include "entity.h"
187 Cleanup, but NOT delete this entity
206 Create ENTITY, link it to the adapter and remove pointer to entity
270 Unlink entity and free memory
272 int divas_um_idi_delete_entity(int adapter_nr, void *entity) divas_um_idi_delete_entity() argument
278 if (!(e = (divas_um_idi_entity_t *) entity)) divas_um_idi_delete_entity()
287 diva_um_idi_stop_wdog(entity); divas_um_idi_delete_entity()
301 int diva_um_idi_read(void *entity, diva_um_idi_read() argument
315 e = (divas_um_idi_entity_t *) entity; diva_um_idi_read()
381 int diva_um_idi_write(void *entity, diva_um_idi_write() argument
395 e = (divas_um_idi_entity_t *) entity; diva_um_idi_write()
491 static void diva_um_idi_xdi_callback(ENTITY *entity) diva_um_idi_xdi_callback() argument
493 divas_um_idi_entity_t *e = DIVAS_CONTAINING_RECORD(entity, diva_um_idi_xdi_callback()
731 Write return code to the return code queue of entity
756 Return amount of entries that can be bead from this entity or
759 int diva_user_mode_idi_ind_ready(void *entity, void *os_handle) diva_user_mode_idi_ind_ready() argument
766 if (!entity) diva_user_mode_idi_ind_ready()
769 e = (divas_um_idi_entity_t *) entity; diva_user_mode_idi_ind_ready()
781 entity was removed as result of adapter removal diva_user_mode_idi_ind_ready()
782 user should assign this entity again diva_user_mode_idi_ind_ready()
799 void *diva_um_id_get_os_context(void *entity) diva_um_id_get_os_context() argument
801 return (((divas_um_idi_entity_t *) entity)->os_context); diva_um_id_get_os_context()
804 int divas_um_idi_entity_assigned(void *entity) divas_um_idi_entity_assigned() argument
814 e = (divas_um_idi_entity_t *) entity; divas_um_idi_entity_assigned()
835 int divas_um_idi_entity_start_remove(void *entity) divas_um_idi_entity_start_remove() argument
843 e = (divas_um_idi_entity_t *) entity; divas_um_idi_entity_start_remove()
H A Ddi.c112 DBG_FTL(("XDI: [%02x] !A%d ==> NULL entity ptr - try to ignore", pr_out()
193 /* if we did chaining, this entity is put back into the */ pr_out()
640 /* map entity ptr, selector could be re-mapped by call to */ isdn_ind()
737 Id - Id of the entity that had sent this return code
738 Ch - Channel of the entity that had sent this return code
752 type - the Id that was sent by the ASSIGN of this entity.
773 Id - Id of the entity that had sent this request
774 Ch - Channel of the entity that had sent this request
776 type - the Id that was sent by the ASSIGN of this entity.
796 Id - Id of the entity that had sent this indication
797 Ch - Channel of the entity that had sent this indication
815 type: the Id that was sent by the ASSIGN of this entity. This should
H A Ddi_defs.h78 byte Id; /* ID used by this entity */
91 byte No; /* entity number */
H A Dio.c208 * if the Req field in the entity structure is 0, request()
378 * assign an entity request()
404 * if the entity is still busy, ignore the request call request()
430 * queue this entity in the adapter request queue request()
H A Dpc.h41 byte ReqId; /* request task/entity identification */
43 byte RcId; /* return code task/entity identification */
45 byte IndId; /* Indication task/entity identification */
256 #define WRONG_ID 0x03 /* unknown task/entity id */
257 #define WRONG_CH 0x04 /* wrong task/entity id */
H A Ddivasync.h393 ENTITY *contxt; /* ptr to entity to use */
419 ENTITY *contxt; /* ptr to entity to use */
H A Dos_bri.c221 Create entity table diva_bri_init_card()
/linux-4.4.14/include/media/
H A Dmedia-entity.h2 * Media entity
42 struct media_entity *entity; /* Entity this pad belongs to */ member in struct:media_pad
43 u16 index; /* Pad index in the entity pads array */
48 * struct media_entity_operations - Media entity operations
49 * @link_setup: Notify the entity of link changes. The operation can
52 * @link_validate: Return whether a link is valid from the entity point of
57 int (*link_setup)(struct media_entity *entity,
65 struct media_device *parent; /* Media device this entity belongs to*/
89 int stream_count; /* Stream count for the entity. */
90 int use_count; /* Use count for the entity. */
92 struct media_pipeline *pipe; /* Pipeline this entity belongs to. */
106 static inline u32 media_entity_type(struct media_entity *entity) media_entity_type() argument
108 return entity->type & MEDIA_ENT_TYPE_MASK; media_entity_type()
111 static inline u32 media_entity_subtype(struct media_entity *entity) media_entity_subtype() argument
113 return entity->type & MEDIA_ENT_SUBTYPE_MASK; media_entity_subtype()
121 * as the worse-case scenario is to have one entity linked up to
128 struct media_entity *entity; member in struct:media_entity_graph::__anon13323
136 int media_entity_init(struct media_entity *entity, u16 num_pads,
138 void media_entity_cleanup(struct media_entity *entity);
142 void __media_entity_remove_links(struct media_entity *entity);
143 void media_entity_remove_links(struct media_entity *entity);
151 struct media_entity *media_entity_get(struct media_entity *entity);
152 void media_entity_put(struct media_entity *entity);
155 struct media_entity *entity);
158 __must_check int media_entity_pipeline_start(struct media_entity *entity,
160 void media_entity_pipeline_stop(struct media_entity *entity);
162 #define media_entity_call(entity, operation, args...) \
163 (((entity)->ops && (entity)->ops->operation) ? \
164 (entity)->ops->operation((entity) , ##args) : -ENOIOCTLCMD)
H A Dmedia-device.h31 #include <media/media-entity.h>
44 * @entity_id: ID of the next entity to be registered
96 struct media_entity *entity);
97 void media_device_unregister_entity(struct media_entity *entity);
100 #define media_device_for_each_entity(entity, mdev) \
101 list_for_each_entry(entity, &(mdev)->entities, list)
H A Dexynos-fimc.h15 #include <media/media-entity.h>
129 * last entity within the pipeline. Implemented by related media device driver.
H A Dv4l2-dev.h19 #include <media/media-entity.h>
88 struct media_entity entity; member in struct:video_device
145 container_of(__e, struct video_device, entity)
H A Dv4l2-flash-led-class.h50 * @dev_name: the name of the media entity,
H A Dv4l2-subdev.h26 #include <media/media-entity.h>
704 struct media_entity entity; member in struct:v4l2_subdev
740 container_of(ent, struct v4l2_subdev, entity)
764 BUG_ON(pad >= sd->entity.num_pads); \
/linux-4.4.14/drivers/media/platform/xilinx/
H A Dxilinx-vipp.c36 * @node: the entity's DT node
37 * @entity: media entity, from the corresponding V4L2 subdev
44 struct media_entity *entity; member in struct:xvip_graph_entity
58 struct xvip_graph_entity *entity; xvip_graph_find_entity() local
60 list_for_each_entry(entity, &xdev->entities, list) { xvip_graph_find_entity()
61 if (entity->node == node) xvip_graph_find_entity()
62 return entity; xvip_graph_find_entity()
69 struct xvip_graph_entity *entity) xvip_graph_build_one()
72 struct media_entity *local = entity->entity; xvip_graph_build_one()
82 dev_dbg(xdev->dev, "creating links for entity %s\n", local->name); xvip_graph_build_one()
86 next = of_graph_get_next_endpoint(entity->node, ep); xvip_graph_build_one()
130 /* Find the remote entity. */ xvip_graph_build_one()
133 dev_err(xdev->dev, "no entity found for %s\n", xvip_graph_build_one()
140 remote = ent->entity; xvip_graph_build_one()
236 /* Find the remote entity. */ xvip_graph_build_dma()
239 dev_err(xdev->dev, "no entity found for %s\n", xvip_graph_build_dma()
246 if (link.remote_port >= ent->entity->num_pads) { xvip_graph_build_dma()
255 source = &dma->video.entity; xvip_graph_build_dma()
257 sink = ent->entity; xvip_graph_build_dma()
260 source = ent->entity; xvip_graph_build_dma()
262 sink = &dma->video.entity; xvip_graph_build_dma()
293 struct xvip_graph_entity *entity; xvip_graph_notify_complete() local
298 /* Create links for every entity. */ xvip_graph_notify_complete()
299 list_for_each_entry(entity, &xdev->entities, list) { xvip_graph_notify_complete()
300 ret = xvip_graph_build_one(xdev, entity); xvip_graph_notify_complete()
323 struct xvip_graph_entity *entity; xvip_graph_notify_bound() local
325 /* Locate the entity corresponding to the bound subdev and store the xvip_graph_notify_bound()
328 list_for_each_entry(entity, &xdev->entities, list) { xvip_graph_notify_bound()
329 if (entity->node != subdev->dev->of_node) xvip_graph_notify_bound()
332 if (entity->subdev) { xvip_graph_notify_bound()
334 entity->node->full_name); xvip_graph_notify_bound()
339 entity->entity = &subdev->entity; xvip_graph_notify_bound()
340 entity->subdev = subdev; xvip_graph_notify_bound()
344 dev_err(xdev->dev, "no entity for subdev %s\n", subdev->name); xvip_graph_notify_bound()
351 struct xvip_graph_entity *entity; xvip_graph_parse_one() local
382 entity = devm_kzalloc(xdev->dev, sizeof(*entity), GFP_KERNEL); xvip_graph_parse_one()
383 if (entity == NULL) { xvip_graph_parse_one()
389 entity->node = remote; xvip_graph_parse_one()
390 entity->asd.match_type = V4L2_ASYNC_MATCH_OF; xvip_graph_parse_one()
391 entity->asd.match.of.node = remote; xvip_graph_parse_one()
392 list_add_tail(&entity->list, &xdev->entities); xvip_graph_parse_one()
402 struct xvip_graph_entity *entity; xvip_graph_parse() local
415 list_for_each_entry(entity, &xdev->entities, list) { xvip_graph_parse()
416 ret = xvip_graph_parse_one(xdev, entity->node); xvip_graph_parse()
489 struct xvip_graph_entity *entity; xvip_graph_cleanup() local
495 list_for_each_entry_safe(entity, entityp, &xdev->entities, list) { xvip_graph_cleanup()
496 of_node_put(entity->node); xvip_graph_cleanup()
497 list_del(&entity->list); xvip_graph_cleanup()
508 struct xvip_graph_entity *entity; xvip_graph_init() local
543 list_for_each_entry(entity, &xdev->entities, list) xvip_graph_init()
544 subdevs[i++] = &entity->asd; xvip_graph_init()
68 xvip_graph_build_one(struct xvip_composite_device *xdev, struct xvip_graph_entity *entity) xvip_graph_build_one() argument
H A Dxilinx-dma.c53 media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV) xvip_dma_remote_subdev()
59 return media_entity_to_v4l2_subdev(remote->entity); xvip_dma_remote_subdev()
104 struct media_entity *entity; xvip_pipeline_start_stop() local
109 entity = &dma->video.entity; xvip_pipeline_start_stop()
111 pad = &entity->pads[0]; xvip_pipeline_start_stop()
117 media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) xvip_pipeline_start_stop()
120 entity = pad->entity; xvip_pipeline_start_stop()
121 subdev = media_entity_to_v4l2_subdev(entity); xvip_pipeline_start_stop()
183 struct media_entity *entity = &start->video.entity; xvip_pipeline_validate() local
184 struct media_device *mdev = entity->parent; xvip_pipeline_validate()
191 media_entity_graph_walk_start(&graph, entity); xvip_pipeline_validate()
193 while ((entity = media_entity_graph_walk_next(&graph))) { xvip_pipeline_validate()
196 if (entity->type != MEDIA_ENT_T_DEVNODE_V4L) xvip_pipeline_validate()
199 dma = to_xvip_dma(media_entity_to_video_device(entity)); xvip_pipeline_validate()
399 * Start streaming on the pipeline. No link touching an entity in the xvip_dma_start_streaming()
405 pipe = dma->video.entity.pipe xvip_dma_start_streaming()
406 ? to_xvip_pipeline(&dma->video.entity) : &dma->pipe; xvip_dma_start_streaming()
408 ret = media_entity_pipeline_start(&dma->video.entity, &pipe->pipe); xvip_dma_start_streaming()
434 media_entity_pipeline_stop(&dma->video.entity); xvip_dma_start_streaming()
451 struct xvip_pipeline *pipe = to_xvip_pipeline(&dma->video.entity); xvip_dma_stop_streaming()
462 media_entity_pipeline_stop(&dma->video.entity); xvip_dma_stop_streaming()
678 /* Initialize the media entity... */ xvip_dma_init()
682 ret = media_entity_init(&dma->video.entity, 1, &dma->pad, 0); xvip_dma_init()
767 media_entity_cleanup(&dma->video.entity); xvip_dma_cleanup()
H A Dxilinx-dma.h23 #include <media/media-entity.h>
60 * @pad: media pad for the video device entity
H A Dxilinx-tpg.c805 /* Initialize V4L2 subdevice and media entity. Pad numbers depend on the xtpg_probe()
829 /* Initialize V4L2 subdevice and media entity */ xtpg_probe()
837 subdev->entity.ops = &xtpg_media_ops; xtpg_probe()
839 ret = media_entity_init(&subdev->entity, xtpg->npads, xtpg->pads, 0); xtpg_probe()
888 media_entity_cleanup(&subdev->entity); xtpg_probe()
902 media_entity_cleanup(&subdev->entity); xtpg_remove()
/linux-4.4.14/drivers/media/platform/exynos4-is/
H A Dcommon.c16 /* Called with the media graph mutex held or entity->stream_count > 0. */ fimc_find_remote_sensor()
17 struct v4l2_subdev *fimc_find_remote_sensor(struct media_entity *entity) fimc_find_remote_sensor() argument
19 struct media_pad *pad = &entity->pads[0]; fimc_find_remote_sensor()
26 media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) fimc_find_remote_sensor()
29 sd = media_entity_to_v4l2_subdev(pad->entity); fimc_find_remote_sensor()
35 pad = &sd->entity.pads[0]; fimc_find_remote_sensor()
H A Dmedia-dev.c63 * @me: media entity terminating the pipeline
92 media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) fimc_pipeline_prepare()
94 sd = media_entity_to_v4l2_subdev(pad->entity); fimc_pipeline_prepare()
118 me = &sd->entity; fimc_pipeline_prepare()
143 use_count = &sd->entity.use_count; __subdev_set_power()
192 * @me: media entity to start graph walk with
252 fmd = entity_to_fimc_mdev(&sd->entity); __fimc_pipeline_close()
639 /* If driver of any entity isn't ready try all again later. */ for_each_available_child_of_node()
697 * @source: the source entity to create links to all fimc entities from
698 * @sensor: sensor subdev linked to FIMC[fimc_id] entity, may be null
699 * @pad: the source entity pad index
731 sink = &fmd->fimc[i]->vid_cap.subdev.entity; __fimc_md_create_fimc_sink_links()
737 /* Notify FIMC capture subdev entity */ __fimc_md_create_fimc_sink_links()
751 sink = &fmd->fimc_lite[i]->subdev.entity; __fimc_md_create_fimc_sink_links()
757 /* Notify FIMC-LITE subdev entity */ __fimc_md_create_fimc_sink_links()
781 source = &fimc->subdev.entity; __fimc_md_create_flite_source_links()
782 sink = &fimc->ve.vdev.entity; __fimc_md_create_flite_source_links()
789 sink = &fmd->fimc_is->isp.subdev.entity; __fimc_md_create_flite_source_links()
806 source = &isp->subdev.entity; __fimc_md_create_fimc_is_links()
813 sink = &fmd->fimc[i]->vid_cap.subdev.entity; __fimc_md_create_fimc_is_links()
821 sink = &isp->video_capture.ve.vdev.entity; __fimc_md_create_fimc_is_links()
836 * link with CSI receiver entity specified by mux_id. Any registered CSIS
837 * entity has a link to each registered FIMC capture entity. Enabled links
839 * subsequent FIMC capture entity. The number of default active links is
875 pad = sensor->entity.num_pads - 1; fimc_md_create_links()
876 ret = media_entity_create_link(&sensor->entity, pad, fimc_md_create_links()
877 &csis->entity, CSIS_PAD_SINK, fimc_md_create_links()
884 sensor->entity.name, csis->entity.name); fimc_md_create_links()
891 source = &sensor->entity; fimc_md_create_links()
912 source = &fmd->csis[i].sd->entity; fimc_md_create_links()
927 source = &fmd->fimc[i]->vid_cap.subdev.entity; fimc_md_create_links()
928 sink = &fmd->fimc[i]->vid_cap.ve.vdev.entity; fimc_md_create_links()
1018 static int __fimc_md_modify_pipeline(struct media_entity *entity, bool enable) __fimc_md_modify_pipeline() argument
1025 vdev = media_entity_to_video_device(entity); __fimc_md_modify_pipeline()
1026 if (vdev->entity.use_count == 0) __fimc_md_modify_pipeline()
1039 ret = __fimc_pipeline_open(ve->pipe, entity, true); __fimc_md_modify_pipeline()
1049 /* Locking: called with entity->parent->graph_mutex mutex held. */ __fimc_md_modify_pipelines()
1050 static int __fimc_md_modify_pipelines(struct media_entity *entity, bool enable) __fimc_md_modify_pipelines() argument
1052 struct media_entity *entity_err = entity; __fimc_md_modify_pipelines()
1062 media_entity_graph_walk_start(&graph, entity); __fimc_md_modify_pipelines()
1064 while ((entity = media_entity_graph_walk_next(&graph))) { __fimc_md_modify_pipelines()
1065 if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE) __fimc_md_modify_pipelines()
1068 ret = __fimc_md_modify_pipeline(entity, enable); __fimc_md_modify_pipelines()
1084 if (entity_err == entity) __fimc_md_modify_pipelines()
1094 struct media_entity *sink = link->sink->entity; fimc_md_link_notify()
H A Dfimc-isp-video.c278 struct media_entity *me = &ve->vdev.entity; isp_video_open()
316 struct media_entity *entity = &ivc->ve.vdev.entity; isp_video_release() local
317 struct media_device *mdev = entity->parent; isp_video_release()
322 media_entity_pipeline_stop(entity); isp_video_release()
332 entity->use_count--; isp_video_release()
461 pad = &sd->entity.pads[0]; isp_video_pipeline_validate()
473 media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) isp_video_pipeline_validate()
476 sd = media_entity_to_v4l2_subdev(pad->entity); isp_video_pipeline_validate()
497 struct media_entity *me = &ve->vdev.entity; isp_video_streamon()
530 media_entity_pipeline_stop(&video->ve.vdev.entity); isp_video_streamoff()
623 ret = media_entity_init(&vdev->entity, 1, &iv->pad, 0); fimc_isp_video_device_register()
631 media_entity_cleanup(&vdev->entity); fimc_isp_video_device_register()
655 media_entity_cleanup(&ve->vdev.entity); fimc_isp_video_device_unregister()
H A Dmedia-dev.h19 #include <media/media-entity.h>
57 * source entity (e.g. an image sensor subdevice), a data capture entity
178 mutex_lock(&ve->vdev.entity.parent->graph_mutex); fimc_md_graph_lock()
183 mutex_unlock(&ve->vdev.entity.parent->graph_mutex); fimc_md_graph_unlock()
H A Dfimc-capture.c326 fimc_pipeline_call(ve, open, &ve->vdev.entity, false); fimc_capture_resume()
500 ret = fimc_pipeline_call(ve, open, &ve->vdev.entity, true); fimc_capture_open()
514 ve->vdev.entity.use_count++; fimc_capture_open()
544 media_entity_pipeline_stop(&vc->ve.vdev.entity); fimc_capture_release()
556 vc->ve.vdev.entity.use_count--; fimc_capture_release()
761 me = pad->entity; fimc_pipeline_get_head()
799 me = fimc_pipeline_get_head(&sd->entity); fimc_pipeline_try_format()
814 while (me != &fimc->vid_cap.subdev.entity) { fimc_pipeline_try_format()
834 me = pad->entity; fimc_pipeline_try_format()
881 pad = sensor->entity.num_pads - 1; fimc_get_sensor_frame_desc()
1123 * Find current entity sink pad and any remote sink pad linked fimc_pipeline_validate()
1124 * to it. We stop if there is no sink pad in current entity or fimc_pipeline_validate()
1125 * it is not linked to any other remote entity. fimc_pipeline_validate()
1129 for (i = 0; i < sd->entity.num_pads; i++) { fimc_pipeline_validate()
1130 struct media_pad *p = &sd->entity.pads[i]; fimc_pipeline_validate()
1141 media_entity_type(src_pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) fimc_pipeline_validate()
1159 sd = media_entity_to_v4l2_subdev(src_pad->entity); fimc_pipeline_validate()
1196 struct media_entity *entity = &vc->ve.vdev.entity; fimc_cap_streamon() local
1204 ret = media_entity_pipeline_start(entity, &vc->ve.pipe->mp); fimc_cap_streamon()
1238 media_entity_pipeline_stop(entity); fimc_cap_streamon()
1253 media_entity_pipeline_stop(&vc->ve.vdev.entity); fimc_cap_streamoff()
1386 /* Capture subdev media entity operations */ fimc_link_setup()
1387 static int fimc_link_setup(struct media_entity *entity, fimc_link_setup() argument
1391 struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity); fimc_link_setup()
1396 if (media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV) fimc_link_setup()
1403 local->entity->name, remote->entity->name, flags, fimc_link_setup()
1420 sensor = fimc_find_remote_sensor(&vc->subdev.entity); fimc_link_setup()
1458 fmd = entity_to_fimc_mdev(&sd->entity); fimc_sensor_notify()
1804 ret = media_entity_init(&vfd->entity, 1, &vid_cap->vd_pad, 0); fimc_register_capture_device()
1825 media_entity_cleanup(&vfd->entity); fimc_register_capture_device()
1869 media_entity_cleanup(&vdev->entity); fimc_capture_subdev_unregistered()
1896 ret = media_entity_init(&sd->entity, FIMC_SD_PADS_NUM, fimc_initialize_capture_subdev()
1901 sd->entity.ops = &fimc_sd_media_ops; fimc_initialize_capture_subdev()
1912 media_entity_cleanup(&sd->entity); fimc_unregister_capture_subdev()
H A Dfimc-lite.c478 struct media_entity *me = &fimc->ve.vdev.entity; fimc_lite_open()
527 struct media_entity *entity = &fimc->ve.vdev.entity; fimc_lite_release() local
534 media_entity_pipeline_stop(entity); fimc_lite_release()
541 mutex_lock(&entity->parent->graph_mutex); fimc_lite_release()
542 entity->use_count--; fimc_lite_release()
543 mutex_unlock(&entity->parent->graph_mutex); fimc_lite_release()
795 pad = &sd->entity.pads[0]; fimc_pipeline_validate()
815 media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) fimc_pipeline_validate()
818 sd = media_entity_to_v4l2_subdev(pad->entity); fimc_pipeline_validate()
837 struct media_entity *entity = &fimc->ve.vdev.entity; fimc_lite_streamon() local
843 ret = media_entity_pipeline_start(entity, &fimc->ve.pipe->mp); fimc_lite_streamon()
851 fimc->sensor = fimc_find_remote_sensor(&fimc->subdev.entity); fimc_lite_streamon()
860 media_entity_pipeline_stop(entity); fimc_lite_streamon()
874 media_entity_pipeline_stop(&fimc->ve.vdev.entity); fimc_lite_streamoff()
981 /* Capture subdev media entity operations */ fimc_lite_link_setup()
982 static int fimc_lite_link_setup(struct media_entity *entity, fimc_lite_link_setup() argument
986 struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity); fimc_lite_link_setup()
988 unsigned int remote_ent_type = media_entity_type(remote->entity); fimc_lite_link_setup()
995 __func__, remote->entity->name, local->entity->name, fimc_lite_link_setup()
1116 sd->entity.stream_count > 0) || fimc_lite_subdev_set_fmt()
1239 * The pipeline links are protected through entity.stream_count fimc_lite_subdev_s_stream()
1242 fimc->sensor = fimc_find_remote_sensor(&sd->entity); fimc_lite_subdev_s_stream()
1322 ret = media_entity_init(&vfd->entity, 1, &fimc->vd_pad, 0); fimc_lite_subdev_registered()
1331 media_entity_cleanup(&vfd->entity); fimc_lite_subdev_registered()
1352 media_entity_cleanup(&fimc->ve.vdev.entity); fimc_lite_subdev_unregistered()
1436 ret = media_entity_init(&sd->entity, FLITE_SD_PADS_NUM, fimc_lite_create_capture_subdev()
1445 media_entity_cleanup(&sd->entity); fimc_lite_create_capture_subdev()
1451 sd->entity.ops = &fimc_lite_subdev_media_ops; fimc_lite_create_capture_subdev()
1463 media_entity_cleanup(&sd->entity); fimc_lite_unregister_capture_subdev()
1629 &fimc->ve.vdev.entity, false); fimc_lite_resume()
H A Dfimc-isp.c102 /* Capture subdev media entity operations */ fimc_is_link_setup()
103 static int fimc_is_link_setup(struct media_entity *entity, fimc_is_link_setup() argument
232 if (sd->entity.stream_count == 0) { fimc_isp_subdev_set_fmt()
711 ret = media_entity_init(&sd->entity, FIMC_ISP_SD_PADS_NUM, fimc_isp_subdev_create()
761 media_entity_cleanup(&sd->entity); fimc_isp_subdev_create()
770 sd->entity.ops = &fimc_is_subdev_media_ops; fimc_isp_subdev_create()
783 media_entity_cleanup(&sd->entity); fimc_isp_subdev_destroy()
H A Dfimc-lite.h21 #include <media/media-entity.h>
113 * @ve: exynos video device entity structure
H A Dfimc-isp.h23 #include <media/media-entity.h>
H A Dfimc-core.h24 #include <media/media-entity.h>
289 * @ve: exynos video device entity structure
405 * struct fimc_dev - abstraction for FIMC entity
H A Dfimc-m2m.c742 ret = media_entity_init(&vfd->entity, 0, NULL, 0); fimc_register_m2m_device()
755 media_entity_cleanup(&vfd->entity); fimc_register_m2m_device()
771 media_entity_cleanup(&fimc->m2m.vfd.entity); fimc_unregister_m2m_device()
H A Dmipi-csis.c869 ret = media_entity_init(&state->sd.entity, s5pcsis_probe()
894 media_entity_cleanup(&state->sd.entity); s5pcsis_probe()
1005 media_entity_cleanup(&state->sd.entity); s5pcsis_remove()
/linux-4.4.14/include/video/
H A Domap-panel-data.h37 * @name: name for this display entity
50 * @name: name for this display entity
66 * @name: name for this display entity
67 * @source: name of the display entity used as a video source
78 * @name: name for this display entity
79 * @source: name of the display entity used as a video source
88 * @name: name for this display entity
89 * @source: name of the display entity used as a video source
103 * @name: name for this display entity
104 * @source: name of the display entity used as a video source
124 * @name: name for this display entity
125 * @source: name of the display entity used as a video source
151 * @name: name for this display entity
152 * @source: name of the display entity used as a video source
167 * @name: name for this display entity
168 * @source: name of the display entity used as a video source
185 * @name: name for this display entity
186 * @source: name of the display entity used as a video source
209 * @name: name for this display entity
210 * @source: name of the display entity used as a video source
225 * @name: name for this display entity
226 * @source: name of the display entity used as a video source
243 * @name: name for display entity
244 * @source: name of the display entity used as a video source
/linux-4.4.14/drivers/staging/media/omap4iss/
H A Diss.c145 ret = v4l2_subdev_call(media_entity_to_v4l2_subdev(link->sink->entity), omap4iss_get_external_info()
371 * To achieve this use the entity use_count field to track the number of users.
388 * @entity: The entity
392 static int iss_pipeline_pm_use_count(struct media_entity *entity) iss_pipeline_pm_use_count() argument
397 media_entity_graph_walk_start(&graph, entity); iss_pipeline_pm_use_count()
399 while ((entity = media_entity_graph_walk_next(&graph))) { iss_pipeline_pm_use_count()
400 if (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE) iss_pipeline_pm_use_count()
401 use += entity->use_count; iss_pipeline_pm_use_count()
408 * iss_pipeline_pm_power_one - Apply power change to an entity
409 * @entity: The entity
412 * Change the entity use count by @change. If the entity is a subdev update its
418 static int iss_pipeline_pm_power_one(struct media_entity *entity, int change) iss_pipeline_pm_power_one() argument
422 subdev = media_entity_type(entity) == MEDIA_ENT_T_V4L2_SUBDEV iss_pipeline_pm_power_one()
423 ? media_entity_to_v4l2_subdev(entity) : NULL; iss_pipeline_pm_power_one()
425 if (entity->use_count == 0 && change > 0 && subdev) { iss_pipeline_pm_power_one()
433 entity->use_count += change; iss_pipeline_pm_power_one()
434 WARN_ON(entity->use_count < 0); iss_pipeline_pm_power_one()
436 if (entity->use_count == 0 && change < 0 && subdev) iss_pipeline_pm_power_one()
444 * @entity: The entity
452 static int iss_pipeline_pm_power(struct media_entity *entity, int change) iss_pipeline_pm_power() argument
455 struct media_entity *first = entity; iss_pipeline_pm_power()
461 media_entity_graph_walk_start(&graph, entity); iss_pipeline_pm_power()
463 while (!ret && (entity = media_entity_graph_walk_next(&graph))) iss_pipeline_pm_power()
464 if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE) iss_pipeline_pm_power()
465 ret = iss_pipeline_pm_power_one(entity, change); iss_pipeline_pm_power()
473 first != entity) iss_pipeline_pm_power()
481 * omap4iss_pipeline_pm_use - Update the use count of an entity
482 * @entity: The entity
483 * @use: Use (1) or stop using (0) the entity
492 int omap4iss_pipeline_pm_use(struct media_entity *entity, int use) omap4iss_pipeline_pm_use() argument
497 mutex_lock(&entity->parent->graph_mutex); omap4iss_pipeline_pm_use()
500 entity->use_count += change; omap4iss_pipeline_pm_use()
501 WARN_ON(entity->use_count < 0); omap4iss_pipeline_pm_use()
504 ret = iss_pipeline_pm_power(entity, change); omap4iss_pipeline_pm_use()
506 entity->use_count -= change; omap4iss_pipeline_pm_use()
508 mutex_unlock(&entity->parent->graph_mutex); omap4iss_pipeline_pm_use()
529 struct media_entity *source = link->source->entity; iss_pipeline_link_notify()
530 struct media_entity *sink = link->sink->entity; iss_pipeline_link_notify()
566 * @until: entity at which to stop pipeline walk
573 * until entity. This is used to disable a partially started pipeline due to a
580 struct media_entity *entity; iss_pipeline_disable() local
586 entity = &pipe->output->video.entity; iss_pipeline_disable()
588 pad = &entity->pads[0]; iss_pipeline_disable()
594 media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) iss_pipeline_disable()
597 entity = pad->entity; iss_pipeline_disable()
598 if (entity == until) iss_pipeline_disable()
601 subdev = media_entity_to_v4l2_subdev(entity); iss_pipeline_disable()
606 /* If the entity failed to stopped, assume it has iss_pipeline_disable()
610 iss->crashed |= 1U << subdev->entity.id; iss_pipeline_disable()
633 struct media_entity *entity; iss_pipeline_enable() local
654 entity = &pipe->output->video.entity; iss_pipeline_enable()
656 pad = &entity->pads[0]; iss_pipeline_enable()
662 media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) iss_pipeline_enable()
665 entity = pad->entity; iss_pipeline_enable()
666 subdev = media_entity_to_v4l2_subdev(entity); iss_pipeline_enable()
670 iss_pipeline_disable(pipe, entity); iss_pipeline_enable()
729 * iss_pipeline_is_last - Verify if entity has an enabled link to the output
731 * @me: ISS module's media entity
733 * Returns 1 if the entity has an enabled link to the output video node or 0
748 return pad->entity == me; iss_pipeline_is_last()
806 * @me: ISS submodule's media entity
1090 /* Reset the ISS if an entity has failed to stop. This is the omap4iss_put()
1135 * Return a pointer to the sensor media entity if it has been successfully
1242 input = &iss->csi2a.subdev.entity; iss_register_entities()
1249 input = &iss->csi2b.subdev.entity; iss_register_entities()
1262 ret = media_entity_create_link(&sensor->entity, 0, input, pad, iss_register_entities()
1321 &iss->csi2a.subdev.entity, CSI2_PAD_SOURCE, iss_initialize_modules()
1322 &iss->ipipeif.subdev.entity, IPIPEIF_PAD_SINK, 0); iss_initialize_modules()
1327 &iss->csi2b.subdev.entity, CSI2_PAD_SOURCE, iss_initialize_modules()
1328 &iss->ipipeif.subdev.entity, IPIPEIF_PAD_SINK, 0); iss_initialize_modules()
1333 &iss->ipipeif.subdev.entity, IPIPEIF_PAD_SOURCE_VP, iss_initialize_modules()
1334 &iss->resizer.subdev.entity, RESIZER_PAD_SINK, 0); iss_initialize_modules()
1339 &iss->ipipeif.subdev.entity, IPIPEIF_PAD_SOURCE_VP, iss_initialize_modules()
1340 &iss->ipipe.subdev.entity, IPIPE_PAD_SINK, 0); iss_initialize_modules()
1345 &iss->ipipe.subdev.entity, IPIPE_PAD_SOURCE_VP, iss_initialize_modules()
1346 &iss->resizer.subdev.entity, RESIZER_PAD_SINK, 0); iss_initialize_modules()
H A Diss_video.c194 media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV) iss_video_remote_subdev()
200 return media_entity_to_v4l2_subdev(remote->entity); iss_video_remote_subdev()
208 struct media_entity *entity = &video->video.entity; iss_video_far_end() local
209 struct media_device *mdev = entity->parent; iss_video_far_end()
213 media_entity_graph_walk_start(&graph, entity); iss_video_far_end()
215 while ((entity = media_entity_graph_walk_next(&graph))) { iss_video_far_end()
216 if (entity == &video->video.entity) iss_video_far_end()
219 if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE) iss_video_far_end()
222 far_end = to_iss_video(media_entity_to_video_device(entity)); iss_video_far_end()
350 struct iss_pipeline *pipe = to_iss_pipeline(&video->video.entity); iss_video_buf_queue()
421 struct iss_pipeline *pipe = to_iss_pipeline(&video->video.entity); omap4iss_video_buffer_next()
754 struct media_entity *entity; iss_video_streamon() local
766 /* Start streaming on the pipeline. No link touching an entity in the iss_video_streamon()
769 pipe = video->video.entity.pipe iss_video_streamon()
770 ? to_iss_pipeline(&video->video.entity) : &video->pipe; iss_video_streamon()
779 ret = media_entity_pipeline_start(&video->video.entity, &pipe->pipe); iss_video_streamon()
783 entity = &video->video.entity; iss_video_streamon()
784 media_entity_graph_walk_start(&graph, entity); iss_video_streamon()
785 while ((entity = media_entity_graph_walk_next(&graph))) iss_video_streamon()
786 pipe->entities |= 1 << entity->id; iss_video_streamon()
862 media_entity_pipeline_stop(&video->video.entity); iss_video_streamon()
877 struct iss_pipeline *pipe = to_iss_pipeline(&video->video.entity); iss_video_streamoff()
908 media_entity_pipeline_stop(&video->video.entity); iss_video_streamoff()
988 ret = omap4iss_pipeline_pm_use(&video->video.entity, 1); iss_video_open()
1042 omap4iss_pipeline_pm_use(&video->video.entity, 0); iss_video_release()
1106 ret = media_entity_init(&video->video.entity, 1, &video->pad, 0); omap4iss_video_init()
1136 media_entity_cleanup(&video->video.entity); omap4iss_video_cleanup()
H A Diss_ipipe.c167 if (omap4iss_module_sync_idle(&sd->entity, &ipipe->wait, ipipe_set_stream()
430 * Media entity operations
435 * @entity: IPIPE media entity
442 static int ipipe_link_setup(struct media_entity *entity, ipipe_link_setup() argument
446 struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity); ipipe_link_setup()
450 switch (local->index | media_entity_type(remote->entity)) { ipipe_link_setup()
461 if (remote->entity == &iss->ipipeif.subdev.entity) ipipe_link_setup()
491 * ipipe_init_entities - Initialize V4L2 subdev and media entity
500 struct media_entity *me = &sd->entity; ipipe_init_entities()
577 media_entity_cleanup(&ipipe->subdev.entity); omap4iss_ipipe_cleanup()
H A Diss_resizer.c294 to_iss_pipeline(&resizer->subdev.entity); omap4iss_resizer_isr()
401 if (omap4iss_module_sync_idle(&sd->entity, &resizer->wait, resizer_set_stream()
700 * Media entity operations
705 * @entity: RESIZER media entity
712 static int resizer_link_setup(struct media_entity *entity, resizer_link_setup() argument
716 struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity); resizer_link_setup()
720 switch (local->index | media_entity_type(remote->entity)) { resizer_link_setup()
731 if (remote->entity == &iss->ipipeif.subdev.entity) resizer_link_setup()
733 else if (remote->entity == &iss->ipipe.subdev.entity) resizer_link_setup()
763 * resizer_init_entities - Initialize V4L2 subdev and media entity
772 struct media_entity *me = &sd->entity; resizer_init_entities()
807 ret = media_entity_create_link(&resizer->subdev.entity, resizer_init_entities()
809 &resizer->video_out.video.entity, 0, 0); resizer_init_entities()
873 media_entity_cleanup(&resizer->subdev.entity); omap4iss_resizer_cleanup()
H A Diss_ipipeif.c346 if (omap4iss_module_sync_idle(&sd->entity, &ipipeif->wait, ipipeif_set_stream()
646 * Media entity operations
651 * @entity: IPIPEIF media entity
658 static int ipipeif_link_setup(struct media_entity *entity, ipipeif_link_setup() argument
662 struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity); ipipeif_link_setup()
666 switch (local->index | media_entity_type(remote->entity)) { ipipeif_link_setup()
677 if (remote->entity == &iss->csi2a.subdev.entity) ipipeif_link_setup()
679 else if (remote->entity == &iss->csi2b.subdev.entity) ipipeif_link_setup()
720 * ipipeif_init_entities - Initialize V4L2 subdev and media entity
729 struct media_entity *me = &sd->entity; ipipeif_init_entities()
765 ret = media_entity_create_link(&ipipeif->subdev.entity, ipipeif_init_entities()
767 &ipipeif->video_out.video.entity, 0, 0); ipipeif_init_entities()
831 media_entity_cleanup(&ipipeif->subdev.entity); omap4iss_ipipeif_cleanup()
H A Diss_csi2.c546 sensor = media_entity_to_v4l2_subdev(pad->entity); csi2_configure()
680 to_iss_pipeline(&csi2->subdev.entity); csi2_isr_ctx()
743 struct iss_pipeline *pipe = to_iss_pipeline(&csi2->subdev.entity); omap4iss_csi2_isr()
1026 struct iss_pipeline *pipe = to_iss_pipeline(&csi2->subdev.entity); csi2_link_validate()
1029 pipe->external = media_entity_to_v4l2_subdev(link->source->entity); csi2_link_validate()
1113 if (omap4iss_module_sync_idle(&sd->entity, &csi2->wait, csi2_set_stream()
1155 * Media entity operations
1160 * @entity : Pointer to media entity structure
1166 static int csi2_link_setup(struct media_entity *entity, csi2_link_setup() argument
1170 struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity); csi2_link_setup()
1179 switch (local->index | media_entity_type(remote->entity)) { csi2_link_setup()
1249 * csi2_init_entities - Initialize subdev and media entity.
1257 struct media_entity *me = &sd->entity; csi2_init_entities()
1294 ret = media_entity_create_link(&csi2->subdev.entity, CSI2_PAD_SOURCE, csi2_init_entities()
1295 &csi2->video_out.video.entity, 0, 0); csi2_init_entities()
1304 media_entity_cleanup(&csi2->subdev.entity); csi2_init_entities()
1353 media_entity_cleanup(&csi2a->subdev.entity); omap4iss_csi2_cleanup()
1356 media_entity_cleanup(&csi2b->subdev.entity); omap4iss_csi2_cleanup()
H A Diss_ipipe.h35 * @pads: Sink and source media entity pads
H A Diss_resizer.h36 * @pads: Sink and source media entity pads
H A Diss_video.h18 #include <media/media-entity.h>
70 /* The input entity is idle, ready to be started. */
72 /* The output entity is idle, ready to be started. */
80 * @entities: Bitmask of entities in the pipeline (indexed by entity ID)
H A Diss_ipipeif.h38 * @pads: Sink and source media entity pads
H A Diss.h85 * @crashed: Bitmask of crashed entities (indexed by entity ID)
154 int omap4iss_pipeline_pm_use(struct media_entity *entity, int use);
H A Diss_csiphy.c123 struct iss_pipeline *pipe = to_iss_pipeline(&csi2_subdev->entity); omap4iss_csiphy_config()
/linux-4.4.14/drivers/media/dvb-core/
H A Ddvbdev.c192 dvbdev->entity = kzalloc(sizeof(*dvbdev->entity), GFP_KERNEL); dvb_register_media_device()
193 if (!dvbdev->entity) dvb_register_media_device()
196 dvbdev->entity->info.dev.major = DVB_MAJOR; dvb_register_media_device()
197 dvbdev->entity->info.dev.minor = minor; dvb_register_media_device()
198 dvbdev->entity->name = dvbdev->name; dvb_register_media_device()
217 kfree(dvbdev->entity); dvb_register_media_device()
224 dvbdev->entity->type = MEDIA_ENT_T_DEVNODE_DVB_FE; dvb_register_media_device()
229 dvbdev->entity->type = MEDIA_ENT_T_DEVNODE_DVB_DEMUX; dvb_register_media_device()
234 dvbdev->entity->type = MEDIA_ENT_T_DEVNODE_DVB_DVR; dvb_register_media_device()
238 dvbdev->entity->type = MEDIA_ENT_T_DEVNODE_DVB_CA; dvb_register_media_device()
243 dvbdev->entity->type = MEDIA_ENT_T_DEVNODE_DVB_NET; dvb_register_media_device()
246 kfree(dvbdev->entity); dvb_register_media_device()
247 dvbdev->entity = NULL; dvb_register_media_device()
252 ret = media_entity_init(dvbdev->entity, npads, dvbdev->pads, 0); dvb_register_media_device()
255 dvbdev->entity); dvb_register_media_device()
259 __func__, dvbdev->entity->name); dvb_register_media_device()
261 kfree(dvbdev->entity); dvb_register_media_device()
262 dvbdev->entity = NULL; dvb_register_media_device()
267 __func__, dvbdev->entity->name); dvb_register_media_device()
370 if (dvbdev->entity) { dvb_unregister_device()
371 media_device_unregister_entity(dvbdev->entity); dvb_unregister_device()
372 kfree(dvbdev->entity); dvb_unregister_device()
388 struct media_entity *entity, *tuner = NULL, *fe = NULL; dvb_create_media_graph() local
394 media_device_for_each_entity(entity, mdev) { media_device_for_each_entity()
395 switch (entity->type) { media_device_for_each_entity()
397 tuner = entity; media_device_for_each_entity()
400 fe = entity; media_device_for_each_entity()
403 demux = entity; media_device_for_each_entity()
406 dvr = entity; media_device_for_each_entity()
409 ca = entity; media_device_for_each_entity()
H A Ddvbdev.h120 * @entity: pointer to struct media_entity associated with the device node
121 * @pads: pointer to struct media_pad associated with @entity;
151 struct media_entity *entity; member in struct:dvb_device
H A Ddvb_frontend.c623 struct media_entity *entity, *source; dvb_enable_media_tuner() local
632 entity = fepriv->dvbdev->entity; dvb_enable_media_tuner()
633 fepriv->pipe_start_entity = entity; dvb_enable_media_tuner()
635 for (i = 0; i < entity->num_links; i++) { dvb_enable_media_tuner()
636 link = &entity->links[i]; dvb_enable_media_tuner()
637 if (link->sink->entity == entity) { dvb_enable_media_tuner()
660 source = found_link->source->entity; dvb_enable_media_tuner()
667 sink = link->sink->entity; dvb_enable_media_tuner()
669 if (sink == entity) dvb_enable_media_tuner()
/linux-4.4.14/drivers/media/platform/omap3isp/
H A Disp.c552 pipe = to_isp_pipeline(&isp->isp_ccp2.subdev.entity); isp_isr_sbl()
558 pipe = to_isp_pipeline(&isp->isp_csi2a.subdev.entity); isp_isr_sbl()
564 pipe = to_isp_pipeline(&isp->isp_ccdc.subdev.entity); isp_isr_sbl()
570 pipe = to_isp_pipeline(&isp->isp_prev.subdev.entity); isp_isr_sbl()
579 pipe = to_isp_pipeline(&isp->isp_res.subdev.entity); isp_isr_sbl()
665 * To achieve this use the entity use_count field to track the number of users.
682 * @entity: The entity
686 static int isp_pipeline_pm_use_count(struct media_entity *entity) isp_pipeline_pm_use_count() argument
691 media_entity_graph_walk_start(&graph, entity); isp_pipeline_pm_use_count()
693 while ((entity = media_entity_graph_walk_next(&graph))) { isp_pipeline_pm_use_count()
694 if (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE) isp_pipeline_pm_use_count()
695 use += entity->use_count; isp_pipeline_pm_use_count()
702 * isp_pipeline_pm_power_one - Apply power change to an entity
703 * @entity: The entity
706 * Change the entity use count by @change. If the entity is a subdev update its
712 static int isp_pipeline_pm_power_one(struct media_entity *entity, int change) isp_pipeline_pm_power_one() argument
717 subdev = media_entity_type(entity) == MEDIA_ENT_T_V4L2_SUBDEV isp_pipeline_pm_power_one()
718 ? media_entity_to_v4l2_subdev(entity) : NULL; isp_pipeline_pm_power_one()
720 if (entity->use_count == 0 && change > 0 && subdev != NULL) { isp_pipeline_pm_power_one()
726 entity->use_count += change; isp_pipeline_pm_power_one()
727 WARN_ON(entity->use_count < 0); isp_pipeline_pm_power_one()
729 if (entity->use_count == 0 && change < 0 && subdev != NULL) isp_pipeline_pm_power_one()
737 * @entity: The entity
745 static int isp_pipeline_pm_power(struct media_entity *entity, int change) isp_pipeline_pm_power() argument
748 struct media_entity *first = entity; isp_pipeline_pm_power()
754 media_entity_graph_walk_start(&graph, entity); isp_pipeline_pm_power()
756 while (!ret && (entity = media_entity_graph_walk_next(&graph))) isp_pipeline_pm_power()
757 if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE) isp_pipeline_pm_power()
758 ret = isp_pipeline_pm_power_one(entity, change); isp_pipeline_pm_power()
766 && first != entity) isp_pipeline_pm_power()
774 * omap3isp_pipeline_pm_use - Update the use count of an entity
775 * @entity: The entity
776 * @use: Use (1) or stop using (0) the entity
785 int omap3isp_pipeline_pm_use(struct media_entity *entity, int use) omap3isp_pipeline_pm_use() argument
790 mutex_lock(&entity->parent->graph_mutex); omap3isp_pipeline_pm_use()
793 entity->use_count += change; omap3isp_pipeline_pm_use()
794 WARN_ON(entity->use_count < 0); omap3isp_pipeline_pm_use()
797 ret = isp_pipeline_pm_power(entity, change); omap3isp_pipeline_pm_use()
799 entity->use_count -= change; omap3isp_pipeline_pm_use()
801 mutex_unlock(&entity->parent->graph_mutex); omap3isp_pipeline_pm_use()
823 struct media_entity *source = link->source->entity; isp_pipeline_link_notify()
824 struct media_entity *sink = link->sink->entity; isp_pipeline_link_notify()
873 struct media_entity *entity; isp_pipeline_enable() local
879 /* Refuse to start streaming if an entity included in the pipeline has isp_pipeline_enable()
893 entity = &pipe->output->video.entity; isp_pipeline_enable()
895 pad = &entity->pads[0]; isp_pipeline_enable()
901 media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) isp_pipeline_enable()
904 entity = pad->entity; isp_pipeline_enable()
905 subdev = media_entity_to_v4l2_subdev(entity); isp_pipeline_enable()
973 struct media_entity *entity; isp_pipeline_disable() local
983 entity = &pipe->output->video.entity; isp_pipeline_disable()
985 pad = &entity->pads[0]; isp_pipeline_disable()
991 media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) isp_pipeline_disable()
994 entity = pad->entity; isp_pipeline_disable()
995 subdev = media_entity_to_v4l2_subdev(entity); isp_pipeline_disable()
1015 /* Handle stop failures. An entity that fails to stop can isp_pipeline_disable()
1031 isp->crashed |= 1U << subdev->entity.id; isp_pipeline_disable()
1112 * isp_pipeline_is_last - Verify if entity has an enabled link to the output
1114 * @me: ISP module's media entity
1116 * Returns 1 if the entity has an enabled link to the output video node or 0
1131 return pad->entity == me; isp_pipeline_is_last()
1136 * @me: ISP module's media entity
1138 * Suspend the whole pipeline if module's entity has an enabled link to the
1150 * @me: ISP module's media entity
1152 * Resume the whole pipeline if module's entity has an enabled link to the
1176 isp_suspend_module_pipeline(&isp->isp_res.subdev.entity); isp_suspend_modules()
1177 isp_suspend_module_pipeline(&isp->isp_prev.subdev.entity); isp_suspend_modules()
1178 isp_suspend_module_pipeline(&isp->isp_ccdc.subdev.entity); isp_suspend_modules()
1179 isp_suspend_module_pipeline(&isp->isp_csi2a.subdev.entity); isp_suspend_modules()
1180 isp_suspend_module_pipeline(&isp->isp_ccp2.subdev.entity); isp_suspend_modules()
1208 isp_resume_module_pipeline(&isp->isp_res.subdev.entity); isp_resume_modules()
1209 isp_resume_module_pipeline(&isp->isp_prev.subdev.entity); isp_resume_modules()
1210 isp_resume_module_pipeline(&isp->isp_ccdc.subdev.entity); isp_resume_modules()
1211 isp_resume_module_pipeline(&isp->isp_csi2a.subdev.entity); isp_resume_modules()
1212 isp_resume_module_pipeline(&isp->isp_ccp2.subdev.entity); isp_resume_modules()
1368 * @me: ISP submodule's media entity
1645 /* Reset the ISP if an entity has failed to stop. This is the __omap3isp_put()
1798 struct isp_device *isp, struct media_entity *entity, isp_link_entity()
1813 input = &isp->isp_ccdc.subdev.entity; isp_link_entity()
1819 input = &isp->isp_csi2a.subdev.entity; isp_link_entity()
1826 input = &isp->isp_ccp2.subdev.entity; isp_link_entity()
1832 input = &isp->isp_csi2c.subdev.entity; isp_link_entity()
1850 dev_err(isp->dev, "%s: invalid input %u\n", entity->name, isp_link_entity()
1855 for (i = 0; i < entity->num_pads; i++) { isp_link_entity()
1856 if (entity->pads[i].flags & MEDIA_PAD_FL_SOURCE) isp_link_entity()
1859 if (i == entity->num_pads) { isp_link_entity()
1860 dev_err(isp->dev, "%s: no source pad in external entity\n", isp_link_entity()
1865 return media_entity_create_link(entity, i, input, pad, flags); isp_link_entity()
2005 &isp->isp_csi2a.subdev.entity, CSI2_PAD_SOURCE, isp_initialize_modules()
2006 &isp->isp_ccdc.subdev.entity, CCDC_PAD_SINK, 0); isp_initialize_modules()
2011 &isp->isp_ccp2.subdev.entity, CCP2_PAD_SOURCE, isp_initialize_modules()
2012 &isp->isp_ccdc.subdev.entity, CCDC_PAD_SINK, 0); isp_initialize_modules()
2017 &isp->isp_ccdc.subdev.entity, CCDC_PAD_SOURCE_VP, isp_initialize_modules()
2018 &isp->isp_prev.subdev.entity, PREV_PAD_SINK, 0); isp_initialize_modules()
2023 &isp->isp_ccdc.subdev.entity, CCDC_PAD_SOURCE_OF, isp_initialize_modules()
2024 &isp->isp_res.subdev.entity, RESZ_PAD_SINK, 0); isp_initialize_modules()
2029 &isp->isp_prev.subdev.entity, PREV_PAD_SOURCE, isp_initialize_modules()
2030 &isp->isp_res.subdev.entity, RESZ_PAD_SINK, 0); isp_initialize_modules()
2035 &isp->isp_ccdc.subdev.entity, CCDC_PAD_SOURCE_VP, isp_initialize_modules()
2036 &isp->isp_aewb.subdev.entity, 0, isp_initialize_modules()
2042 &isp->isp_ccdc.subdev.entity, CCDC_PAD_SOURCE_VP, isp_initialize_modules()
2043 &isp->isp_af.subdev.entity, 0, isp_initialize_modules()
2049 &isp->isp_ccdc.subdev.entity, CCDC_PAD_SOURCE_VP, isp_initialize_modules()
2050 &isp->isp_hist.subdev.entity, 0, isp_initialize_modules()
2287 ret = isp_link_entity(isp, &subdev->entity, isd->bus.interface); isp_subdev_notifier_bound()
1797 isp_link_entity( struct isp_device *isp, struct media_entity *entity, enum isp_interface_type interface) isp_link_entity() argument
H A Dispccp2.h30 /* CCP2 input media entity */
37 /* CCP2 output media entity */
H A Disppreview.h108 * @pads: Media entity pads
113 * @video_in: Input video entity
114 * @video_out: Output video entity
118 * @underrun: Whether the preview entity has queued buffers on the output
H A Dispvideo.c214 media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV) isp_video_remote_subdev()
220 return media_entity_to_v4l2_subdev(remote->entity); isp_video_remote_subdev()
228 struct media_entity *entity = &video->video.entity; isp_video_get_graph_data() local
229 struct media_device *mdev = entity->parent; isp_video_get_graph_data()
233 media_entity_graph_walk_start(&graph, entity); isp_video_get_graph_data()
235 while ((entity = media_entity_graph_walk_next(&graph))) { isp_video_get_graph_data()
238 pipe->entities |= 1 << entity->id; isp_video_get_graph_data()
243 if (entity == &video->video.entity) isp_video_get_graph_data()
246 if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE) isp_video_get_graph_data()
249 __video = to_isp_video(media_entity_to_video_device(entity)); isp_video_get_graph_data()
389 struct isp_pipeline *pipe = to_isp_pipeline(&video->video.entity); isp_video_buffer_queue()
454 struct isp_pipeline *pipe = to_isp_pipeline(&video->video.entity); omap3isp_video_buffer_next()
884 &isp->isp_csi2a.subdev.entity, isp_video_check_external_subdevs()
885 &isp->isp_csi2c.subdev.entity, isp_video_check_external_subdevs()
886 &isp->isp_ccp2.subdev.entity, isp_video_check_external_subdevs()
887 &isp->isp_ccdc.subdev.entity isp_video_check_external_subdevs()
903 /* Is the entity part of the pipeline? */ isp_video_check_external_subdevs()
912 source = source_pad->entity; isp_video_check_external_subdevs()
956 if (pipe->entities & (1 << isp->isp_ccdc.subdev.entity.id)) { isp_video_check_external_subdevs()
1016 /* Start streaming on the pipeline. No link touching an entity in the isp_video_streamon()
1019 pipe = video->video.entity.pipe isp_video_streamon()
1020 ? to_isp_pipeline(&video->video.entity) : &video->pipe; isp_video_streamon()
1028 ret = media_entity_pipeline_start(&video->video.entity, &pipe->pipe); isp_video_streamon()
1103 media_entity_pipeline_stop(&video->video.entity); isp_video_streamon()
1125 struct isp_pipeline *pipe = to_isp_pipeline(&video->video.entity); isp_video_streamoff()
1166 media_entity_pipeline_stop(&video->video.entity); isp_video_streamoff()
1247 ret = omap3isp_pipeline_pm_use(&video->video.entity, 1); isp_video_open()
1297 omap3isp_pipeline_pm_use(&video->video.entity, 0); isp_video_release()
1371 ret = media_entity_init(&video->video.entity, 1, &video->pad, 0); omap3isp_video_init()
1405 media_entity_cleanup(&video->video.entity); omap3isp_video_cleanup()
H A Dispccp2.c360 sensor = media_entity_to_v4l2_subdev(pad->entity); ccp2_if_configure()
385 struct isp_pipeline *pipe = to_isp_pipeline(&ccp2->subdev.entity); ccp2_adjust_bandwidth()
537 struct isp_pipeline *pipe = to_isp_pipeline(&ccp2->subdev.entity); ccp2_isr_buffer()
561 struct isp_pipeline *pipe = to_isp_pipeline(&ccp2->subdev.entity); omap3isp_ccp2_isr()
876 if (omap3isp_module_sync_idle(&sd->entity, &ccp2->wait, ccp2_s_stream()
942 * Media entity operations
947 * @entity : Pointer to media entity structure
953 static int ccp2_link_setup(struct media_entity *entity, ccp2_link_setup() argument
957 struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity); ccp2_link_setup()
960 switch (local->index | media_entity_type(remote->entity)) { ccp2_link_setup()
1016 * omap3isp_ccp2_register_entities - Register the subdev media entity
1048 * ccp2_init_entities - Initialize ccp2 subdev and media entity.
1056 struct media_entity *me = &sd->entity; ccp2_init_entities()
1103 ret = media_entity_create_link(&ccp2->video_in.video.entity, 0, ccp2_init_entities()
1104 &ccp2->subdev.entity, CCP2_PAD_SINK, 0); ccp2_init_entities()
1113 media_entity_cleanup(&ccp2->subdev.entity); ccp2_init_entities()
1168 media_entity_cleanup(&ccp2->subdev.entity); omap3isp_ccp2_cleanup()
H A Dispcsi2.c551 struct isp_pipeline *pipe = to_isp_pipeline(&csi2->subdev.entity); csi2_configure()
568 sensor = media_entity_to_v4l2_subdev(pad->entity); csi2_configure()
740 struct isp_pipeline *pipe = to_isp_pipeline(&csi2->subdev.entity); omap3isp_csi2_isr()
1087 if (omap3isp_module_sync_idle(&sd->entity, &csi2->wait, csi2_set_stream()
1129 * Media entity operations
1134 * @entity : Pointer to media entity structure
1140 static int csi2_link_setup(struct media_entity *entity, csi2_link_setup() argument
1144 struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity); csi2_link_setup()
1153 switch (local->index | media_entity_type(remote->entity)) { csi2_link_setup()
1224 * csi2_init_entities - Initialize subdev and media entity.
1232 struct media_entity *me = &sd->entity; csi2_init_entities()
1268 ret = media_entity_create_link(&csi2->subdev.entity, CSI2_PAD_SOURCE, csi2_init_entities()
1269 &csi2->video_out.video.entity, 0, 0); csi2_init_entities()
1278 media_entity_cleanup(&csi2->subdev.entity); csi2_init_entities()
1324 media_entity_cleanup(&csi2a->subdev.entity); omap3isp_csi2_cleanup()
H A Dispvideo.h20 #include <media/media-entity.h>
71 /* The input entity is idle, ready to be started. */
73 /* The output entity is idle, ready to be started. */
83 * @entities: Bitmask of entities in the pipeline (indexed by entity ID)
H A Disp.h154 * @stop_failure: Indicates that an entity failed to stop.
155 * @crashed: Bitmask of crashed entities (indexed by entity ID)
268 int omap3isp_pipeline_pm_use(struct media_entity *entity, int use);
357 if (pad >= subdev->entity.num_pads) isp_pad_buffer_type()
360 if (subdev->entity.pads[pad].flags & MEDIA_PAD_FL_SINK) isp_pad_buffer_type()
H A Dispresizer.c503 struct isp_pipeline *pipe = to_isp_pipeline(&res->subdev.entity); omap3isp_resizer_max_rate()
544 struct isp_pipeline *pipe = to_isp_pipeline(&res->subdev.entity); resizer_adjust_bandwidth()
1017 struct isp_pipeline *pipe = to_isp_pipeline(&res->subdev.entity); resizer_isr_buffer()
1167 if (omap3isp_module_sync_idle(&sd->entity, &res->wait, resizer_set_stream()
1548 struct isp_pipeline *pipe = to_isp_pipeline(&sd->entity); resizer_link_validate()
1609 * Media entity operations
1614 * @entity : Pointer to media entity structure
1620 static int resizer_link_setup(struct media_entity *entity, resizer_link_setup() argument
1624 struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity); resizer_link_setup()
1627 switch (local->index | media_entity_type(remote->entity)) { resizer_link_setup()
1706 * resizer_init_entities - Initialize resizer subdev and media entity.
1714 struct media_entity *me = &sd->entity; resizer_init_entities()
1756 res->video_out.video.entity.flags |= MEDIA_ENT_FL_DEFAULT; resizer_init_entities()
1759 ret = media_entity_create_link(&res->video_in.video.entity, 0, resizer_init_entities()
1760 &res->subdev.entity, RESZ_PAD_SINK, 0); resizer_init_entities()
1764 ret = media_entity_create_link(&res->subdev.entity, RESZ_PAD_SOURCE, resizer_init_entities()
1765 &res->video_out.video.entity, 0, 0); resizer_init_entities()
1776 media_entity_cleanup(&res->subdev.entity); resizer_init_entities()
1802 media_entity_cleanup(&res->subdev.entity); omap3isp_resizer_cleanup()
H A Dispccdc.c807 struct isp_pipeline *pipe = to_isp_pipeline(&ccdc->subdev.entity); ccdc_config_vp()
940 struct isp_pipeline *pipe = to_isp_pipeline(&ccdc->subdev.entity); omap3isp_ccdc_max_rate()
1139 sensor = media_entity_to_v4l2_subdev(pad->entity); ccdc_configure()
1464 struct isp_pipeline *pipe = to_isp_pipeline(&ccdc->subdev.entity); ccdc_hs_vs_isr()
1489 to_isp_pipeline(&ccdc->subdev.entity); ccdc_lsc_isr()
1542 struct isp_pipeline *pipe = to_isp_pipeline(&ccdc->subdev.entity); ccdc_has_all_fields()
1586 struct isp_pipeline *pipe = to_isp_pipeline(&ccdc->subdev.entity); ccdc_isr_buffer()
1611 isp->crashed |= 1U << ccdc->subdev.entity.id; ccdc_isr_buffer()
1649 to_isp_pipeline(&ccdc->subdev.entity); ccdc_vd0_isr()
2422 media_entity_to_v4l2_subdev(link->source->entity) ccdc_link_validate()
2497 * Media entity operations
2502 * @entity: CCDC media entity
2509 static int ccdc_link_setup(struct media_entity *entity, ccdc_link_setup() argument
2513 struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity); ccdc_link_setup()
2517 switch (local->index | media_entity_type(remote->entity)) { ccdc_link_setup()
2530 if (remote->entity == &isp->isp_ccp2.subdev.entity) ccdc_link_setup()
2532 else if (remote->entity == &isp->isp_csi2a.subdev.entity) ccdc_link_setup()
2534 else if (remote->entity == &isp->isp_csi2c.subdev.entity) ccdc_link_setup()
2626 * ccdc_init_entities - Initialize V4L2 subdev and media entity
2635 struct media_entity *me = &sd->entity; ccdc_init_entities()
2670 ret = media_entity_create_link(&ccdc->subdev.entity, CCDC_PAD_SOURCE_OF, ccdc_init_entities()
2671 &ccdc->video_out.video.entity, 0, 0); ccdc_init_entities()
2732 media_entity_cleanup(&ccdc->subdev.entity); omap3isp_ccdc_cleanup()
H A Disppreview.c1167 struct isp_pipeline *pipe = to_isp_pipeline(&prev->subdev.entity); preview_adjust_bandwidth()
1479 struct isp_pipeline *pipe = to_isp_pipeline(&prev->subdev.entity); preview_isr_buffer()
1670 if (omap3isp_module_sync_idle(&sd->entity, &prev->wait, preview_set_stream()
2130 * Media entity operations
2135 * @entity : Pointer to media entity structure
2141 static int preview_link_setup(struct media_entity *entity, preview_link_setup() argument
2145 struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity); preview_link_setup()
2148 switch (local->index | media_entity_type(remote->entity)) { preview_link_setup()
2250 * preview_init_entities - Initialize subdev and media entity.
2258 struct media_entity *me = &sd->entity; preview_init_entities()
2315 ret = media_entity_create_link(&prev->video_in.video.entity, 0, preview_init_entities()
2316 &prev->subdev.entity, PREV_PAD_SINK, 0); preview_init_entities()
2320 ret = media_entity_create_link(&prev->subdev.entity, PREV_PAD_SOURCE, preview_init_entities()
2321 &prev->video_out.video.entity, 0, 0); preview_init_entities()
2332 media_entity_cleanup(&prev->subdev.entity); preview_init_entities()
2359 media_entity_cleanup(&prev->subdev.entity); omap3isp_preview_cleanup()
H A Dispcsiphy.c168 struct isp_pipeline *pipe = to_isp_pipeline(&csi2->subdev.entity); omap3isp_csiphy_config()
309 to_isp_pipeline(&csi2->subdev.entity); omap3isp_csiphy_release()
H A Dispccdc.h104 * @pads: Sink and source media entity pads
H A Dispstat.c902 pipe = to_isp_pipeline(&stat->subdev.entity); __stat_isr()
1020 struct media_entity *me = &subdev->entity; isp_stat_init_entities()
1058 media_entity_cleanup(&stat->subdev.entity); omap3isp_stat_cleanup()
/linux-4.4.14/net/ceph/
H A Dauth_none.h10 * we use a single static authorizer that simply encodes our entity name
H A Dauth.c98 * Initiate protocol negotiation with monitor. Include entity name
/linux-4.4.14/drivers/media/v4l2-core/
H A Dv4l2-subdev.c38 fh->pad = kzalloc(sizeof(*fh->pad) * sd->entity.num_pads, GFP_KERNEL); subdev_fh_init()
59 struct media_entity *entity = NULL; subdev_open() local
78 entity = media_entity_get(&sd->entity); subdev_open()
79 if (!entity) { subdev_open()
96 media_entity_put(entity); subdev_open()
117 media_entity_put(&sd->entity); subdev_close()
136 if (format->pad >= sd->entity.num_pads) check_format()
148 if (crop->pad >= sd->entity.num_pads) check_crop()
161 if (sel->pad >= sd->entity.num_pads) check_selection()
169 if (edid->pad >= sd->entity.num_pads) check_edid()
327 if (code->pad >= sd->entity.num_pads) subdev_do_ioctl()
341 if (fse->pad >= sd->entity.num_pads) subdev_do_ioctl()
351 if (fi->pad >= sd->entity.num_pads) subdev_do_ioctl()
360 if (fi->pad >= sd->entity.num_pads) subdev_do_ioctl()
373 if (fie->pad >= sd->entity.num_pads) subdev_do_ioctl()
425 if (cap->pad >= sd->entity.num_pads) subdev_do_ioctl()
434 if (dvt->pad >= sd->entity.num_pads) subdev_do_ioctl()
529 if (media_entity_type(pad->entity) == MEDIA_ENT_T_V4L2_SUBDEV) { v4l2_subdev_link_validate_get_format()
531 media_entity_to_v4l2_subdev(pad->entity); v4l2_subdev_link_validate_get_format()
538 WARN(pad->entity->type != MEDIA_ENT_T_DEVNODE_V4L, v4l2_subdev_link_validate_get_format()
539 "Driver bug! Wrong media entity type 0x%08x, entity %s\n", v4l2_subdev_link_validate_get_format()
540 pad->entity->type, pad->entity->name); v4l2_subdev_link_validate_get_format()
561 sink = media_entity_to_v4l2_subdev(link->sink->entity); v4l2_subdev_link_validate()
586 sd->entity.name = sd->name; v4l2_subdev_init()
587 sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV; v4l2_subdev_init()
H A Dv4l2-device.c149 struct media_entity *entity = &sd->entity; v4l2_device_register_subdev() local
186 /* Register the entity. */ v4l2_device_register_subdev()
188 err = media_device_register_entity(v4l2_dev->mdev, entity); v4l2_device_register_subdev()
250 sd->entity.info.dev.major = VIDEO_MAJOR; v4l2_device_register_subdev_nodes()
251 sd->entity.info.dev.minor = vdev->minor; v4l2_device_register_subdev_nodes()
288 media_entity_remove_links(&sd->entity); v4l2_device_unregister_subdev()
289 media_device_unregister_entity(&sd->entity); v4l2_device_unregister_subdev()
H A Dv4l2-flash-led-class.c654 ret = media_entity_init(&sd->entity, 0, NULL, 0); v4l2_flash_init()
658 sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_FLASH; v4l2_flash_init()
679 media_entity_cleanup(&sd->entity); v4l2_flash_init()
704 media_entity_cleanup(&sd->entity); v4l2_flash_release()
H A Dv4l2-dev.c199 media_device_unregister_entity(&vdev->entity); v4l2_device_release()
922 /* Part 5: Register the entity. */ __video_register_device()
925 vdev->entity.type = MEDIA_ENT_T_DEVNODE_V4L; __video_register_device()
926 vdev->entity.name = vdev->name; __video_register_device()
927 vdev->entity.info.dev.major = VIDEO_MAJOR; __video_register_device()
928 vdev->entity.info.dev.minor = vdev->minor; __video_register_device()
930 &vdev->entity); __video_register_device()
H A Dtuner-core.c441 t->sd.entity.name = t->name; set_type()
699 t->sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_TUNER; tuner_probe()
700 t->sd.entity.name = t->name; tuner_probe()
702 ret = media_entity_init(&t->sd.entity, 1, &t->pad, 0); tuner_probe()
704 tuner_err("failed to initialize media entity!\n"); tuner_probe()
/linux-4.4.14/Documentation/DocBook/media/
H A DMakefile252 entity=`echo $$ident | tr _ -` ; \
253 r="$$r s/([^\w\-])$$ident([^\w\-])/\1\&$$entity\;\2/g;";\
268 entity=`echo $$ident | tr _ -` ; \
269 r="$$r s/([^\w\-])$$ident([^\w\-])/\1\&$$entity\;\2/g;";\
308 entity=`echo $$ident | tr _ -` ; \
309 echo "<!ENTITY func-$$entity \"<link" \
310 "linkend='func-$$entity'><function>$$ident()</function></link>\">" \
317 entity=`echo $$ident | tr _ -` ; \
319 if [ "$$id" != "" ]; then echo "<!ENTITY $$entity \"<link" \
329 entity=`echo $$ident | tr _ -` ; \
330 echo "<!ENTITY $$entity \"<link" \
331 "linkend='$$entity'><constant>$$ident</constant></link>\">" \
338 entity=`echo $$ident | tr _ -` ; \
339 echo "<!ENTITY $$entity \"<link" \
340 "linkend='$$entity'>$$ident</link>\">" >>$@ ; \
346 entity=`echo $$ident | sed -e "s/v4l2_mpeg_cx2341x_video_\([a-z]*_spatial_filter_type\)/\1/" | tr _ -` ; \
347 echo "<!ENTITY $$entity \"enum&nbsp;<link" \
348 "linkend='$$entity'>$$ident</link>\">" >>$@ ; \
354 entity=`echo $$ident | tr _ -` ; \
355 echo "<!ENTITY $$entity \"<link" \
356 "linkend='$$entity'><constant>$$ident</constant></link>\">" \
363 entity=`echo $$ident | tr _ - | sed s/v4l2-mpeg-vbi-ITV0/v4l2-mpeg-vbi-itv0-1/g` ; \
364 echo "<!ENTITY $$entity \"struct&nbsp;<link" \
365 "linkend='$$entity'>$$ident</link>\">" >>$@ ; \
378 entity=`echo "$$file" | sed $(FILENAME) -e s/"^([^-]*)"/sub\1/` ; \
381 echo "<!ENTITY sub-$$entity SYSTEM \"$$file\">" >>$@ ; \
390 entity=`echo "$$file" |sed $(FILENAME)` ; \
391 echo "<!ENTITY $$entity SYSTEM \"$$file\">" >>$@ ; \
/linux-4.4.14/arch/alpha/include/asm/
H A Dtimex.h17 * Only the low 32 bits are available as a continuously counting entity.
/linux-4.4.14/drivers/staging/media/davinci_vpfe/
H A Dvpfe_video.c44 return remote->entity; vpfe_get_input_entity()
62 subdev = media_entity_to_v4l2_subdev(remote->entity); vpfe_update_current_ext_subdev()
91 if (remote == NULL || remote->entity->type != MEDIA_ENT_T_V4L2_SUBDEV) vpfe_video_remote_subdev()
95 return media_entity_to_v4l2_subdev(remote->entity); vpfe_video_remote_subdev()
132 struct media_entity *entity = &video->video_dev.entity; vpfe_prepare_pipeline() local
133 struct media_device *mdev = entity->parent; vpfe_prepare_pipeline()
147 media_entity_graph_walk_start(&graph, entity); vpfe_prepare_pipeline()
148 while ((entity = media_entity_graph_walk_next(&graph))) { vpfe_prepare_pipeline()
149 if (entity == &video->video_dev.entity) vpfe_prepare_pipeline()
151 if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE) vpfe_prepare_pipeline()
153 far_end = to_vpfe_video(media_entity_to_video_device(entity)); vpfe_prepare_pipeline()
232 pad = &subdev->entity.pads[0]; vpfe_video_validate_pipeline()
247 pad->entity->type != MEDIA_ENT_T_V4L2_SUBDEV) vpfe_video_validate_pipeline()
250 subdev = media_entity_to_v4l2_subdev(pad->entity); vpfe_video_validate_pipeline()
281 struct media_entity *entity; vpfe_pipeline_enable() local
287 entity = vpfe_get_input_entity(pipe->outputs[0]); vpfe_pipeline_enable()
289 entity = &pipe->inputs[0]->video_dev.entity; vpfe_pipeline_enable()
291 mdev = entity->parent; vpfe_pipeline_enable()
293 media_entity_graph_walk_start(&graph, entity); vpfe_pipeline_enable()
294 while ((entity = media_entity_graph_walk_next(&graph))) { vpfe_pipeline_enable()
296 if (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE) vpfe_pipeline_enable()
298 subdev = media_entity_to_v4l2_subdev(entity); vpfe_pipeline_enable()
321 struct media_entity *entity; vpfe_pipeline_disable() local
327 entity = vpfe_get_input_entity(pipe->outputs[0]); vpfe_pipeline_disable()
329 entity = &pipe->inputs[0]->video_dev.entity; vpfe_pipeline_disable()
331 mdev = entity->parent; vpfe_pipeline_disable()
333 media_entity_graph_walk_start(&graph, entity); vpfe_pipeline_disable()
335 while ((entity = media_entity_graph_walk_next(&graph))) { vpfe_pipeline_disable()
337 if (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE) vpfe_pipeline_disable()
339 subdev = media_entity_to_v4l2_subdev(entity); vpfe_pipeline_disable()
1603 ret = media_entity_init(&video->video_dev.entity, vpfe_video_init()
1633 media_entity_cleanup(&video->video_dev.entity); vpfe_video_unregister()
H A Dvpfe_mc_capture.c445 /* if entity has no pads (ex: amplifier), vpfe_register_entities()
447 if (vpfe_dev->sd[i]->entity.num_pads) { vpfe_register_entities()
448 ret = media_entity_create_link(&vpfe_dev->sd[i]->entity, vpfe_register_entities()
449 0, &vpfe_dev->vpfe_isif.subdev.entity, vpfe_register_entities()
455 ret = media_entity_create_link(&vpfe_dev->vpfe_isif.subdev.entity, 1, vpfe_register_entities()
456 &vpfe_dev->vpfe_ipipeif.subdev.entity, vpfe_register_entities()
461 ret = media_entity_create_link(&vpfe_dev->vpfe_ipipeif.subdev.entity, 1, vpfe_register_entities()
462 &vpfe_dev->vpfe_ipipe.subdev.entity, vpfe_register_entities()
467 ret = media_entity_create_link(&vpfe_dev->vpfe_ipipe.subdev.entity, vpfe_register_entities()
468 1, &vpfe_dev->vpfe_resizer.crop_resizer.subdev.entity, vpfe_register_entities()
473 ret = media_entity_create_link(&vpfe_dev->vpfe_ipipeif.subdev.entity, 1, vpfe_register_entities()
474 &vpfe_dev->vpfe_resizer.crop_resizer.subdev.entity, vpfe_register_entities()
H A Ddm365_resizer.c1636 * Media entity operations
1641 * @entity: Pointer to media entity structure
1647 static int resizer_link_setup(struct media_entity *entity, resizer_link_setup() argument
1651 struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity); resizer_link_setup()
1658 switch (local->index | media_entity_type(remote->entity)) { resizer_link_setup()
1707 switch (local->index | media_entity_type(remote->entity)) { resizer_link_setup()
1732 switch (local->index | media_entity_type(remote->entity)) { resizer_link_setup()
1768 * vpfe_resizer_unregister_entities() - Unregister entity
1781 /* cleanup entity */ vpfe_resizer_unregister_entities()
1782 media_entity_cleanup(&vpfe_rsz->crop_resizer.subdev.entity); vpfe_resizer_unregister_entities()
1783 media_entity_cleanup(&vpfe_rsz->resizer_a.subdev.entity); vpfe_resizer_unregister_entities()
1784 media_entity_cleanup(&vpfe_rsz->resizer_b.subdev.entity); vpfe_resizer_unregister_entities()
1788 * vpfe_resizer_register_entities() - Register entity
1834 ret = media_entity_create_link(&resizer->crop_resizer.subdev.entity, 1, vpfe_resizer_register_entities()
1835 &resizer->resizer_a.subdev.entity, vpfe_resizer_register_entities()
1841 ret = media_entity_create_link(&resizer->crop_resizer.subdev.entity, 2, vpfe_resizer_register_entities()
1842 &resizer->resizer_b.subdev.entity, vpfe_resizer_register_entities()
1848 ret = media_entity_create_link(&resizer->resizer_a.subdev.entity, 1, vpfe_resizer_register_entities()
1849 &resizer->resizer_a.video_out.video_dev.entity, 0, flags); vpfe_resizer_register_entities()
1854 ret = media_entity_create_link(&resizer->resizer_b.subdev.entity, 1, vpfe_resizer_register_entities()
1855 &resizer->resizer_b.video_out.video_dev.entity, 0, flags); vpfe_resizer_register_entities()
1868 media_entity_cleanup(&resizer->crop_resizer.subdev.entity); vpfe_resizer_register_entities()
1869 media_entity_cleanup(&resizer->resizer_a.subdev.entity); vpfe_resizer_register_entities()
1870 media_entity_cleanup(&resizer->resizer_b.subdev.entity); vpfe_resizer_register_entities()
1884 struct media_entity *me = &sd->entity; vpfe_resizer_init()
1924 me = &sd->entity; vpfe_resizer_init()
1946 me = &sd->entity; vpfe_resizer_init()
H A Ddm365_ipipeif.c882 ipipeif_link_setup(struct media_entity *entity, const struct media_pad *local, ipipeif_link_setup() argument
885 struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity); ipipeif_link_setup()
889 switch (local->index | media_entity_type(remote->entity)) { ipipeif_link_setup()
916 if (remote->entity == &vpfe->vpfe_ipipe.subdev.entity) ipipeif_link_setup()
919 else if (remote->entity == &vpfe->vpfe_resizer. ipipeif_link_setup()
920 crop_resizer.subdev.entity) ipipeif_link_setup()
939 * vpfe_ipipeif_unregister_entities() - Unregister entity
949 /* cleanup entity */ vpfe_ipipeif_unregister_entities()
950 media_entity_cleanup(&ipipeif->subdev.entity); vpfe_ipipeif_unregister_entities()
974 ret = media_entity_create_link(&ipipeif->video_in.video_dev.entity, 0, vpfe_ipipeif_register_entities()
975 &ipipeif->subdev.entity, 0, flags); vpfe_ipipeif_register_entities()
994 struct media_entity *me = &sd->entity; vpfe_ipipeif_init()
H A Ddm365_ipipe.c1693 * Media entity operations
1698 * @entity: ipipe media entity
1706 ipipe_link_setup(struct media_entity *entity, const struct media_pad *local, ipipe_link_setup() argument
1709 struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity); ipipe_link_setup()
1714 switch (local->index | media_entity_type(remote->entity)) { ipipe_link_setup()
1748 * vpfe_ipipe_unregister_entities() - ipipe unregister entity
1755 /* cleanup entity */ vpfe_ipipe_unregister_entities()
1756 media_entity_cleanup(&vpfe_ipipe->subdev.entity); vpfe_ipipe_unregister_entities()
1760 * vpfe_ipipe_register_entities() - ipipe register entity
1793 struct media_entity *me = &sd->entity; vpfe_ipipe_init()
H A Ddm365_isif.c1692 * Media entity operations
1697 * @entity: isif media entity
1705 isif_link_setup(struct media_entity *entity, const struct media_pad *local, isif_link_setup() argument
1708 struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity); isif_link_setup()
1711 switch (local->index | media_entity_type(remote->entity)) { isif_link_setup()
1749 * vpfe_isif_unregister_entities() - isif unregister entity
1757 /* cleanup entity */ vpfe_isif_unregister_entities()
1758 media_entity_cleanup(&isif->subdev.entity); vpfe_isif_unregister_entities()
1795 * vpfe_isif_register_entities() - isif register entity
1820 ret = media_entity_create_link(&isif->subdev.entity, 1, vpfe_isif_register_entities()
1821 &isif->video_out.video_dev.entity, vpfe_isif_register_entities()
1985 * vpfe_isif_init() - Initialize V4L2 subdev and media entity
1994 struct media_entity *me = &sd->entity; vpfe_isif_init()
H A Dvpfe_video.h85 /* media pad of video entity */
/linux-4.4.14/include/uapi/linux/
H A Duvcvideo.h44 __u8 entity[16]; member in struct:uvc_xu_control_mapping
H A Dmedia.h144 __u32 entity; /* entity ID */ member in struct:media_pad_desc
162 __u32 entity; member in struct:media_links_enum
/linux-4.4.14/arch/arm64/include/asm/
H A Dsync_bitops.h11 * under Xen you might be communicating with a completely external entity
/linux-4.4.14/arch/arm/include/asm/
H A Dsync_bitops.h10 * under Xen you might be communicating with a completely external entity
/linux-4.4.14/drivers/video/fbdev/
H A Dsh_mobile_lcdcfb.h30 int (*display_on)(struct sh_mobile_lcdc_entity *entity);
31 void (*display_off)(struct sh_mobile_lcdc_entity *entity);
H A Dsh_mipi_dsi.c55 struct sh_mobile_lcdc_entity entity; member in struct:sh_mipi
63 #define to_sh_mipi(e) container_of(e, struct sh_mipi, entity)
379 static int mipi_display_on(struct sh_mobile_lcdc_entity *entity) mipi_display_on() argument
381 struct sh_mipi *mipi = to_sh_mipi(entity); mipi_display_on()
391 ret = sh_mipi_setup(mipi, &entity->def_mode); mipi_display_on()
407 static void mipi_display_off(struct sh_mobile_lcdc_entity *entity) mipi_display_off() argument
409 struct sh_mipi *mipi = to_sh_mipi(entity); mipi_display_off()
455 mipi->entity.owner = THIS_MODULE; sh_mipi_probe()
456 mipi->entity.ops = &mipi_ops; sh_mipi_probe()
512 platform_set_drvdata(pdev, &mipi->entity); sh_mipi_probe()
H A Dsh_mobile_hdmi.c274 struct sh_mobile_lcdc_entity entity; member in struct:sh_hdmi
296 #define entity_to_sh_hdmi(e) container_of(e, struct sh_hdmi, entity)
847 struct sh_mobile_lcdc_chan *ch = hdmi->entity.lcdc; sh_hdmi_read_edid()
988 if (!found && hdmi->entity.def_mode.xres != 0) { sh_hdmi_read_edid()
989 found = &hdmi->entity.def_mode; sh_hdmi_read_edid()
1102 static int sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity) sh_hdmi_display_on() argument
1104 struct sh_hdmi *hdmi = entity_to_sh_hdmi(entity); sh_hdmi_display_on()
1126 static void sh_hdmi_display_off(struct sh_mobile_lcdc_entity *entity) sh_hdmi_display_off() argument
1128 struct sh_hdmi *hdmi = entity_to_sh_hdmi(entity); sh_hdmi_display_off()
1179 struct sh_mobile_lcdc_chan *ch = hdmi->entity.lcdc; sh_hdmi_edid_work_fn()
1301 hdmi->entity.owner = THIS_MODULE; sh_hdmi_probe()
1302 hdmi->entity.ops = &sh_hdmi_ops; sh_hdmi_probe()
1352 platform_set_drvdata(pdev, &hdmi->entity); sh_hdmi_probe()
/linux-4.4.14/include/net/9p/
H A D9p.h112 * @P9_TCLUNK: forget about a handle to an entity within the file system
114 * @P9_TREMOVE: request to remove an entity from the hierarchy
115 * @P9_RREMOVE: response when server has removed the entity
116 * @P9_TSTAT: request file entity attributes
117 * @P9_RSTAT: response with file entity attributes
118 * @P9_TWSTAT: request to update file entity attributes
119 * @P9_RWSTAT: response when file entity attributes are updated
316 * used to differentiate semantics for a file system entity via
349 * struct p9_qid - file system entity information
356 * on the entity (ie. read means something different on a directory than
357 * on a file). The path provides a server unique index for an entity
H A Dclient.h171 * struct p9_fid - file system entity handle
/linux-4.4.14/lib/
H A Dratelimit.c40 * the entity that is holding the lock already: ___ratelimit()
/linux-4.4.14/include/net/
H A Dllc_if.h45 /* Reset reasons, remote entity or local LLC */
/linux-4.4.14/include/linux/
H A Dreset-controller.h29 * struct reset_controller_dev - reset controller entity that might
H A Dconcap.h46 * protocol entity. No receive method is offered because the encapsulation
89 /* to be called for each data entity received from lower layer*/
H A Dcoresight.h116 * @dev: The device entity associated to this component.
153 * @dev: The device entity associated to this component.
H A Dsched.h1202 * 2) for entity, support any load.weight always runnable
1266 /* rq on which this entity is (to be) queued: */
1268 /* rq "owned" by this entity/group: */
1273 /* Per entity load average tracking */
1287 /* rq on which this entity is (to be) queued: */
1289 /* rq "owned" by this entity/group: */
/linux-4.4.14/drivers/gpu/drm/amd/amdgpu/
H A Damdgpu_ctx.c42 /* create context entity for each ring */ amdgpu_ctx_init()
50 &ctx->rings[i].entity, amdgpu_ctx_init()
59 &ctx->rings[j].entity); amdgpu_ctx_init()
82 &ctx->rings[i].entity); amdgpu_ctx_fini()
H A Damdgpu_sched.c86 job->base.s_entity = &adev->kernel_ctx.rings[ring->idx].entity; amdgpu_sched_ib_submit_kernel_helper()
/linux-4.4.14/drivers/gpu/drm/rcar-du/
H A Drcar_du_kms.c571 struct device_node *entity; rcar_du_encoders_init_one() local
575 * Locate the connected entity and infer its type from the number of rcar_du_encoders_init_one()
578 entity = of_graph_get_remote_port_parent(ep->local_node); rcar_du_encoders_init_one()
579 if (!entity) { rcar_du_encoders_init_one()
587 for_each_endpoint_of_node(entity, ep_node) { for_each_endpoint_of_node()
595 encoder = entity; for_each_endpoint_of_node()
638 * If no encoder has been found the entity must be the
641 connector = entity;
/linux-4.4.14/arch/parisc/include/asm/
H A Dpdc_chassis.h168 * Caller subactivity, Reporting entity type, Reporting entity ID,
229 /* Reporting entity type */
235 /* Reporting entity ID */
H A Dpdcpat.h41 /* PDC_PAT_CELL_MODULE entity type values */
238 * Bit 0 to 7 - entity type
/linux-4.4.14/arch/arm/mach-omap2/
H A Dprcm_mpu54xx.h49 * point of view the PRCM_MPU is a single entity. It shares the same
H A Dprcm_mpu44xx.h50 * point of view the PRCM_MPU is a single entity. It shares the same
/linux-4.4.14/drivers/tty/
H A Dn_tracerouter.c63 * n_tracerouter_open() - Called when a tty is opened by a SW entity.
69 * Caveats: This should only be opened one time per SW entity.
97 * Called when a software entity wants to close a connection.
H A Dn_tracesink.c61 * n_tracesink_open() - Called when a tty is opened by a SW entity.
72 * SW entity calls it.
98 * Called when a software entity wants to close a connection.
/linux-4.4.14/drivers/media/i2c/
H A Ds5k6a3.c336 ret = media_entity_init(&sd->entity, 1, &sensor->pad, 0); s5k6a3_probe()
347 media_entity_cleanup(&sd->entity); s5k6a3_probe()
359 media_entity_cleanup(&sd->entity); s5k6a3_remove()
H A Dlm3646.c285 rval = media_entity_init(&flash->subdev_led.entity, 0, NULL, 0); lm3646_subdev_init()
288 flash->subdev_led.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_FLASH; lm3646_subdev_init()
388 media_entity_cleanup(&flash->subdev_led.entity); lm3646_remove()
H A Ds5k5baf.c28 #include <media/media-entity.h>
411 return sd->entity.type == MEDIA_ENT_T_V4L2_SUBDEV_SENSOR; s5k5baf_is_cis_subdev()
1759 ret = media_entity_create_link(&state->cis_sd.entity, PAD_CIS, s5k5baf_registered()
1760 &state->sd.entity, PAD_CIS, s5k5baf_registered()
1907 sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR; s5k5baf_configure_subdevs()
1908 ret = media_entity_init(&sd->entity, NUM_CIS_PADS, &state->cis_pad, 0); s5k5baf_configure_subdevs()
1922 sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV; s5k5baf_configure_subdevs()
1923 ret = media_entity_init(&sd->entity, NUM_ISP_PADS, state->pads, 0); s5k5baf_configure_subdevs()
1928 media_entity_cleanup(&state->cis_sd.entity); s5k5baf_configure_subdevs()
1930 dev_err(&c->dev, "cannot init media entity %s\n", sd->name); s5k5baf_configure_subdevs()
2012 media_entity_cleanup(&state->sd.entity); s5k5baf_probe()
2013 media_entity_cleanup(&state->cis_sd.entity); s5k5baf_probe()
2024 media_entity_cleanup(&sd->entity); s5k5baf_remove()
2028 media_entity_cleanup(&sd->entity); s5k5baf_remove()
H A Dadp1653.c515 ret = media_entity_init(&flash->subdev.entity, 0, NULL, 0); adp1653_probe()
519 flash->subdev.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_FLASH; adp1653_probe()
536 media_entity_cleanup(&flash->subdev.entity); adp1653_remove()
H A Dlm3560.c368 rval = media_entity_init(&flash->subdev_led[led_no].entity, 0, NULL, 0); lm3560_subdev_init()
371 flash->subdev_led[led_no].entity.type = MEDIA_ENT_T_V4L2_SUBDEV_FLASH; lm3560_subdev_init()
460 media_entity_cleanup(&flash->subdev_led[i].entity); lm3560_remove()
H A Dmt9m032.c33 #include <media/media-entity.h>
802 ret = media_entity_init(&sensor->subdev.entity, 1, &sensor->pad, 0); mt9m032_probe()
861 media_entity_cleanup(&sensor->subdev.entity); mt9m032_probe()
876 media_entity_cleanup(&subdev->entity); mt9m032_remove()
H A Dov2659.c39 #include <media/media-entity.h>
1448 sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR; ov2659_probe()
1449 ret = media_entity_init(&sd->entity, 1, &ov2659->pad, 0); ov2659_probe()
1480 media_entity_cleanup(&sd->entity); ov2659_probe()
1494 media_entity_cleanup(&sd->entity); ov2659_remove()
H A Ds5k4ecgx.c29 #include <media/media-entity.h>
964 sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR; s5k4ecgx_probe()
965 ret = media_entity_init(&sd->entity, 1, &priv->pad, 0); s5k4ecgx_probe()
995 media_entity_cleanup(&priv->sd.entity); s5k4ecgx_probe()
1009 media_entity_cleanup(&sd->entity); s5k4ecgx_remove()
H A Dtvp514x.c48 #include <media/media-entity.h>
1098 decoder->sd.entity.flags |= MEDIA_ENT_T_V4L2_SUBDEV_DECODER; tvp514x_probe()
1100 ret = media_entity_init(&decoder->sd.entity, 1, &decoder->pad, 0); tvp514x_probe()
1133 media_entity_cleanup(&decoder->sd.entity); tvp514x_probe()
1153 media_entity_cleanup(&decoder->sd.entity); tvp514x_remove()
H A Dmt9t001.c936 ret = media_entity_init(&mt9t001->subdev.entity, 1, &mt9t001->pad, 0); mt9t001_probe()
941 media_entity_cleanup(&mt9t001->subdev.entity); mt9t001_probe()
954 media_entity_cleanup(&subdev->entity); mt9t001_remove()
H A Dnoon010pc30.c782 sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR; noon010_probe()
783 ret = media_entity_init(&sd->entity, 1, &info->pad, 0); noon010_probe()
804 media_entity_cleanup(&sd->entity); noon010_remove()
H A Das3645a.c830 ret = media_entity_init(&flash->subdev.entity, 0, NULL, 0); as3645a_probe()
834 flash->subdev.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_FLASH; as3645a_probe()
854 media_entity_cleanup(&flash->subdev.entity); as3645a_remove()
H A Dtvp7002.c1015 device->sd.entity.flags |= MEDIA_ENT_T_V4L2_SUBDEV_DECODER; tvp7002_probe()
1017 error = media_entity_init(&device->sd.entity, 1, &device->pad, 0); tvp7002_probe()
1041 media_entity_cleanup(&device->sd.entity); tvp7002_probe()
1062 media_entity_cleanup(&device->sd.entity); tvp7002_remove()
H A Dadv7180.c1216 sd->entity.flags |= MEDIA_ENT_T_V4L2_SUBDEV_DECODER; adv7180_probe()
1217 ret = media_entity_init(&sd->entity, 1, &state->pad, 0); adv7180_probe()
1243 media_entity_cleanup(&sd->entity); adv7180_probe()
1266 media_entity_cleanup(&sd->entity); adv7180_remove()
H A Dov9650.c25 #include <media/media-entity.h>
1503 sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR; ov965x_probe()
1504 ret = media_entity_init(&sd->entity, 1, &ov965x->pad, 0); ov965x_probe()
1527 media_entity_cleanup(&sd->entity); ov965x_probe()
1537 media_entity_cleanup(&sd->entity); ov965x_remove()
H A Ds5k6aa.c26 #include <media/media-entity.h>
1580 sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR; s5k6aa_probe()
1581 ret = media_entity_init(&sd->entity, 1, &s5k6aa->pad, 0); s5k6aa_probe()
1613 media_entity_cleanup(&s5k6aa->sd.entity); s5k6aa_probe()
1623 media_entity_cleanup(&sd->entity); s5k6aa_remove()
H A Dmt9p031.c1115 ret = media_entity_init(&mt9p031->subdev.entity, 1, &mt9p031->pad, 0); mt9p031_probe()
1148 media_entity_cleanup(&mt9p031->subdev.entity); mt9p031_probe()
1162 media_entity_cleanup(&subdev->entity); mt9p031_remove()
H A Dmt9v032.c1049 ret = media_entity_init(&mt9v032->subdev.entity, 1, &mt9v032->pad, 0); mt9v032_probe()
1061 media_entity_cleanup(&mt9v032->subdev.entity); mt9v032_probe()
1073 media_entity_cleanup(&subdev->entity); mt9v032_remove()
H A Dad9389b.c1161 err = media_entity_init(&sd->entity, 1, &state->pad, 0); ad9389b_probe()
1201 media_entity_cleanup(&sd->entity); ad9389b_probe()
1226 media_entity_cleanup(&sd->entity); ad9389b_remove()
H A Dtc358743.c1892 err = media_entity_init(&sd->entity, 1, &state->pad, 0); tc358743_probe()
1942 media_entity_cleanup(&sd->entity); tc358743_probe()
1957 media_entity_cleanup(&sd->entity); tc358743_remove()
H A Dadv7511.c1494 err = media_entity_init(&sd->entity, 1, &state->pad, 0); adv7511_probe()
1549 media_entity_cleanup(&sd->entity); adv7511_probe()
1573 media_entity_cleanup(&sd->entity); adv7511_remove()
/linux-4.4.14/kernel/sched/
H A Ddeadline.c334 * - the absolute deadline of the entity has to be placed at
336 * - the runtime of the entity has to be set to the maximum value.
339 * entity wants to (try to!) synchronize its behaviour with the scheduler's
363 * possibility of a entity lasting more than what it declared, and thus
367 * not want a entity which is misbehaving to affect the scheduling of all
370 * is used, in order to confine each entity within its own bandwidth.
373 * of a entity is replenished, its deadline is also postponed. That ensures
374 * the overrunning entity can't interfere with other entity in the system and
376 * could happen are, typically, a entity voluntarily trying to overcome its
398 * available runtime for the entity. This ensures correct replenish_dl_entity()
414 * entity. replenish_dl_entity()
429 * Here we check if --at time t-- an entity (which is probably being
483 * When a -deadline entity is queued back on the runqueue, its runtime and
486 * The policy here is that we update the deadline of the entity only if:
489 * the entity exceed its bandwidth.
514 * If the entity depleted all its runtime, and if we want it to sleep
H A Dsched.h122 * Tells if entity @a should preempt entity @b.
282 * are queued on this cfs_rq, so a weight of a entity should not be
361 * 'curr' points to currently running entity on this cfs_rq.
402 * leaf cfs_rqs are those that hold tasks (lowest schedulable entity in
928 /* Change a task's cfs_rq and parent entity if it moves across CPUs/groups */ set_task_rq()
/linux-4.4.14/drivers/media/i2c/s5c73m3/
H A Ds5c73m3-core.c32 #include <media/media-entity.h>
1485 ret = media_entity_create_link(&state->sensor_sd.entity, s5c73m3_oif_registered()
1486 S5C73M3_ISP_PAD, &state->oif_sd.entity, OIF_ISP_PAD, s5c73m3_oif_registered()
1489 ret = media_entity_create_link(&state->sensor_sd.entity, s5c73m3_oif_registered()
1490 S5C73M3_JPEG_PAD, &state->oif_sd.entity, OIF_JPEG_PAD, s5c73m3_oif_registered()
1691 sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV; s5c73m3_probe()
1693 ret = media_entity_init(&sd->entity, S5C73M3_NUM_PADS, s5c73m3_probe()
1707 oif_sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV; s5c73m3_probe()
1709 ret = media_entity_init(&oif_sd->entity, OIF_NUM_PADS, s5c73m3_probe()
1772 media_entity_cleanup(&sd->entity); s5c73m3_probe()
1785 media_entity_cleanup(&oif_sd->entity); s5c73m3_remove()
1788 media_entity_cleanup(&sensor_sd->entity); s5c73m3_remove()
H A Ds5c73m3-ctrls.c30 #include <media/media-entity.h>
/linux-4.4.14/drivers/media/platform/s3c-camif/
H A Dcamif-core.c266 ret = media_entity_create_link(&camif->sensor.sd->entity, 0, camif_create_media_links()
267 &camif->subdev.entity, CAMIF_SD_PAD_SINK, camif_create_media_links()
274 ret = media_entity_create_link(&camif->subdev.entity, i, camif_create_media_links()
275 &camif->vp[i - 1].vdev.entity, 0, camif_create_media_links()
H A Dcamif-capture.c836 if (!pad || media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) camif_pipeline_validate()
858 struct media_entity *sensor = &camif->sensor.sd->entity; s3c_camif_streamon()
902 media_entity_pipeline_stop(&camif->sensor.sd->entity); s3c_camif_streamoff()
1158 ret = media_entity_init(&vfd->entity, 1, &vp->pad, 0); s3c_camif_register_video_node()
1191 media_entity_cleanup(&vfd->entity); s3c_camif_register_video_node()
1203 media_entity_cleanup(&vfd->entity); s3c_camif_unregister_video_node()
1573 ret = media_entity_init(&sd->entity, CAMIF_SD_PADS_NUM, s3c_camif_create_subdev()
1597 media_entity_cleanup(&sd->entity); s3c_camif_create_subdev()
1620 media_entity_cleanup(&sd->entity); s3c_camif_unregister_subdev()
H A Dcamif-core.h23 #include <media/media-entity.h>
253 * @m_pipeline: video entity pipeline description
/linux-4.4.14/arch/mips/include/asm/
H A Dtimex.h33 * Only the low 32 bits are available as a continuously counting entity.
/linux-4.4.14/include/net/irda/
H A Dirttp.h117 int remote_credit; /* Credit held by peer TTP entity */
118 int send_credit; /* Credit held by local TTP entity */
/linux-4.4.14/drivers/usb/gadget/function/
H A Df_fs.c1704 typedef int (*ffs_entity_callback)(enum ffs_entity_type entity,
1709 typedef int (*ffs_os_desc_callback)(enum ffs_os_desc_type entity,
1714 ffs_entity_callback entity, ffs_do_single_desc()
1740 pr_vdebug("entity " #type "(%02x)\n", (val)); \ ffs_do_single_desc()
1742 pr_vdebug("invalid entity's value\n"); \ ffs_do_single_desc()
1745 ret = entity(FFS_ ##type, &val, _ds, priv); \ ffs_do_single_desc()
1747 pr_debug("entity " #type "(%02x); ret = %d\n", \ ffs_do_single_desc()
1843 ffs_entity_callback entity, void *priv) ffs_do_descs()
1856 /* Record "descriptor" entity */ ffs_do_descs()
1857 ret = entity(FFS_DESCRIPTOR, (u8 *)num, (void *)data, priv); ffs_do_descs()
1859 pr_debug("entity DESCRIPTOR(%02lx); ret = %d\n", ffs_do_descs()
1867 ret = ffs_do_single_desc(data, len, entity, priv); ffs_do_descs()
1962 ffs_os_desc_callback entity, ffs_do_single_os_desc()
1973 ret = entity(type, h, data, len, priv); ffs_do_single_os_desc()
1987 ffs_os_desc_callback entity, void *priv) ffs_do_os_descs()
2004 * Record "descriptor" entity. ffs_do_os_descs()
2015 pr_debug("entity OS_DESCRIPTOR(%02lx); ret = %d\n", ffs_do_os_descs()
2034 feature_count, entity, priv, desc); ffs_do_os_descs()
1713 ffs_do_single_desc(char *data, unsigned len, ffs_entity_callback entity, void *priv) ffs_do_single_desc() argument
1842 ffs_do_descs(unsigned count, char *data, unsigned len, ffs_entity_callback entity, void *priv) ffs_do_descs() argument
1959 ffs_do_single_os_desc(char *data, unsigned len, enum ffs_os_desc_type type, u16 feature_count, ffs_os_desc_callback entity, void *priv, struct usb_os_desc_header *h) ffs_do_single_os_desc() argument
1985 ffs_do_os_descs(unsigned count, char *data, unsigned len, ffs_os_desc_callback entity, void *priv) ffs_do_os_descs() argument
H A Df_uac1.c396 DBG(cdev, "bRequest 0x%x, w_value 0x%04x, len %d, entity %d\n", audio_set_intf_req()
433 DBG(cdev, "bRequest 0x%x, w_value 0x%04x, len %d, entity %d\n", audio_get_intf_req()
/linux-4.4.14/drivers/media/usb/cx231xx/
H A Dcx231xx-cards.c1244 struct media_entity *entity; cx231xx_create_media_graph() local
1250 media_device_for_each_entity(entity, mdev) { media_device_for_each_entity()
1251 switch (entity->type) { media_device_for_each_entity()
1253 tuner = entity; media_device_for_each_entity()
1256 decoder = entity; media_device_for_each_entity()
1269 media_entity_create_link(decoder, 1, &dev->vdev.entity, 0,
1271 media_entity_create_link(decoder, 2, &dev->vbi_dev.entity, 0,
H A Dcx231xx-video.c107 struct media_entity *entity, *decoder = NULL, *source; cx231xx_enable_analog_tuner() local
121 media_device_for_each_entity(entity, mdev) { media_device_for_each_entity()
122 if (entity->type == MEDIA_ENT_T_V4L2_SUBDEV_DECODER) { media_device_for_each_entity()
123 decoder = entity; media_device_for_each_entity()
132 if (link->sink->entity == decoder) {
143 source = found_link->source->entity;
149 sink = link->sink->entity;
151 if (sink == entity)
2179 ret = media_entity_init(&dev->vdev.entity, 1, &dev->video_pad, 0); cx231xx_register_analog_devices()
2181 dev_err(dev->dev, "failed to initialize video media entity!\n"); cx231xx_register_analog_devices()
2206 ret = media_entity_init(&dev->vbi_dev.entity, 1, &dev->vbi_pad, 0); cx231xx_register_analog_devices()
2208 dev_err(dev->dev, "failed to initialize vbi media entity!\n"); cx231xx_register_analog_devices()
/linux-4.4.14/drivers/hwtracing/coresight/
H A Dcoresight-etm4x.h185 * @dev: The device entity associated to this component.
194 * @nr_pe: The number of processing entity available for tracing.
195 * @nr_pe_cmp: The number of processing entity comparator inputs that are
H A Dcoresight-replicator-qcom.c35 * @dev: the device entity associated with this component
H A Dcoresight-replicator.c29 * @dev: the device entity associated with this component
H A Dcoresight-tpiu.c53 * @dev: the device entity associated to this component.
H A Dcoresight-etm.h142 * @dev: the device entity associated to this component.
H A Dcoresight-funnel.c38 * @dev: the device entity associated to this component.
/linux-4.4.14/include/acpi/
H A Dacexcep.h233 EXCEP_TXT("AE_NOT_FOUND", "A requested entity is not found"),
234 EXCEP_TXT("AE_NOT_EXIST", "A required entity does not exist"),
235 EXCEP_TXT("AE_ALREADY_EXISTS", "An entity already exists"),
/linux-4.4.14/drivers/staging/rdma/hfi1/
H A Dplatform_config.h225 * to be supplied to the driver by another entity such as
/linux-4.4.14/drivers/md/persistent-data/
H A Ddm-btree.h138 * subtrees represent a separate entity, like a snapshot map, so this is
/linux-4.4.14/fs/sysfs/
H A Ddir.c83 * symlinking entity usually doesn't own @kobj and thus has no sysfs_remove_dir()
/linux-4.4.14/include/linux/ceph/
H A Dauth.h87 const char *name; /* entity name */
/linux-4.4.14/drivers/base/
H A Dtransport_class.c132 * @dev: the generic device representing the entity being added
169 * @dev: the generic device representing the entity being added
/linux-4.4.14/drivers/isdn/hisax/
H A Dtei.c338 /* wrong management entity identifier, ignore */ tei_l1l2()
340 "tei handler wrong entity id %x", tei_l1l2()
/linux-4.4.14/drivers/media/platform/sti/bdisp/
H A Dbdisp.h167 * struct bdisp_dev - abstraction for bdisp entity
H A Dbdisp-hw.c55 * @bdisp: bdisp entity
90 * @bdisp: bdisp entity
/linux-4.4.14/drivers/media/i2c/m5mols/
H A Dm5mols_core.c978 ret = media_entity_init(&sd->entity, 1, &info->pad, 0); m5mols_probe()
981 sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR; m5mols_probe()
1008 media_entity_cleanup(&sd->entity); m5mols_probe()
1018 media_entity_cleanup(&sd->entity); m5mols_remove()
/linux-4.4.14/drivers/net/wireless/ti/wlcore/
H A Dps.c132 * the completion variable in one entity. wl1271_ps_elp_wakeup()
/linux-4.4.14/drivers/char/agp/
H A Dbackend.c88 * is read for use by another entity.
/linux-4.4.14/net/core/
H A Dutils.c2 * Generic address resultion entity
/linux-4.4.14/fs/ceph/
H A Ddebugfs.c169 /* The 'num' portion of an 'entity name' */ mds_sessions_show()
/linux-4.4.14/arch/sparc/include/asm/
H A Dspitfire.h28 /* These registers only exist as one entity, and are accessed
/linux-4.4.14/arch/arm/common/
H A Dscoop.c26 single entity for the pxa2xx_pcmcia device so this structure
/linux-4.4.14/drivers/media/i2c/smiapp/
H A Dsmiapp-core.c1662 for (i = 0; i < subdev->entity.num_pads; i++) smiapp_get_crop_compose()
1668 for (i = 0; i < subdev->entity.num_pads; i++) { smiapp_get_crop_compose()
2490 rval = media_entity_init(&this->sd.entity, smiapp_register_subdevs()
2498 rval = media_entity_create_link(&this->sd.entity, smiapp_register_subdevs()
2500 &last->sd.entity, smiapp_register_subdevs()
2749 this->sd.entity.ops = &smiapp_entity_ops; smiapp_init()
2766 sensor->pixel_array->sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR; smiapp_init()
3080 rval = media_entity_init(&sensor->src->sd.entity, 2, smiapp_probe()
3098 media_entity_cleanup(&sensor->src->sd.entity); smiapp_probe()
3123 media_entity_cleanup(&sensor->ssds[i].sd.entity); smiapp_remove()
/linux-4.4.14/drivers/uwb/
H A Dneh.c95 * Represents an entity waiting for an event coming from the UWB Radio
539 * The entity that reads from the device notification/event channel has
/linux-4.4.14/drivers/hwmon/
H A Dfschmd.c1013 /* entity 1 - 3: voltage multiplier and offset */ fschmd_dmi_decode()
1019 /* Check for twice the same entity */ fschmd_dmi_decode()
1029 /* entity 7: reference voltage */ fschmd_dmi_decode()
1031 /* Check for twice the same entity */ fschmd_dmi_decode()
/linux-4.4.14/drivers/net/ethernet/intel/fm10k/
H A Dfm10k_mbx.h87 * entity and the remote. It will fall back to connect in the event of
/linux-4.4.14/drivers/gpu/drm/
H A Ddrm_bridge.c35 * when a regular drm_encoder entity isn't enough to represent the entire
/linux-4.4.14/drivers/acpi/acpica/
H A Dexresolv.c88 * The entity pointed to by the stack_ptr can be either acpi_ex_resolve_to_value()
/linux-4.4.14/include/uapi/scsi/fc/
H A Dfc_fs.h325 FC_RJT_FAB_CLASS = 0x15, /* class unsupported by fabric entity */
/linux-4.4.14/sound/usb/
H A Dclock.c204 /* the entity ID we are looking for is a selector. __uac_clock_find_source()
/linux-4.4.14/drivers/scsi/lpfc/
H A Dlpfc_disc.h86 #define NLP_FABRIC 0x4 /* entry rep a Fabric entity */
/linux-4.4.14/drivers/scsi/
H A D3w-xxxx.h104 {0x10, 0x0b, 0x14, 0x00}, // ID not found Recorded entity not found

Completed in 4473 milliseconds

12