Skip to contentSkip to conversation

gspca pac7302/pac7311: separate the two subdrivers

PATCH In review Németh Márton 2 participants 3 messages Nov 1, 2009 – Nov 8, 2009 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 gspca pac7302/pac7311: separate the two subdrivers

From: Márton Németh <[email protected]>

All PAC7311 specific functions remain in pac7311.c. All PAC7302 specific functions are moved to pac7302.c. The USB device table is also divided into two parts. This makes it possible to remove the sensor specific decisions from different functions and also remove sensor infromation from the USB device table.

The common functions are just copied to both subdrivers. These common functions can be separated later to a common file or helper module.

Cc Thomas Kaiser <[email protected]>
Cc Theodore Kilgore <[email protected]>
Cc Kyle Guinn <[email protected]>

---

drivers/media/video/gspca/Kconfig +9 -0
diff -uprN c/drivers/media/video/gspca/Kconfig d/drivers/media/video/gspca/Kconfig
@@ -104,6 +104,15 @@ config USB_GSPCA_PAC207
 	  To compile this driver as a module, choose M here: the
 	  module will be called gspca_pac207.
 
+config USB_GSPCA_PAC7302
+	tristate "Pixart PAC7302 USB Camera Driver"
+	depends on VIDEO_V4L2 && USB_GSPCA
+	help
+	  Say Y here if you want support for cameras based on the PAC7302 chip.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called gspca_pac7302.
+
 config USB_GSPCA_PAC7311
 	tristate "Pixart PAC7311 USB Camera Driver"
 	depends on VIDEO_V4L2 && USB_GSPCA
drivers/media/video/gspca/Makefile +2 -0
diff -uprN c/drivers/media/video/gspca/Makefile d/drivers/media/video/gspca/Makefile
@@ -8,6 +8,7 @@ obj-$(CONFIG_USB_GSPCA_MR97310A) += gspc
 obj-$(CONFIG_USB_GSPCA_OV519)    += gspca_ov519.o
 obj-$(CONFIG_USB_GSPCA_OV534)    += gspca_ov534.o
 obj-$(CONFIG_USB_GSPCA_PAC207)   += gspca_pac207.o
+obj-$(CONFIG_USB_GSPCA_PAC7302)  += gspca_pac7302.o
 obj-$(CONFIG_USB_GSPCA_PAC7311)  += gspca_pac7311.o
 obj-$(CONFIG_USB_GSPCA_SN9C20X)  += gspca_sn9c20x.o
 obj-$(CONFIG_USB_GSPCA_SONIXB)   += gspca_sonixb.o
@@ -38,6 +39,7 @@ gspca_mr97310a-objs := mr97310a.o
 gspca_ov519-objs    := ov519.o
 gspca_ov534-objs    := ov534.o
 gspca_pac207-objs   := pac207.o
+gspca_pac7302-objs  := pac7302.o
 gspca_pac7311-objs  := pac7311.o
 gspca_sn9c20x-objs  := sn9c20x.o
 gspca_sonixb-objs   := sonixb.o
drivers/media/video/gspca/pac7302.c +976 -0

976 lines not on this page · raw message

drivers/media/video/gspca/pac7311.c +60 -380

628 lines not on this page · raw message

#1 lore raw

Dear Jef,

although I tested my patch on my development computer together with Labtec Webcam 2200 (gspca_pac7302 driver) it seems that the patch may cause regression on some computers. For example I tested the gspca_pac7302 driver from
http://linuxtv.org/hg/~jfrancois/gspca/ on top of Linux kernel 2.6.32-rc5 on an EeePC 901. I get the following error message in dmesg:

[ 4476.992201] usb 3-2: new full speed USB device using uhci_hcd and address 11
[ 4477.230485] usb 3-2: New USB device found, idVendor=093a, idProduct=2626
[ 4477.230507] usb 3-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 4477.231139] usb 3-2: configuration #1 chosen from 1 choice
[ 4477.417456] Linux video capture interface: v2.00
[ 4477.437131] gspca: main v2.7.0 registered
[ 4477.443214] gspca: probing 093a:2626
[ 4477.453491] gspca: /dev/video0 created
[ 4477.453541] gspca: probing 093a:2626
[ 4477.453549] gspca: intf != 0
[ 4477.453598] gspca: probing 093a:2626
[ 4477.453605] gspca: intf != 0
[ 4477.453755] usbcore: registered new interface driver pac7302
[ 4477.453771] pac7302: registered
[ 4489.552153] gspca: set alt 8 err -71

