Lines Matching refs:entity

136 	struct uvc_entity *entity;
138 list_for_each_entry(entity, &dev->entities, list) {
139 if (entity->id == id)
140 return entity;
147 int id, struct uvc_entity *entity)
151 if (entity == NULL)
152 entity = list_entry(&dev->entities, struct uvc_entity, list);
154 list_for_each_entry_continue(entity, &dev->entities, list) {
155 for (i = 0; i < entity->bNrInPins; ++i)
156 if (entity->baSourceID[i] == id)
157 return entity;
771 struct uvc_entity *entity;
776 extra_size = roundup(extra_size, sizeof(*entity->pads));
781 size = sizeof(*entity) + extra_size + sizeof(*entity->pads) * num_pads
783 entity = kzalloc(size, GFP_KERNEL);
784 if (entity == NULL)
787 entity->id = id;
788 entity->type = type;
791 * Set the GUID for standard entity types. For extension units, the GUID
796 memcpy(entity->guid, uvc_gpio_guid, 16);
799 memcpy(entity->guid, uvc_camera_guid, 16);
802 memcpy(entity->guid, uvc_media_transport_input_guid, 16);
805 memcpy(entity->guid, uvc_processing_guid, 16);
809 entity->num_links = 0;
810 entity->num_pads = num_pads;
811 entity->pads = ((void *)(entity + 1)) + extra_size;
814 entity->pads[i].flags = MEDIA_PAD_FL_SINK;
815 if (!UVC_ENTITY_IS_OTERM(entity) && num_pads)
816 entity->pads[num_pads-1].flags = MEDIA_PAD_FL_SOURCE;
818 entity->bNrInPins = num_inputs;
819 entity->baSourceID = (u8 *)(&entity->pads[num_pads]);
821 return entity;
824 static void uvc_entity_set_name(struct uvc_device *dev, struct uvc_entity *entity,
830 * First attempt to read the entity name from the device. If the entity
833 * the entity type.
836 ret = usb_string(dev->udev, string_id, entity->name,
837 sizeof(entity->name));
842 sprintf(entity->name, "%s %u", type_name, entity->id);
1238 static int uvc_gpio_get_cur(struct uvc_device *dev, struct uvc_entity *entity,
1244 *(u8 *)data = gpiod_get_value_cansleep(entity->gpio.gpio_privacy);
1249 static int uvc_gpio_get_info(struct uvc_device *dev, struct uvc_entity *entity,
1348 struct uvc_entity *entity)
1350 switch (UVC_ENTITY_TYPE(entity)) {
1352 uvc_dbg_cont(PROBE, " <- XU %d", entity->id);
1354 if (entity->bNrInPins != 1) {
1357 entity->id);
1364 uvc_dbg_cont(PROBE, " <- PU %d", entity->id);
1372 chain->processing = entity;
1376 uvc_dbg_cont(PROBE, " <- SU %d", entity->id);
1379 if (entity->bNrInPins == 1)
1388 chain->selector = entity;
1394 uvc_dbg_cont(PROBE, " <- IT %d\n", entity->id);
1401 uvc_dbg_cont(PROBE, " OT %d", entity->id);
1406 if (UVC_ENTITY_IS_ITERM(entity))
1407 uvc_dbg_cont(PROBE, " <- IT %d\n", entity->id);
1409 uvc_dbg_cont(PROBE, " OT %d", entity->id);
1415 "Unsupported entity type 0x%04x found in chain\n",
1416 UVC_ENTITY_TYPE(entity));
1420 list_add_tail(&entity->chain, &chain->entities);
1425 struct uvc_entity *entity, struct uvc_entity *prev)
1435 forward = uvc_entity_by_reference(chain->dev, entity->id,
1443 "Found reference to entity %d already in chain\n",
1461 * can't be connected to any entity in the forward
1467 if (UVC_ENTITY_IS_OTERM(entity)) {
1471 entity->baSourceID[0]);
1501 if (UVC_ENTITY_IS_OTERM(entity)) {
1504 entity->id, forward->id);
1526 struct uvc_entity *entity = *_entity;
1530 switch (UVC_ENTITY_TYPE(entity)) {
1533 id = entity->baSourceID[0];
1538 if (entity->bNrInPins == 1) {
1539 id = entity->baSourceID[0];
1545 chain->selector = entity;
1546 for (i = 0; i < entity->bNrInPins; ++i) {
1547 id = entity->baSourceID[i];
1552 entity->id, i);
1558 "Found reference to entity %d already in chain\n",
1566 uvc_scan_chain_forward(chain, term, entity);
1581 id = UVC_ENTITY_IS_OTERM(entity) ? entity->baSourceID[0] : 0;
1590 entity = uvc_entity_by_id(chain->dev, id);
1591 if (entity == NULL) {
1593 "Found reference to unknown entity %d\n", id);
1597 *_entity = entity;
1604 struct uvc_entity *entity, *prev;
1608 entity = term;
1611 while (entity != NULL) {
1613 if (entity->chain.next || entity->chain.prev) {
1615 "Found reference to entity %d already in chain\n",
1616 entity->id);
1620 /* Process entity */
1621 if (uvc_scan_chain_entity(chain, entity) < 0)
1625 if (uvc_scan_chain_forward(chain, entity, prev) < 0)
1629 prev = entity;
1630 if (uvc_scan_chain_backward(chain, &entity) < 0)
1707 struct uvc_entity *entity;
1714 list_for_each_entry(entity, &dev->entities, list) {
1715 if (UVC_ENTITY_IS_ITERM(entity)) {
1718 iterm = entity;
1721 if (UVC_ENTITY_IS_OTERM(entity)) {
1724 oterm = entity;
1748 list_for_each_entry_reverse(entity, &dev->entities, list) {
1749 if (entity->type != UVC_VC_PROCESSING_UNIT &&
1750 entity->type != UVC_VC_EXTENSION_UNIT)
1753 if (entity->num_pads != 2)
1756 if (uvc_scan_chain_entity(chain, entity) < 0)
1759 prev->baSourceID[0] = entity->id;
1760 prev = entity;
1828 /* Add GPIO entity to the first chain. */
1875 struct uvc_entity *entity;
1877 entity = list_entry(p, struct uvc_entity, list);
1879 uvc_mc_cleanup_entity(entity);
1881 kfree(entity);