aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/video4linux/gspca.txt1
-rw-r--r--drivers/media/video/gspca/vc032x.c46
2 files changed, 34 insertions, 13 deletions
diff --git a/Documentation/video4linux/gspca.txt b/Documentation/video4linux/gspca.txt
index 8978386d36fa..7045ebf1d72d 100644
--- a/Documentation/video4linux/gspca.txt
+++ b/Documentation/video4linux/gspca.txt
@@ -248,6 +248,7 @@ zc3xx 0ac8:305b Z-star Vimicro zc0305b
248zc3xx 0ac8:307b Ldlc VC302+Ov7620 248zc3xx 0ac8:307b Ldlc VC302+Ov7620
249vc032x 0ac8:c001 Sony embedded vimicro 249vc032x 0ac8:c001 Sony embedded vimicro
250vc032x 0ac8:c002 Sony embedded vimicro 250vc032x 0ac8:c002 Sony embedded vimicro
251vc032x 0ac8:c301 Samsung Q1 Ultra Premium
251spca508 0af9:0010 Hama USB Sightcam 100 252spca508 0af9:0010 Hama USB Sightcam 100
252spca508 0af9:0011 Hama USB Sightcam 100 253spca508 0af9:0011 Hama USB Sightcam 100
253sonixb 0c45:6001 Genius VideoCAM NB 254sonixb 0c45:6001 Genius VideoCAM NB
diff --git a/drivers/media/video/gspca/vc032x.c b/drivers/media/video/gspca/vc032x.c
index 26dd155efcc3..5b6f717d3fe4 100644
--- a/drivers/media/video/gspca/vc032x.c
+++ b/drivers/media/video/gspca/vc032x.c
@@ -52,6 +52,7 @@ struct sd {
52#define SENSOR_OV7670 6 52#define SENSOR_OV7670 6
53#define SENSOR_PO1200 7 53#define SENSOR_PO1200 7
54#define SENSOR_PO3130NC 8 54#define SENSOR_PO3130NC 8
55 u8 ninput; /* != 0 when 2 sensors - SamsungQ1 */
55}; 56};
56 57
57/* V4L2 controls supported by the driver */ 58/* V4L2 controls supported by the driver */
@@ -2342,11 +2343,18 @@ static u16 read_sensor_register(struct gspca_dev *gspca_dev,
2342 2343
2343static int vc032x_probe_sensor(struct gspca_dev *gspca_dev) 2344static int vc032x_probe_sensor(struct gspca_dev *gspca_dev)
2344{ 2345{
2346 struct sd *sd = (struct sd *) gspca_dev;
2345 struct usb_device *dev = gspca_dev->dev; 2347 struct usb_device *dev = gspca_dev->dev;
2346 int i; 2348 int i;
2347 u16 value; 2349 u16 value;
2348 const struct sensor_info *ptsensor_info; 2350 const struct sensor_info *ptsensor_info;
2349 2351
2352/*fixme: should also check the other sensor (back mi1320_soc, front mc501cb)*/
2353 if (sd->ninput != 0) {
2354 reg_w(dev, 0xa0, 0x01, 0xb301);
2355 reg_w(dev, 0x89, 0xf0ff, 0xffff); /* select the back sensor */
2356 }
2357
2350 reg_r(gspca_dev, 0xa1, 0xbfcf, 1); 2358 reg_r(gspca_dev, 0xa1, 0xbfcf, 1);
2351 PDEBUG(D_PROBE, "check sensor header %02x", gspca_dev->usb_buf[0]); 2359 PDEBUG(D_PROBE, "check sensor header %02x", gspca_dev->usb_buf[0]);
2352 for (i = 0; i < ARRAY_SIZE(sensor_info_data); i++) { 2360 for (i = 0; i < ARRAY_SIZE(sensor_info_data); i++) {
@@ -2466,7 +2474,8 @@ static int sd_config(struct gspca_dev *gspca_dev,
2466 }; 2474 };
2467 2475
2468 cam = &gspca_dev->cam; 2476 cam = &gspca_dev->cam;
2469 sd->bridge = id->driver_info; 2477 sd->bridge = id->driver_info >> 8;
2478 sd->ninput = id->driver_info & 0xff;
2470 sensor = vc032x_probe_sensor(gspca_dev); 2479 sensor = vc032x_probe_sensor(gspca_dev);
2471 switch (sensor) { 2480 switch (sensor) {
2472 case -1: 2481 case -1:
@@ -2635,6 +2644,13 @@ static int sd_start(struct gspca_dev *gspca_dev)
2635 mi1320_soc_InitQVGA, 2644 mi1320_soc_InitQVGA,
2636 }; 2645 };
2637 2646
2647/*fixme: back sensor only*/
2648 if (sd->ninput != 0) {
2649 reg_w(gspca_dev->dev, 0x89, 0xf0ff, 0xffff);
2650 reg_w(gspca_dev->dev, 0xa9, 0x8348, 0x000e);
2651 reg_w(gspca_dev->dev, 0xa9, 0x0000, 0x001a);
2652 }
2653
2638 /* Assume start use the good resolution from gspca_dev->mode */ 2654 /* Assume start use the good resolution from gspca_dev->mode */
2639 if (sd->bridge == BRIDGE_VC0321) { 2655 if (sd->bridge == BRIDGE_VC0321) {
2640 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xbfec); 2656 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xbfec);
@@ -2906,19 +2922,23 @@ static const struct sd_desc sd_desc = {
2906}; 2922};
2907 2923
2908/* -- module initialisation -- */ 2924/* -- module initialisation -- */
2925#define BF(bridge, flags) \
2926 .driver_info = (BRIDGE_ ## bridge << 8) \
2927 | (flags)
2909static const __devinitdata struct usb_device_id device_table[] = { 2928static const __devinitdata struct usb_device_id device_table[] = {
2910 {USB_DEVICE(0x041e, 0x405b), .driver_info = BRIDGE_VC0323}, 2929 {USB_DEVICE(0x041e, 0x405b), BF(VC0323, 0)},
2911 {USB_DEVICE(0x046d, 0x0892), .driver_info = BRIDGE_VC0321}, 2930 {USB_DEVICE(0x046d, 0x0892), BF(VC0321, 0)},
2912 {USB_DEVICE(0x046d, 0x0896), .driver_info = BRIDGE_VC0321}, 2931 {USB_DEVICE(0x046d, 0x0896), BF(VC0321, 0)},
2913 {USB_DEVICE(0x046d, 0x0897), .driver_info = BRIDGE_VC0321}, 2932 {USB_DEVICE(0x046d, 0x0897), BF(VC0321, 0)},
2914 {USB_DEVICE(0x0ac8, 0x0321), .driver_info = BRIDGE_VC0321}, 2933 {USB_DEVICE(0x0ac8, 0x0321), BF(VC0321, 0)},
2915 {USB_DEVICE(0x0ac8, 0x0323), .driver_info = BRIDGE_VC0323}, 2934 {USB_DEVICE(0x0ac8, 0x0323), BF(VC0323, 0)},
2916 {USB_DEVICE(0x0ac8, 0x0328), .driver_info = BRIDGE_VC0321}, 2935 {USB_DEVICE(0x0ac8, 0x0328), BF(VC0321, 0)},
2917 {USB_DEVICE(0x0ac8, 0xc001), .driver_info = BRIDGE_VC0321}, 2936 {USB_DEVICE(0x0ac8, 0xc001), BF(VC0321, 0)},
2918 {USB_DEVICE(0x0ac8, 0xc002), .driver_info = BRIDGE_VC0321}, 2937 {USB_DEVICE(0x0ac8, 0xc002), BF(VC0321, 0)},
2919 {USB_DEVICE(0x15b8, 0x6001), .driver_info = BRIDGE_VC0323}, 2938 {USB_DEVICE(0x0ac8, 0xc301), BF(VC0323, 1)},
2920 {USB_DEVICE(0x15b8, 0x6002), .driver_info = BRIDGE_VC0323}, 2939 {USB_DEVICE(0x15b8, 0x6001), BF(VC0323, 0)},
2921 {USB_DEVICE(0x17ef, 0x4802), .driver_info = BRIDGE_VC0323}, 2940 {USB_DEVICE(0x15b8, 0x6002), BF(VC0323, 0)},
2941 {USB_DEVICE(0x17ef, 0x4802), BF(VC0323, 0)},
2922 {} 2942 {}
2923}; 2943};
2924MODULE_DEVICE_TABLE(usb, device_table); 2944MODULE_DEVICE_TABLE(usb, device_table);