Lines Matching defs:entity
135 struct uvc_entity *entity;
137 list_for_each_entry(entity, &dev->entities, list) {
138 if (entity->id == id)
139 return entity;
146 int id, struct uvc_entity *entity)
150 if (entity == NULL)
151 entity = list_entry(&dev->entities, struct uvc_entity, list);
153 list_for_each_entry_continue(entity, &dev->entities, list) {
154 for (i = 0; i < entity->bNrInPins; ++i)
155 if (entity->baSourceID[i] == id)
156 return entity;
770 struct uvc_entity *entity;
775 extra_size = roundup(extra_size, sizeof(*entity->pads));
780 size = sizeof(*entity) + extra_size + sizeof(*entity->pads) * num_pads
782 entity = kzalloc(size, GFP_KERNEL);
783 if (entity == NULL)
786 entity->id = id;
787 entity->type = type;
790 * Set the GUID for standard entity types. For extension units, the GUID
795 memcpy(entity->guid, uvc_gpio_guid, 16);
798 memcpy(entity->guid, uvc_camera_guid, 16);
801 memcpy(entity->guid, uvc_media_transport_input_guid, 16);
804 memcpy(entity->guid, uvc_processing_guid, 16);
808 entity->num_links = 0;
809 entity->num_pads = num_pads;
810 entity->pads = ((void *)(entity + 1)) + extra_size;
813 entity->pads[i].flags = MEDIA_PAD_FL_SINK;
814 if (!UVC_ENTITY_IS_OTERM(entity) && num_pads)
815 entity->pads[num_pads-1].flags = MEDIA_PAD_FL_SOURCE;
817 entity->bNrInPins = num_inputs;
818 entity->baSourceID = (u8 *)(&entity->pads[num_pads]);
820 return entity;
823 static void uvc_entity_set_name(struct uvc_device *dev, struct uvc_entity *entity,
829 * First attempt to read the entity name from the device. If the entity
832 * the entity type.
835 ret = usb_string(dev->udev, string_id, entity->name,
836 sizeof(entity->name));
841 sprintf(entity->name, "%s %u", type_name, entity->id);
1237 static int uvc_gpio_get_cur(struct uvc_device *dev, struct uvc_entity *entity,
1243 *(u8 *)data = gpiod_get_value_cansleep(entity->gpio.gpio_privacy);
1248 static int uvc_gpio_get_info(struct uvc_device *dev, struct uvc_entity *entity,
1347 struct uvc_entity *entity)
1349 switch (UVC_ENTITY_TYPE(entity)) {
1351 uvc_dbg_cont(PROBE, " <- XU %d", entity->id);
1353 if (entity->bNrInPins != 1) {
1356 entity->id);
1363 uvc_dbg_cont(PROBE, " <- PU %d", entity->id);
1371 chain->processing = entity;
1375 uvc_dbg_cont(PROBE, " <- SU %d", entity->id);
1378 if (entity->bNrInPins == 1)
1387 chain->selector = entity;
1393 uvc_dbg_cont(PROBE, " <- IT %d\n", entity->id);
1400 uvc_dbg_cont(PROBE, " OT %d", entity->id);
1405 if (UVC_ENTITY_IS_ITERM(entity))
1406 uvc_dbg_cont(PROBE, " <- IT %d\n", entity->id);
1408 uvc_dbg_cont(PROBE, " OT %d", entity->id);
1414 "Unsupported entity type 0x%04x found in chain\n",
1415 UVC_ENTITY_TYPE(entity));
1419 list_add_tail(&entity->chain, &chain->entities);
1424 struct uvc_entity *entity, struct uvc_entity *prev)
1434 forward = uvc_entity_by_reference(chain->dev, entity->id,
1442 "Found reference to entity %d already in chain\n",
1460 * can't be connected to any entity in the forward
1466 if (UVC_ENTITY_IS_OTERM(entity)) {
1470 entity->baSourceID[0]);
1500 if (UVC_ENTITY_IS_OTERM(entity)) {
1503 entity->id, forward->id);
1525 struct uvc_entity *entity = *_entity;
1529 switch (UVC_ENTITY_TYPE(entity)) {
1532 id = entity->baSourceID[0];
1537 if (entity->bNrInPins == 1) {
1538 id = entity->baSourceID[0];
1544 chain->selector = entity;
1545 for (i = 0; i < entity->bNrInPins; ++i) {
1546 id = entity->baSourceID[i];
1551 entity->id, i);
1557 "Found reference to entity %d already in chain\n",
1565 uvc_scan_chain_forward(chain, term, entity);
1580 id = UVC_ENTITY_IS_OTERM(entity) ? entity->baSourceID[0] : 0;
1589 entity = uvc_entity_by_id(chain->dev, id);
1590 if (entity == NULL) {
1592 "Found reference to unknown entity %d\n", id);
1596 *_entity = entity;
1603 struct uvc_entity *entity, *prev;
1607 entity = term;
1610 while (entity != NULL) {
1612 if (entity->chain.next || entity->chain.prev) {
1614 "Found reference to entity %d already in chain\n",
1615 entity->id);
1619 /* Process entity */
1620 if (uvc_scan_chain_entity(chain, entity) < 0)
1624 if (uvc_scan_chain_forward(chain, entity, prev) < 0)
1628 prev = entity;
1629 if (uvc_scan_chain_backward(chain, &entity) < 0)
1706 struct uvc_entity *entity;
1713 list_for_each_entry(entity, &dev->entities, list) {
1714 if (UVC_ENTITY_IS_ITERM(entity)) {
1717 iterm = entity;
1720 if (UVC_ENTITY_IS_OTERM(entity)) {
1723 oterm = entity;
1747 list_for_each_entry_reverse(entity, &dev->entities, list) {
1748 if (entity->type != UVC_VC_PROCESSING_UNIT &&
1749 entity->type != UVC_VC_EXTENSION_UNIT)
1752 if (entity->num_pads != 2)
1755 if (uvc_scan_chain_entity(chain, entity) < 0)
1758 prev->baSourceID[0] = entity->id;
1759 prev = entity;
1827 /* Add GPIO entity to the first chain. */
1874 struct uvc_entity *entity;
1876 entity = list_entry(p, struct uvc_entity, list);
1878 uvc_mc_cleanup_entity(entity);
1880 kfree(entity);