Skip to contentSkip to conversation

add a device in uvc_driver

PATCH In review amilsananak 2 participants 2 messages Nov 20, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 add a device in uvc_driver

From: amilsanan <[email protected]>

---
 drivers/media/usb/uvc/uvc_driver.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/media/usb/uvc/uvc_driver.c +9 -0
index f0febdc08..1a3229ab6 100644
@@ -2441,6 +2441,15 @@ static const struct usb_device_id uvc_ids[] = {
 	  .driver_info		= (kernel_ulong_t)&(const struct uvc_device_info){
 		.uvc_version = 0x010a,
 	  } },
+	  { .match_flags 	= USB_DEVICE_ID_MATCH_DEVICE
+			| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor = 0x0408,
+	  .idProduct = 0x4033,
+	  .bInterfaceClass = USB_CLASS_VIDEO,
+	  .bInterfaceSubClass = 1,
+	  .bInterfaceProtocol =	UVC_PC_PROTOCOL_15,
+	  .driver_info = (kernel_ulong_t) &(const struct uvc_device_info ) 
+		{.uvc_version = 0x010a, } },
 	/* LogiLink Wireless Webcam */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
 				| USB_DEVICE_ID_MATCH_INT_INFO,
Signature · 1 line
2.43.0
#1 lore raw

Hi amilsananak,

add the necessary information in the commit message.

Look at this example, which is also adding support for a webcam

commit 53c264544dfce30f7741a2b1e78f90d046e5d8ff
media: uvcvideo: Add support for Apple T2-attached FaceTime HD Camera

Adds the requisite device id to support detection of the Apple FaceTime HD webcam exposed over the T2 BCE VHCI interface.

look at the git log to see more examples

$ git log drivers/media/usb/uvc/uvc_driver.c
Quoted 12 lines · amilsananak

From: amilsanan <[email protected]>

---
 drivers/media/usb/uvc/uvc_driver.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/media/usb/uvc/uvc_driver.c +0 -0
index f0febdc08..1a3229ab6 100644

drivers/media/usb/uvc/uvc_driver.c static const struct usb_device_id uvc_ids[] = { · line 2443

Quoted 3 lines
drivers/media/usb/uvc/uvc_driver.c +0 -0
@@ -2441,6 +2441,15 @@ static const struct usb_device_id uvc_ids[] = {
 	  .driver_info		= (kernel_ulong_t)&(const struct uvc_device_info){
 		.uvc_version = 0x010a,
 	  } },

I think you should add a comment containing the name of the camera model you want to add support for. Look at other examples in uvc_ids[]

e.g. look at this comment for a camera also from Quanta

	/* Quanta USB2.0 HD UVC Webcam */
Quoted 15 lines
drivers/media/usb/uvc/uvc_driver.c +9 -0
+	  { .match_flags 	= USB_DEVICE_ID_MATCH_DEVICE
+			| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor = 0x0408,
+	  .idProduct = 0x4033,
+	  .bInterfaceClass = USB_CLASS_VIDEO,
+	  .bInterfaceSubClass = 1,
+	  .bInterfaceProtocol =	UVC_PC_PROTOCOL_15,
+	  .driver_info = (kernel_ulong_t) &(const struct uvc_device_info ) 
+		{.uvc_version = 0x010a, } },
 	/* LogiLink Wireless Webcam */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
 				| USB_DEVICE_ID_MATCH_INT_INFO,
Signature · 1 line
2.43.0

--
Kind Regards
Mehdi Djait