Skip to content

Commit

Permalink
media: uvcvideo: Allow extra entities
Browse files Browse the repository at this point in the history
Increase the size of the id, to avoid collisions with entities
implemented by the driver that are not part of the UVC device.

Entities exposed by the UVC device use IDs 0-255, extra entities
implemented by the driver (such as the GPIO entity) use IDs 256 and
up.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  • Loading branch information
Ricardo Ribalda authored and Mauro Carvalho Chehab committed Jan 27, 2021
1 parent 351509c commit cae79e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/media/usb/uvc/uvc_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ static const u8 uvc_media_transport_input_guid[16] =
UVC_GUID_UVC_MEDIA_TRANSPORT_INPUT;
static const u8 uvc_processing_guid[16] = UVC_GUID_UVC_PROCESSING;

static struct uvc_entity *uvc_alloc_entity(u16 type, u8 id,
static struct uvc_entity *uvc_alloc_entity(u16 type, u16 id,
unsigned int num_pads, unsigned int extra_size)
{
struct uvc_entity *entity;
Expand Down
7 changes: 6 additions & 1 deletion drivers/media/usb/uvc/uvcvideo.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,12 @@ struct uvc_entity {
* chain. */
unsigned int flags;

u8 id;
/*
* Entities exposed by the UVC device use IDs 0-255, extra entities
* implemented by the driver (such as the GPIO entity) use IDs 256 and
* up.
*/
u16 id;
u16 type;
char name[64];
u8 guid[16];
Expand Down

0 comments on commit cae79e5

Please sign in to comment.