Lines Matching full:entity

138 	struct uvc_entity *entity;  in uvc_entity_by_id()  local
143 list_for_each_entry(entity, &dev->entities, list) { in uvc_entity_by_id()
144 if (entity->id == id) in uvc_entity_by_id()
145 return entity; in uvc_entity_by_id()
152 int id, struct uvc_entity *entity) in uvc_entity_by_reference() argument
156 if (entity == NULL) in uvc_entity_by_reference()
157 entity = list_entry(&dev->entities, struct uvc_entity, list); in uvc_entity_by_reference()
159 list_for_each_entry_continue(entity, &dev->entities, list) { in uvc_entity_by_reference()
160 for (i = 0; i < entity->bNrInPins; ++i) in uvc_entity_by_reference()
161 if (entity->baSourceID[i] == id) in uvc_entity_by_reference()
162 return entity; in uvc_entity_by_reference()
181 * If the streaming entity is referenced by an invalid ID, notify the in uvc_stream_by_id()
182 * user and use heuristics to guess the correct entity. in uvc_stream_by_id()
186 …"UVC non compliance: Invalid USB header. The streaming entity has an invalid ID, guessing the corr… in uvc_stream_by_id()
814 struct uvc_entity *entity; in uvc_alloc_new_entity() local
831 extra_size = roundup(extra_size, sizeof(*entity->pads)); in uvc_alloc_new_entity()
836 size = sizeof(*entity) + extra_size + sizeof(*entity->pads) * num_pads in uvc_alloc_new_entity()
838 entity = kzalloc(size, GFP_KERNEL); in uvc_alloc_new_entity()
839 if (entity == NULL) in uvc_alloc_new_entity()
842 entity->id = id; in uvc_alloc_new_entity()
843 entity->type = type; in uvc_alloc_new_entity()
846 * Set the GUID for standard entity types. For extension units, the GUID in uvc_alloc_new_entity()
851 memcpy(entity->guid, uvc_gpio_guid, 16); in uvc_alloc_new_entity()
854 memcpy(entity->guid, uvc_camera_guid, 16); in uvc_alloc_new_entity()
857 memcpy(entity->guid, uvc_media_transport_input_guid, 16); in uvc_alloc_new_entity()
860 memcpy(entity->guid, uvc_processing_guid, 16); in uvc_alloc_new_entity()
864 entity->num_links = 0; in uvc_alloc_new_entity()
865 entity->num_pads = num_pads; in uvc_alloc_new_entity()
866 entity->pads = ((void *)(entity + 1)) + extra_size; in uvc_alloc_new_entity()
869 entity->pads[i].flags = MEDIA_PAD_FL_SINK; in uvc_alloc_new_entity()
870 if (!UVC_ENTITY_IS_OTERM(entity) && num_pads) in uvc_alloc_new_entity()
871 entity->pads[num_pads-1].flags = MEDIA_PAD_FL_SOURCE; in uvc_alloc_new_entity()
873 entity->bNrInPins = num_inputs; in uvc_alloc_new_entity()
874 entity->baSourceID = (u8 *)(&entity->pads[num_pads]); in uvc_alloc_new_entity()
876 return entity; in uvc_alloc_new_entity()
879 static void uvc_entity_set_name(struct uvc_device *dev, struct uvc_entity *entity, in uvc_entity_set_name() argument
885 * First attempt to read the entity name from the device. If the entity in uvc_entity_set_name()
888 * the entity type. in uvc_entity_set_name()
891 ret = usb_string(dev->udev, string_id, entity->name, in uvc_entity_set_name()
892 sizeof(entity->name)); in uvc_entity_set_name()
897 sprintf(entity->name, "%s %u", type_name, entity->id); in uvc_entity_set_name()
1295 static int uvc_gpio_get_cur(struct uvc_device *dev, struct uvc_entity *entity, in uvc_gpio_get_cur() argument
1301 *(u8 *)data = gpiod_get_value_cansleep(entity->gpio.gpio_privacy); in uvc_gpio_get_cur()
1306 static int uvc_gpio_get_info(struct uvc_device *dev, struct uvc_entity *entity, in uvc_gpio_get_info() argument
1423 struct uvc_entity *entity) in uvc_scan_chain_entity() argument
1425 switch (UVC_ENTITY_TYPE(entity)) { in uvc_scan_chain_entity()
1427 uvc_dbg_cont(PROBE, " <- XU %d", entity->id); in uvc_scan_chain_entity()
1429 if (entity->bNrInPins != 1) { in uvc_scan_chain_entity()
1432 entity->id); in uvc_scan_chain_entity()
1439 uvc_dbg_cont(PROBE, " <- PU %d", entity->id); in uvc_scan_chain_entity()
1447 chain->processing = entity; in uvc_scan_chain_entity()
1451 uvc_dbg_cont(PROBE, " <- SU %d", entity->id); in uvc_scan_chain_entity()
1454 if (entity->bNrInPins == 1) in uvc_scan_chain_entity()
1463 chain->selector = entity; in uvc_scan_chain_entity()
1469 uvc_dbg_cont(PROBE, " <- IT %d\n", entity->id); in uvc_scan_chain_entity()
1476 uvc_dbg_cont(PROBE, " OT %d", entity->id); in uvc_scan_chain_entity()
1481 if (UVC_ENTITY_IS_ITERM(entity)) in uvc_scan_chain_entity()
1482 uvc_dbg_cont(PROBE, " <- IT %d\n", entity->id); in uvc_scan_chain_entity()
1484 uvc_dbg_cont(PROBE, " OT %d", entity->id); in uvc_scan_chain_entity()
1490 "Unsupported entity type 0x%04x found in chain\n", in uvc_scan_chain_entity()
1491 UVC_ENTITY_TYPE(entity)); in uvc_scan_chain_entity()
1495 list_add_tail(&entity->chain, &chain->entities); in uvc_scan_chain_entity()
1500 struct uvc_entity *entity, struct uvc_entity *prev) in uvc_scan_chain_forward() argument
1510 forward = uvc_entity_by_reference(chain->dev, entity->id, in uvc_scan_chain_forward()
1518 "Found reference to entity %d already in chain\n", in uvc_scan_chain_forward()
1536 * can't be connected to any entity in the forward in uvc_scan_chain_forward()
1542 if (UVC_ENTITY_IS_OTERM(entity)) { in uvc_scan_chain_forward()
1546 entity->baSourceID[0]); in uvc_scan_chain_forward()
1576 if (UVC_ENTITY_IS_OTERM(entity)) { in uvc_scan_chain_forward()
1579 entity->id, forward->id); in uvc_scan_chain_forward()
1601 struct uvc_entity *entity = *_entity; in uvc_scan_chain_backward() local
1605 switch (UVC_ENTITY_TYPE(entity)) { in uvc_scan_chain_backward()
1608 id = entity->baSourceID[0]; in uvc_scan_chain_backward()
1613 if (entity->bNrInPins == 1) { in uvc_scan_chain_backward()
1614 id = entity->baSourceID[0]; in uvc_scan_chain_backward()
1620 chain->selector = entity; in uvc_scan_chain_backward()
1621 for (i = 0; i < entity->bNrInPins; ++i) { in uvc_scan_chain_backward()
1622 id = entity->baSourceID[i]; in uvc_scan_chain_backward()
1627 entity->id, i); in uvc_scan_chain_backward()
1633 "Found reference to entity %d already in chain\n", in uvc_scan_chain_backward()
1641 uvc_scan_chain_forward(chain, term, entity); in uvc_scan_chain_backward()
1656 id = UVC_ENTITY_IS_OTERM(entity) ? entity->baSourceID[0] : 0; in uvc_scan_chain_backward()
1665 entity = uvc_entity_by_id(chain->dev, id); in uvc_scan_chain_backward()
1666 if (entity == NULL) { in uvc_scan_chain_backward()
1668 "Found reference to unknown entity %d\n", id); in uvc_scan_chain_backward()
1672 *_entity = entity; in uvc_scan_chain_backward()
1679 struct uvc_entity *entity, *prev; in uvc_scan_chain() local
1683 entity = term; in uvc_scan_chain()
1686 while (entity != NULL) { in uvc_scan_chain()
1687 /* Entity must not be part of an existing chain */ in uvc_scan_chain()
1688 if (entity->chain.next || entity->chain.prev) { in uvc_scan_chain()
1690 "Found reference to entity %d already in chain\n", in uvc_scan_chain()
1691 entity->id); in uvc_scan_chain()
1695 /* Process entity */ in uvc_scan_chain()
1696 if (uvc_scan_chain_entity(chain, entity) < 0) in uvc_scan_chain()
1700 if (uvc_scan_chain_forward(chain, entity, prev) < 0) in uvc_scan_chain()
1704 prev = entity; in uvc_scan_chain()
1705 if (uvc_scan_chain_backward(chain, &entity) < 0) in uvc_scan_chain()
1782 struct uvc_entity *entity; in uvc_scan_fallback() local
1789 list_for_each_entry(entity, &dev->entities, list) { in uvc_scan_fallback()
1790 if (UVC_ENTITY_IS_ITERM(entity)) { in uvc_scan_fallback()
1793 iterm = entity; in uvc_scan_fallback()
1796 if (UVC_ENTITY_IS_OTERM(entity)) { in uvc_scan_fallback()
1799 oterm = entity; in uvc_scan_fallback()
1823 list_for_each_entry_reverse(entity, &dev->entities, list) { in uvc_scan_fallback()
1824 if (entity->type != UVC_VC_PROCESSING_UNIT && in uvc_scan_fallback()
1825 entity->type != UVC_VC_EXTENSION_UNIT) in uvc_scan_fallback()
1828 if (entity->num_pads != 2) in uvc_scan_fallback()
1831 if (uvc_scan_chain_entity(chain, entity) < 0) in uvc_scan_fallback()
1834 prev->baSourceID[0] = entity->id; in uvc_scan_fallback()
1835 prev = entity; in uvc_scan_fallback()
1903 /* Add GPIO entity to the first chain. */ in uvc_scan_device()
1950 struct uvc_entity *entity; in uvc_delete() local
1952 entity = list_entry(p, struct uvc_entity, list); in uvc_delete()
1954 uvc_mc_cleanup_entity(entity); in uvc_delete()
1956 kfree(entity); in uvc_delete()