aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/zc3xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/gspca/zc3xx.c')
-rw-r--r--drivers/media/video/gspca/zc3xx.c85
1 files changed, 45 insertions, 40 deletions
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c
index bc7d0eedcd81..8d7c27e6ac77 100644
--- a/drivers/media/video/gspca/zc3xx.c
+++ b/drivers/media/video/gspca/zc3xx.c
@@ -85,6 +85,7 @@ static int sd_setsharpness(struct gspca_dev *gspca_dev, __s32 val);
85static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val); 85static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val);
86 86
87static struct ctrl sd_ctrls[] = { 87static struct ctrl sd_ctrls[] = {
88#define BRIGHTNESS_IDX 0
88#define SD_BRIGHTNESS 0 89#define SD_BRIGHTNESS 0
89 { 90 {
90 { 91 {
@@ -141,6 +142,7 @@ static struct ctrl sd_ctrls[] = {
141 .set = sd_setautogain, 142 .set = sd_setautogain,
142 .get = sd_getautogain, 143 .get = sd_getautogain,
143 }, 144 },
145#define LIGHTFREQ_IDX 4
144#define SD_FREQ 4 146#define SD_FREQ 4
145 { 147 {
146 { 148 {
@@ -6964,8 +6966,13 @@ static int zcxx_probeSensor(struct gspca_dev *gspca_dev)
6964 case SENSOR_MC501CB: 6966 case SENSOR_MC501CB:
6965 return -1; /* don't probe */ 6967 return -1; /* don't probe */
6966 case SENSOR_TAS5130C_VF0250: 6968 case SENSOR_TAS5130C_VF0250:
6967 /* may probe but with write in reg 0x0010 */ 6969 /* may probe but with no write in reg 0x0010 */
6968 return -1; /* don't probe */ 6970 return -1; /* don't probe */
6971 case SENSOR_PAS106:
6972 sensor = sif_probe(gspca_dev);
6973 if (sensor >= 0)
6974 return sensor;
6975 break;
6969 } 6976 }
6970 sensor = vga_2wr_probe(gspca_dev); 6977 sensor = vga_2wr_probe(gspca_dev);
6971 if (sensor >= 0) { 6978 if (sensor >= 0) {
@@ -6974,12 +6981,10 @@ static int zcxx_probeSensor(struct gspca_dev *gspca_dev)
6974 /* next probe is needed for OmniVision ? */ 6981 /* next probe is needed for OmniVision ? */
6975 } 6982 }
6976 sensor2 = vga_3wr_probe(gspca_dev); 6983 sensor2 = vga_3wr_probe(gspca_dev);
6977 if (sensor2 >= 0) { 6984 if (sensor2 >= 0
6978 if (sensor >= 0) 6985 && sensor >= 0)
6979 return sensor; 6986 return sensor;
6980 return sensor2; 6987 return sensor2;
6981 }
6982 return sif_probe(gspca_dev);
6983} 6988}
6984 6989
6985/* this function is called at probe time */ 6990/* this function is called at probe time */
@@ -7147,13 +7152,27 @@ static int sd_config(struct gspca_dev *gspca_dev,
7147 sd->lightfreq = sd_ctrls[SD_FREQ].qctrl.default_value; 7152 sd->lightfreq = sd_ctrls[SD_FREQ].qctrl.default_value;
7148 sd->sharpness = sd_ctrls[SD_SHARPNESS].qctrl.default_value; 7153 sd->sharpness = sd_ctrls[SD_SHARPNESS].qctrl.default_value;
7149 7154
7155 switch (sd->sensor) {
7156 case SENSOR_GC0305:
7157 case SENSOR_OV7620:
7158 case SENSOR_PO2030:
7159 gspca_dev->ctrl_dis = (1 << BRIGHTNESS_IDX);
7160 break;
7161 case SENSOR_HDCS2020:
7162 case SENSOR_HV7131B:
7163 case SENSOR_HV7131C:
7164 case SENSOR_OV7630C:
7165 gspca_dev->ctrl_dis = (1 << LIGHTFREQ_IDX);
7166 break;
7167 }
7168
7150 /* switch the led off */ 7169 /* switch the led off */
7151 reg_w(gspca_dev->dev, 0x01, 0x0000); 7170 reg_w(gspca_dev->dev, 0x01, 0x0000);
7152 return 0; 7171 return 0;
7153} 7172}
7154 7173
7155/* this function is called at open time */ 7174/* this function is called at probe and resume time */
7156static int sd_open(struct gspca_dev *gspca_dev) 7175static int sd_init(struct gspca_dev *gspca_dev)
7157{ 7176{
7158 reg_w(gspca_dev->dev, 0x01, 0x0000); 7177 reg_w(gspca_dev->dev, 0x01, 0x0000);
7159 return 0; 7178 return 0;
@@ -7314,10 +7333,6 @@ static void sd_start(struct gspca_dev *gspca_dev)
7314 } 7333 }
7315} 7334}
7316 7335
7317static void sd_stopN(struct gspca_dev *gspca_dev)
7318{
7319}
7320
7321static void sd_stop0(struct gspca_dev *gspca_dev) 7336static void sd_stop0(struct gspca_dev *gspca_dev)
7322{ 7337{
7323 struct sd *sd = (struct sd *) gspca_dev; 7338 struct sd *sd = (struct sd *) gspca_dev;
@@ -7325,11 +7340,6 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
7325 send_unknown(gspca_dev->dev, sd->sensor); 7340 send_unknown(gspca_dev->dev, sd->sensor);
7326} 7341}
7327 7342
7328/* this function is called at close time */
7329static void sd_close(struct gspca_dev *gspca_dev)
7330{
7331}
7332
7333static void sd_pkt_scan(struct gspca_dev *gspca_dev, 7343static void sd_pkt_scan(struct gspca_dev *gspca_dev,
7334 struct gspca_frame *frame, 7344 struct gspca_frame *frame,
7335 __u8 *data, 7345 __u8 *data,
@@ -7489,37 +7499,30 @@ static const struct sd_desc sd_desc = {
7489 .ctrls = sd_ctrls, 7499 .ctrls = sd_ctrls,
7490 .nctrls = sizeof sd_ctrls / sizeof sd_ctrls[0], 7500 .nctrls = sizeof sd_ctrls / sizeof sd_ctrls[0],
7491 .config = sd_config, 7501 .config = sd_config,
7492 .open = sd_open, 7502 .init = sd_init,
7493 .start = sd_start, 7503 .start = sd_start,
7494 .stopN = sd_stopN,
7495 .stop0 = sd_stop0, 7504 .stop0 = sd_stop0,
7496 .close = sd_close,
7497 .pkt_scan = sd_pkt_scan, 7505 .pkt_scan = sd_pkt_scan,
7498 .querymenu = sd_querymenu, 7506 .querymenu = sd_querymenu,
7499}; 7507};
7500 7508
7501static const __devinitdata struct usb_device_id device_table[] = { 7509static const __devinitdata struct usb_device_id device_table[] = {
7502 {USB_DEVICE(0x041e, 0x041e)}, 7510 {USB_DEVICE(0x041e, 0x041e)},
7503#ifndef CONFIG_USB_ZC0301
7504 {USB_DEVICE(0x041e, 0x4017)}, 7511 {USB_DEVICE(0x041e, 0x4017)},
7505 {USB_DEVICE(0x041e, 0x401c)}, 7512 {USB_DEVICE(0x041e, 0x401c), .driver_info = SENSOR_PAS106},
7506 {USB_DEVICE(0x041e, 0x401e)}, 7513 {USB_DEVICE(0x041e, 0x401e)},
7507 {USB_DEVICE(0x041e, 0x401f)}, 7514 {USB_DEVICE(0x041e, 0x401f)},
7508#endif 7515 {USB_DEVICE(0x041e, 0x4022)},
7509 {USB_DEVICE(0x041e, 0x4029)}, 7516 {USB_DEVICE(0x041e, 0x4029)},
7510#ifndef CONFIG_USB_ZC0301 7517 {USB_DEVICE(0x041e, 0x4034), .driver_info = SENSOR_PAS106},
7511 {USB_DEVICE(0x041e, 0x4034)}, 7518 {USB_DEVICE(0x041e, 0x4035), .driver_info = SENSOR_PAS106},
7512 {USB_DEVICE(0x041e, 0x4035)},
7513 {USB_DEVICE(0x041e, 0x4036)}, 7519 {USB_DEVICE(0x041e, 0x4036)},
7514 {USB_DEVICE(0x041e, 0x403a)}, 7520 {USB_DEVICE(0x041e, 0x403a)},
7515#endif
7516 {USB_DEVICE(0x041e, 0x4051), .driver_info = SENSOR_TAS5130C_VF0250}, 7521 {USB_DEVICE(0x041e, 0x4051), .driver_info = SENSOR_TAS5130C_VF0250},
7517 {USB_DEVICE(0x041e, 0x4053), .driver_info = SENSOR_TAS5130C_VF0250}, 7522 {USB_DEVICE(0x041e, 0x4053), .driver_info = SENSOR_TAS5130C_VF0250},
7518#ifndef CONFIG_USB_ZC0301
7519 {USB_DEVICE(0x0458, 0x7007)}, 7523 {USB_DEVICE(0x0458, 0x7007)},
7520 {USB_DEVICE(0x0458, 0x700c)}, 7524 {USB_DEVICE(0x0458, 0x700c)},
7521 {USB_DEVICE(0x0458, 0x700f)}, 7525 {USB_DEVICE(0x0458, 0x700f)},
7522#endif
7523 {USB_DEVICE(0x0461, 0x0a00)}, 7526 {USB_DEVICE(0x0461, 0x0a00)},
7524 {USB_DEVICE(0x046d, 0x08a0)}, 7527 {USB_DEVICE(0x046d, 0x08a0)},
7525 {USB_DEVICE(0x046d, 0x08a1)}, 7528 {USB_DEVICE(0x046d, 0x08a1)},
@@ -7531,7 +7534,7 @@ static const __devinitdata struct usb_device_id device_table[] = {
7531 {USB_DEVICE(0x046d, 0x08aa)}, 7534 {USB_DEVICE(0x046d, 0x08aa)},
7532 {USB_DEVICE(0x046d, 0x08ac)}, 7535 {USB_DEVICE(0x046d, 0x08ac)},
7533 {USB_DEVICE(0x046d, 0x08ad)}, 7536 {USB_DEVICE(0x046d, 0x08ad)},
7534#ifndef CONFIG_USB_ZC0301 7537#if !defined CONFIG_USB_ZC0301 && !defined CONFIG_USB_ZC0301_MODULE
7535 {USB_DEVICE(0x046d, 0x08ae)}, 7538 {USB_DEVICE(0x046d, 0x08ae)},
7536#endif 7539#endif
7537 {USB_DEVICE(0x046d, 0x08af)}, 7540 {USB_DEVICE(0x046d, 0x08af)},
@@ -7541,27 +7544,25 @@ static const __devinitdata struct usb_device_id device_table[] = {
7541 {USB_DEVICE(0x046d, 0x08d8)}, 7544 {USB_DEVICE(0x046d, 0x08d8)},
7542 {USB_DEVICE(0x046d, 0x08da)}, 7545 {USB_DEVICE(0x046d, 0x08da)},
7543 {USB_DEVICE(0x046d, 0x08dd), .driver_info = SENSOR_MC501CB}, 7546 {USB_DEVICE(0x046d, 0x08dd), .driver_info = SENSOR_MC501CB},
7544 {USB_DEVICE(0x0471, 0x0325)}, 7547 {USB_DEVICE(0x0471, 0x0325), .driver_info = SENSOR_PAS106},
7545 {USB_DEVICE(0x0471, 0x0326)}, 7548 {USB_DEVICE(0x0471, 0x0326), .driver_info = SENSOR_PAS106},
7546 {USB_DEVICE(0x0471, 0x032d)}, 7549 {USB_DEVICE(0x0471, 0x032d), .driver_info = SENSOR_PAS106},
7547 {USB_DEVICE(0x0471, 0x032e)}, 7550 {USB_DEVICE(0x0471, 0x032e), .driver_info = SENSOR_PAS106},
7548 {USB_DEVICE(0x055f, 0xc005)}, 7551 {USB_DEVICE(0x055f, 0xc005)},
7549#ifndef CONFIG_USB_ZC0301
7550 {USB_DEVICE(0x055f, 0xd003)}, 7552 {USB_DEVICE(0x055f, 0xd003)},
7551 {USB_DEVICE(0x055f, 0xd004)}, 7553 {USB_DEVICE(0x055f, 0xd004)},
7552#endif
7553 {USB_DEVICE(0x0698, 0x2003)}, 7554 {USB_DEVICE(0x0698, 0x2003)},
7555 {USB_DEVICE(0x0ac8, 0x0301), .driver_info = SENSOR_PAS106},
7554 {USB_DEVICE(0x0ac8, 0x0302)}, 7556 {USB_DEVICE(0x0ac8, 0x0302)},
7555#ifndef CONFIG_USB_ZC0301
7556 {USB_DEVICE(0x0ac8, 0x301b)}, 7557 {USB_DEVICE(0x0ac8, 0x301b)},
7558#if !defined CONFIG_USB_ZC0301 && !defined CONFIG_USB_ZC0301_MODULE
7557 {USB_DEVICE(0x0ac8, 0x303b)}, 7559 {USB_DEVICE(0x0ac8, 0x303b)},
7558#endif 7560#endif
7559 {USB_DEVICE(0x0ac8, 0x305b), .driver_info = SENSOR_TAS5130C_VF0250}, 7561 {USB_DEVICE(0x0ac8, 0x305b), .driver_info = SENSOR_TAS5130C_VF0250},
7560#ifndef CONFIG_USB_ZC0301
7561 {USB_DEVICE(0x0ac8, 0x307b)}, 7562 {USB_DEVICE(0x0ac8, 0x307b)},
7562 {USB_DEVICE(0x10fd, 0x0128)}, 7563 {USB_DEVICE(0x10fd, 0x0128)},
7564 {USB_DEVICE(0x10fd, 0x804d)},
7563 {USB_DEVICE(0x10fd, 0x8050)}, 7565 {USB_DEVICE(0x10fd, 0x8050)},
7564#endif
7565 {} /* end of entry */ 7566 {} /* end of entry */
7566}; 7567};
7567#undef DVNAME 7568#undef DVNAME
@@ -7581,6 +7582,10 @@ static struct usb_driver sd_driver = {
7581 .id_table = device_table, 7582 .id_table = device_table,
7582 .probe = sd_probe, 7583 .probe = sd_probe,
7583 .disconnect = gspca_disconnect, 7584 .disconnect = gspca_disconnect,
7585#ifdef CONFIG_PM
7586 .suspend = gspca_suspend,
7587 .resume = gspca_resume,
7588#endif
7584}; 7589};
7585 7590
7586static int __init sd_mod_init(void) 7591static int __init sd_mod_init(void)