usb/media/quickcam_messenger driver
PATCH 1/1 usb/media/quickcam_messenger driver
Hi Greg KH, USB folk, kernel folk,
Appended is my patch adding a usbvideo driver for the Logitech Quickcam Messenger USB webcam. This patch is against 2.6.16.5.
I had posted previous versions of this at linux-usb-devel and qce-ga:
http://marc.theaimsgroup.com/?l=linux-usb-devel&m=114716527116304&w=2
http://permalink.gmane.org/gmane.linux.drivers.quickcam.devel/1049
Please let me know if it looks okay and if you have any feedback or suggestions.
Thanks,
Jaya Kumar
---
Kconfig | 18 Makefile | 1 quickcam_messenger.c | 1096 +++++++++++++++++++++++++++++++++++++++++++++++++++ quickcam_messenger.h | 87 ++++ 4 files changed, 1202 insertions(+)
---
drivers/usb/media/Kconfig +18 -0
@@ -224,3 +224,21 @@ config USB_PWC To compile this driver as a module, choose M here: the module will be called pwc. + +config USB_QUICKCAM_MESSENGER + tristate "USB Logitech Quickcam Messenger" + depends on USB && VIDEO_DEV + ---help--- + Say Y or M here to enable support for the USB Logitech Quickcam + Messenger webcam. + + The built-in microphone is enabled by selecting USB Audio support. + + This driver uses the Video For Linux API. You must say Y or M to + "Video For Linux" (under Character Devices) to use this driver. + Information on this API and pointers to "v4l" programs may be found + at <file:Documentation/video4linux/API.html>. + + To compile this driver as a module, choose M here: the + module will be called quickcam_messenger. +
drivers/usb/media/Makefile +1 -0
@@ -17,3 +17,4 @@ obj-$(CONFIG_USB_STV680) += stv680.o obj-$(CONFIG_USB_VICAM) += vicam.o usbvideo.o obj-$(CONFIG_USB_W9968CF) += w9968cf.o obj-$(CONFIG_USB_PWC) += pwc/ +obj-$(CONFIG_USB_QUICKCAM_MESSENGER) += quickcam_messenger.o usbvideo.o
drivers/usb/media/quickcam_messenger.c +1096 -0
1,096 lines not on this page · raw message
drivers/usb/media/quickcam_messenger.h +87 -0
87 lines not on this page · raw message
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 1 line · Oliver Neukum
Building this data structure on the stack is a shooting offense.
I completely agree with you (except for the shooting part :-). I'll make the corrections. In my defense, I copied that from the konicawc code.
drivers/usb/media/konicawc.c
921 static int __init konicawc_init(void)
922 {
923 struct usbvideo_cb cbTbl; 924 info(DRIVER_DESC " " DRIVER_VERSION); 925 memset(&cbTbl, 0, sizeof(cbTbl)); 926 cbTbl.probe = konicawc_probe; 927 cbTbl.setupOnOpen = konicawc_setup_on_open; 928 cbTbl.processData = konicawc_process_isoc; 929 cbTbl.getFPS = konicawc_calculate_fps; 930 cbTbl.setVideoMode = konicawc_set_video_mode; 931 cbTbl.startDataPump = konicawc_start_data;
Am Montag, 15. Mai 2006 01:19 schrieb Jaya Kumar:
Quoted 6 lines · Oliver Neukum
Quoted 1 line
Building this data structure on the stack is a shooting offense.
I completely agree with you (except for the shooting part :-). I'll make the corrections. In my defense, I copied that from the konicawc code.
Then you have two drivers to fix.
Regards
Oliver
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 13 lines · Oliver Neukum
Am Sonntag, 14. Mai 2006 16:11 schrieb [email protected]:
drivers/usb/media/quickcam_messenger.c line 489
Quoted 10 lines
drivers/usb/media/quickcam_messenger.c +10
-0+static int qcm_setup_on_open (struct uvd *uvd) +{ +qcm_sensor_set_gains (uvd, uvd->vpic.hue, +uvd->vpic.colour, uvd->vpic.contrast); +qcm_sensor_set_exposure (uvd, uvd->vpic.brightness); +qcm_sensor_set_shutter (uvd, uvd->vpic.whiteness); +qcm_set_camera_size (uvd); +qcm_camera_on (uvd); +return 0 ; +}This function can generate IO errors. You should not simply drop them.
You are right. I was lazy about that. I'll put in a macro like CHECK_RET(qcm_camera_on) for all the calls that do IO.
Thanks,
jaya