I bisected the problem on EeePC 901 and the changeset 13373:99c23949b411 (gspca - pac7302/pac7311: Separate the two subdrivers.) was marked as the first bad commit.

On my development computer the same configuration works correctly:

[ 7872.020222] usb 3-1: new full speed USB device using uhci_hcd and address 4
[ 7872.251240] usb 3-1: configuration #1 chosen from 1 choice
[ 7872.744755] Linux video capture interface: v2.00
[ 7872.785032] gspca: main v2.7.0 registered
[ 7872.797061] gspca: probing 093a:2626
[ 7872.807577] gspca: /dev/video0 created
[ 7872.809747] usbcore: registered new interface driver pac7302
[ 7872.809798] pac7302: registered

Is the separated driver working for you?
Do you have any idea what could went wrong? Maybe some timing problem?

Regards,

Márton Németh

Quoted 15 lines · Németh Márton

From: Márton Németh <[email protected]>

All PAC7311 specific functions remain in pac7311.c. All PAC7302 specific functions are moved to pac7302.c. The USB device table is also divided into two parts. This makes it possible to remove the sensor specific decisions from different functions and also remove sensor infromation from the USB device table.

The common functions are just copied to both subdrivers. These common functions can be separated later to a common file or helper module.

Cc Thomas Kaiser <[email protected]>
Cc Theodore Kilgore <[email protected]>
Cc Kyle Guinn <[email protected]>
#2 lore raw

Hi Németh,

I'm getting similar reports for other (non pac73xx) model webcams with 2.6.32 on eeepc's and other computers using the uhci usb driver.

Can you try installing an older kernel (so 2.6.30) and then building and installing the latest v4l-dvb tree (with your changes in) over that ?

I think what you are seeing here is a bug outside of the v4l subsystem, this is just a hunch though.

Regards,

Hans

Quoted 62 lines · Németh Márton

Dear Jef,

although I tested my patch on my development computer together with Labtec Webcam 2200 (gspca_pac7302 driver) it seems that the patch may cause regression on some computers. For example I tested the gspca_pac7302 driver from
http://linuxtv.org/hg/~jfrancois/gspca/ on top of Linux kernel 2.6.32-rc5 on an EeePC 901. I get the following error message in dmesg:

[ 4476.992201] usb 3-2: new full speed USB device using uhci_hcd and address 11
[ 4477.230485] usb 3-2: New USB device found, idVendor=093a, idProduct=2626
[ 4477.230507] usb 3-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 4477.231139] usb 3-2: configuration #1 chosen from 1 choice
[ 4477.417456] Linux video capture interface: v2.00
[ 4477.437131] gspca: main v2.7.0 registered
[ 4477.443214] gspca: probing 093a:2626
[ 4477.453491] gspca: /dev/video0 created
[ 4477.453541] gspca: probing 093a:2626
[ 4477.453549] gspca: intf != 0
[ 4477.453598] gspca: probing 093a:2626
[ 4477.453605] gspca: intf != 0
[ 4477.453755] usbcore: registered new interface driver pac7302
[ 4477.453771] pac7302: registered
[ 4489.552153] gspca: set alt 8 err -71

I bisected the problem on EeePC 901 and the changeset 13373:99c23949b411 (gspca - pac7302/pac7311: Separate the two subdrivers.) was marked as the first bad commit.

On my development computer the same configuration works correctly:

[ 7872.020222] usb 3-1: new full speed USB device using uhci_hcd and address 4
[ 7872.251240] usb 3-1: configuration #1 chosen from 1 choice
[ 7872.744755] Linux video capture interface: v2.00
[ 7872.785032] gspca: main v2.7.0 registered
[ 7872.797061] gspca: probing 093a:2626
[ 7872.807577] gspca: /dev/video0 created
[ 7872.809747] usbcore: registered new interface driver pac7302
[ 7872.809798] pac7302: registered

Is the separated driver working for you?
Do you have any idea what could went wrong? Maybe some timing problem?

Regards,

Márton Németh

Quoted 15 lines · Németh Márton

From: Márton Németh<[email protected]>

All PAC7311 specific functions remain in pac7311.c. All PAC7302 specific functions are moved to pac7302.c. The USB device table is also divided into two parts. This makes it possible to remove the sensor specific decisions from different functions and also remove sensor infromation from the USB device table.

The common functions are just copied to both subdrivers. These common functions can be separated later to a common file or helper module.

Cc Thomas Kaiser<[email protected]>
Cc Theodore Kilgore<[email protected]>
Cc Kyle Guinn<[email protected]>