[PATCH v5 5/5] media: uvcvideo: Remove UVC_EXT_GPIO entity

From: Ricardo Ribalda
Date: Fri Jul 18 2025 - 11:36:52 EST


The only implementation of this entity was the external privacy gpio,
which now does not require to emulate an entity.
Remove all the dead code.

Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
---
drivers/media/usb/uvc/uvc_driver.c | 4 ----
drivers/media/usb/uvc/uvc_entity.c | 1 -
drivers/media/usb/uvc/uvcvideo.h | 20 +++++++-------------
include/linux/usb/uvc.h | 3 ---
4 files changed, 7 insertions(+), 21 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index b79d276732bc80ef175ffdbaa73b6395585ff07b..d19b5a200971654161267dc755aec2a06b5fdc9e 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -789,7 +789,6 @@ static int uvc_parse_streaming(struct uvc_device *dev,
}

static const u8 uvc_camera_guid[16] = UVC_GUID_UVC_CAMERA;
-static const u8 uvc_gpio_guid[16] = UVC_GUID_EXT_GPIO_CONTROLLER;
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;
@@ -821,9 +820,6 @@ struct uvc_entity *uvc_alloc_entity(u16 type, u16 id, unsigned int num_pads,
* is initialized by the caller.
*/
switch (type) {
- case UVC_EXT_GPIO_UNIT:
- memcpy(entity->guid, uvc_gpio_guid, 16);
- break;
case UVC_ITT_CAMERA:
memcpy(entity->guid, uvc_camera_guid, 16);
break;
diff --git a/drivers/media/usb/uvc/uvc_entity.c b/drivers/media/usb/uvc/uvc_entity.c
index cc68dd24eb42dce5b2846ca52a8dfa499c8aed96..94e0119746e4689a45960955a35be93a25bc16c4 100644
--- a/drivers/media/usb/uvc/uvc_entity.c
+++ b/drivers/media/usb/uvc/uvc_entity.c
@@ -105,7 +105,6 @@ static int uvc_mc_init_entity(struct uvc_video_chain *chain,
case UVC_OTT_DISPLAY:
case UVC_OTT_MEDIA_TRANSPORT_OUTPUT:
case UVC_EXTERNAL_VENDOR_SPECIFIC:
- case UVC_EXT_GPIO_UNIT:
default:
function = MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN;
break;
diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
index c098f30b07797281576d7ff533cde25309be8b61..b4eaca187d61b2e9f8a4af6ac6ac071145b48df2 100644
--- a/drivers/media/usb/uvc/uvcvideo.h
+++ b/drivers/media/usb/uvc/uvcvideo.h
@@ -39,9 +39,6 @@
(UVC_ENTITY_IS_TERM(entity) && \
((entity)->type & 0x8000) == UVC_TERM_OUTPUT)

-#define UVC_EXT_GPIO_UNIT 0x7ffe
-#define UVC_EXT_GPIO_UNIT_ID 0x100
-
/* ------------------------------------------------------------------------
* Driver specific constants.
*/
@@ -189,8 +186,7 @@ struct uvc_entity {

/*
* 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.
+ * implemented by the driver use IDs 256 and up.
*/
u16 id;
u16 type;
@@ -239,13 +235,6 @@ struct uvc_entity {
u8 *bmControls;
u8 *bmControlsType;
} extension;
-
- struct uvc_gpio {
- int irq;
- bool initialized;
- bool gpio_ready;
- struct gpio_desc *gpio_privacy;
- } gpio;
};

u8 bNrInPins;
@@ -628,7 +617,12 @@ struct uvc_device {
const void *data;
} async_ctrl;

- struct uvc_gpio gpio_unit;
+ struct uvc_gpio {
+ int irq;
+ bool initialized;
+ bool gpio_ready;
+ struct gpio_desc *gpio_privacy;
+ } gpio_unit;
};

struct uvc_fh {
diff --git a/include/linux/usb/uvc.h b/include/linux/usb/uvc.h
index ee19e9f915b8370c333c426dc1ee4202c7b75c5b..6858675ce70dc0a872edd47531682bc415f83bd9 100644
--- a/include/linux/usb/uvc.h
+++ b/include/linux/usb/uvc.h
@@ -26,9 +26,6 @@
#define UVC_GUID_UVC_SELECTOR \
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02}
-#define UVC_GUID_EXT_GPIO_CONTROLLER \
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03}
#define UVC_GUID_MSXU_1_5 \
{0xdc, 0x95, 0x3f, 0x0f, 0x32, 0x26, 0x4e, 0x4c, \
0x92, 0xc9, 0xa0, 0x47, 0x82, 0xf4, 0x3b, 0xc8}

--
2.50.0.727.gbf7dc18ff4-goog