diff options
author | Jean-François Moine <moinejf@free.fr> | 2010-08-04 04:11:23 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-08 22:43:01 -0400 |
commit | 83d1aa3d21ce50b9bc3b503ce2b1e7bb718709f1 (patch) | |
tree | 8d8d1a43cd536862f217b91e47bffe0560ff50b7 /drivers/media/video | |
parent | fe988f56c7c1bff52a4c26164ceb3dbd582de433 (diff) |
V4L/DVB: gspca - zc3xx: Cleanup source
- use an enum to define the sensor numbers
- use the sensor numbers to index the associated tables
- rename TAS5130CXX to TAS5130C
- rename HV7131C to HV7131R
- change some comments
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/gspca/zc3xx.c | 385 |
1 files changed, 200 insertions, 185 deletions
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c index 4473f0fb8b73..e184eb3b8c73 100644 --- a/drivers/media/video/gspca/zc3xx.c +++ b/drivers/media/video/gspca/zc3xx.c | |||
@@ -21,7 +21,9 @@ | |||
21 | 21 | ||
22 | #define MODULE_NAME "zc3xx" | 22 | #define MODULE_NAME "zc3xx" |
23 | 23 | ||
24 | #ifdef CONFIG_INPUT | ||
24 | #include <linux/input.h> | 25 | #include <linux/input.h> |
26 | #endif | ||
25 | #include "gspca.h" | 27 | #include "gspca.h" |
26 | #include "jpeg.h" | 28 | #include "jpeg.h" |
27 | 29 | ||
@@ -51,32 +53,32 @@ struct sd { | |||
51 | #define QUALITY_DEF 70 | 53 | #define QUALITY_DEF 70 |
52 | 54 | ||
53 | u8 sensor; /* Type of image sensor chip */ | 55 | u8 sensor; /* Type of image sensor chip */ |
54 | /* !! values used in different tables */ | 56 | u16 chip_revision; |
55 | #define SENSOR_ADCM2700 0 | ||
56 | #define SENSOR_CS2102 1 | ||
57 | #define SENSOR_CS2102K 2 | ||
58 | #define SENSOR_GC0305 3 | ||
59 | #define SENSOR_HDCS2020b 4 | ||
60 | #define SENSOR_HV7131B 5 | ||
61 | #define SENSOR_HV7131C 6 | ||
62 | #define SENSOR_ICM105A 7 | ||
63 | #define SENSOR_MC501CB 8 | ||
64 | #define SENSOR_MI0360SOC 9 | ||
65 | #define SENSOR_OV7620 10 | ||
66 | /*#define SENSOR_OV7648 10 - same values */ | ||
67 | #define SENSOR_OV7630C 11 | ||
68 | #define SENSOR_PAS106 12 | ||
69 | #define SENSOR_PAS202B 13 | ||
70 | #define SENSOR_PB0330 14 /* (MI0360) */ | ||
71 | #define SENSOR_PO2030 15 | ||
72 | #define SENSOR_TAS5130CK 16 | ||
73 | #define SENSOR_TAS5130CXX 17 | ||
74 | #define SENSOR_TAS5130C_VF0250 18 | ||
75 | #define SENSOR_MAX 19 | ||
76 | unsigned short chip_revision; | ||
77 | 57 | ||
78 | u8 jpeg_hdr[JPEG_HDR_SZ]; | 58 | u8 jpeg_hdr[JPEG_HDR_SZ]; |
79 | }; | 59 | }; |
60 | enum sensors { | ||
61 | SENSOR_ADCM2700, | ||
62 | SENSOR_CS2102, | ||
63 | SENSOR_CS2102K, | ||
64 | SENSOR_GC0305, | ||
65 | SENSOR_HDCS2020b, | ||
66 | SENSOR_HV7131B, | ||
67 | SENSOR_HV7131R, | ||
68 | SENSOR_ICM105A, | ||
69 | SENSOR_MC501CB, | ||
70 | SENSOR_MI0360SOC, /* = MT9V111 */ | ||
71 | SENSOR_OV7620, /* OV7648 - same values */ | ||
72 | SENSOR_OV7630C, | ||
73 | SENSOR_PAS106, | ||
74 | SENSOR_PAS202B, | ||
75 | SENSOR_PB0330, | ||
76 | SENSOR_PO2030, | ||
77 | SENSOR_TAS5130CK, | ||
78 | SENSOR_TAS5130C, | ||
79 | SENSOR_TAS5130C_VF0250, | ||
80 | SENSOR_MAX | ||
81 | }; | ||
80 | 82 | ||
81 | /* V4L2 controls supported by the driver */ | 83 | /* V4L2 controls supported by the driver */ |
82 | static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val); | 84 | static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val); |
@@ -3350,7 +3352,7 @@ static const struct usb_action ov7620_NoFliker[] = { | |||
3350 | {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */ | 3352 | {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* 01,96,00,cc */ |
3351 | {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,01,cc */ | 3353 | {0xa0, 0x01, ZC3XX_R197_ANTIFLICKERLOW}, /* 01,97,01,cc */ |
3352 | /* {0xa0, 0x44, ZC3XX_R002_CLOCKSELECT}, * 00,02,44,cc | 3354 | /* {0xa0, 0x44, ZC3XX_R002_CLOCKSELECT}, * 00,02,44,cc |
3353 | - if mode1 (320x240) */ | 3355 | * if mode1 (320x240) */ |
3354 | /* ?? was | 3356 | /* ?? was |
3355 | {0xa0, 0x00, 0x0039}, * 00,00,00,dd * | 3357 | {0xa0, 0x00, 0x0039}, * 00,00,00,dd * |
3356 | {0xa1, 0x01, 0x0037}, */ | 3358 | {0xa1, 0x01, 0x0037}, */ |
@@ -3439,7 +3441,6 @@ static const struct usb_action ov7630c_InitialScale[] = { | |||
3439 | {0xa0, 0xf8, ZC3XX_R110_RGB20}, | 3441 | {0xa0, 0xf8, ZC3XX_R110_RGB20}, |
3440 | {0xa0, 0xf8, ZC3XX_R111_RGB21}, | 3442 | {0xa0, 0xf8, ZC3XX_R111_RGB21}, |
3441 | {0xa0, 0x50, ZC3XX_R112_RGB22}, | 3443 | {0xa0, 0x50, ZC3XX_R112_RGB22}, |
3442 | /* 0x03, */ | ||
3443 | {0xa1, 0x01, 0x0008}, | 3444 | {0xa1, 0x01, 0x0008}, |
3444 | {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */ | 3445 | {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */ |
3445 | {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */ | 3446 | {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */ |
@@ -3719,7 +3720,7 @@ static const struct usb_action pas106b_InitialScale[] = { /* 176x144 */ | |||
3719 | {0xaa, 0x0e, 0x0002}, | 3720 | {0xaa, 0x0e, 0x0002}, |
3720 | {0xaa, 0x14, 0x0081}, | 3721 | {0xaa, 0x14, 0x0081}, |
3721 | 3722 | ||
3722 | /* Other registors */ | 3723 | /* Other registers */ |
3723 | {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, | 3724 | {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, |
3724 | /* Frame retreiving */ | 3725 | /* Frame retreiving */ |
3725 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, | 3726 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, |
@@ -3730,7 +3731,7 @@ static const struct usb_action pas106b_InitialScale[] = { /* 176x144 */ | |||
3730 | /* Sharpness */ | 3731 | /* Sharpness */ |
3731 | {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, | 3732 | {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, |
3732 | {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, | 3733 | {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, |
3733 | /* Other registors */ | 3734 | /* Other registers */ |
3734 | {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, | 3735 | {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, |
3735 | /* Auto exposure and white balance */ | 3736 | /* Auto exposure and white balance */ |
3736 | {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, | 3737 | {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, |
@@ -3837,7 +3838,7 @@ static const struct usb_action pas106b_Initial[] = { /* 352x288 */ | |||
3837 | {0xaa, 0x0e, 0x0002}, | 3838 | {0xaa, 0x0e, 0x0002}, |
3838 | {0xaa, 0x14, 0x0081}, | 3839 | {0xaa, 0x14, 0x0081}, |
3839 | 3840 | ||
3840 | /* Other registors */ | 3841 | /* Other registers */ |
3841 | {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, | 3842 | {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, |
3842 | /* Frame retreiving */ | 3843 | /* Frame retreiving */ |
3843 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, | 3844 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, |
@@ -3848,7 +3849,7 @@ static const struct usb_action pas106b_Initial[] = { /* 352x288 */ | |||
3848 | /* Sharpness */ | 3849 | /* Sharpness */ |
3849 | {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, | 3850 | {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, |
3850 | {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, | 3851 | {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, |
3851 | /* Other registors */ | 3852 | /* Other registers */ |
3852 | {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, | 3853 | {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, |
3853 | /* Auto exposure and white balance */ | 3854 | /* Auto exposure and white balance */ |
3854 | {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, | 3855 | {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, |
@@ -5340,7 +5341,7 @@ static const struct usb_action tas5130cK_Initial[] = { | |||
5340 | {} | 5341 | {} |
5341 | }; | 5342 | }; |
5342 | 5343 | ||
5343 | static const struct usb_action tas5130cxx_InitialScale[] = { /* 320x240 */ | 5344 | static const struct usb_action tas5130c_InitialScale[] = { /* 320x240 */ |
5344 | {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, | 5345 | {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, |
5345 | {0xa0, 0x50, ZC3XX_R002_CLOCKSELECT}, | 5346 | {0xa0, 0x50, ZC3XX_R002_CLOCKSELECT}, |
5346 | {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, | 5347 | {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, |
@@ -5377,7 +5378,7 @@ static const struct usb_action tas5130cxx_InitialScale[] = { /* 320x240 */ | |||
5377 | {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL}, | 5378 | {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL}, |
5378 | {} | 5379 | {} |
5379 | }; | 5380 | }; |
5380 | static const struct usb_action tas5130cxx_Initial[] = { /* 640x480 */ | 5381 | static const struct usb_action tas5130c_Initial[] = { /* 640x480 */ |
5381 | {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, | 5382 | {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, |
5382 | {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, | 5383 | {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, |
5383 | {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, | 5384 | {0xa0, 0x00, ZC3XX_R008_CLOCKSETTING}, |
@@ -5413,7 +5414,7 @@ static const struct usb_action tas5130cxx_Initial[] = { /* 640x480 */ | |||
5413 | {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL}, | 5414 | {0xa0, 0x02, ZC3XX_R0A6_EXPOSUREBLACKLVL}, |
5414 | {} | 5415 | {} |
5415 | }; | 5416 | }; |
5416 | static const struct usb_action tas5130cxx_50HZ[] = { | 5417 | static const struct usb_action tas5130c_50HZ[] = { |
5417 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ | 5418 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ |
5418 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ | 5419 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ |
5419 | {0xaa, 0xa4, 0x0063}, /* 00,a4,63,aa */ | 5420 | {0xaa, 0xa4, 0x0063}, /* 00,a4,63,aa */ |
@@ -5438,7 +5439,7 @@ static const struct usb_action tas5130cxx_50HZ[] = { | |||
5438 | {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN}, | 5439 | {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN}, |
5439 | {} | 5440 | {} |
5440 | }; | 5441 | }; |
5441 | static const struct usb_action tas5130cxx_50HZScale[] = { | 5442 | static const struct usb_action tas5130c_50HZScale[] = { |
5442 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ | 5443 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ |
5443 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ | 5444 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ |
5444 | {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */ | 5445 | {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */ |
@@ -5463,7 +5464,7 @@ static const struct usb_action tas5130cxx_50HZScale[] = { | |||
5463 | {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN}, | 5464 | {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN}, |
5464 | {} | 5465 | {} |
5465 | }; | 5466 | }; |
5466 | static const struct usb_action tas5130cxx_60HZ[] = { | 5467 | static const struct usb_action tas5130c_60HZ[] = { |
5467 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ | 5468 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ |
5468 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ | 5469 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ |
5469 | {0xaa, 0xa4, 0x0036}, /* 00,a4,36,aa */ | 5470 | {0xaa, 0xa4, 0x0036}, /* 00,a4,36,aa */ |
@@ -5488,7 +5489,7 @@ static const struct usb_action tas5130cxx_60HZ[] = { | |||
5488 | {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN}, | 5489 | {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN}, |
5489 | {} | 5490 | {} |
5490 | }; | 5491 | }; |
5491 | static const struct usb_action tas5130cxx_60HZScale[] = { | 5492 | static const struct usb_action tas5130c_60HZScale[] = { |
5492 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ | 5493 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ |
5493 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ | 5494 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ |
5494 | {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */ | 5495 | {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */ |
@@ -5513,7 +5514,7 @@ static const struct usb_action tas5130cxx_60HZScale[] = { | |||
5513 | {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN}, | 5514 | {0xa0, 0x50, ZC3XX_R11D_GLOBALGAIN}, |
5514 | {} | 5515 | {} |
5515 | }; | 5516 | }; |
5516 | static const struct usb_action tas5130cxx_NoFliker[] = { | 5517 | static const struct usb_action tas5130c_NoFliker[] = { |
5517 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ | 5518 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ |
5518 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ | 5519 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ |
5519 | {0xaa, 0xa4, 0x0040}, /* 00,a4,40,aa */ | 5520 | {0xaa, 0xa4, 0x0040}, /* 00,a4,40,aa */ |
@@ -5539,7 +5540,7 @@ static const struct usb_action tas5130cxx_NoFliker[] = { | |||
5539 | {} | 5540 | {} |
5540 | }; | 5541 | }; |
5541 | 5542 | ||
5542 | static const struct usb_action tas5130cxx_NoFlikerScale[] = { | 5543 | static const struct usb_action tas5130c_NoFlikerScale[] = { |
5543 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ | 5544 | {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ |
5544 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ | 5545 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ |
5545 | {0xaa, 0xa4, 0x0090}, /* 00,a4,90,aa */ | 5546 | {0xaa, 0xa4, 0x0090}, /* 00,a4,90,aa */ |
@@ -5974,25 +5975,25 @@ static void setmatrix(struct gspca_dev *gspca_dev) | |||
5974 | static const u8 vf0250_matrix[9] = | 5975 | static const u8 vf0250_matrix[9] = |
5975 | {0x7b, 0xea, 0xea, 0xea, 0x7b, 0xea, 0xea, 0xea, 0x7b}; | 5976 | {0x7b, 0xea, 0xea, 0xea, 0x7b, 0xea, 0xea, 0xea, 0x7b}; |
5976 | static const u8 *matrix_tb[SENSOR_MAX] = { | 5977 | static const u8 *matrix_tb[SENSOR_MAX] = { |
5977 | adcm2700_matrix, /* SENSOR_ADCM2700 0 */ | 5978 | [SENSOR_ADCM2700] = adcm2700_matrix, |
5978 | ov7620_matrix, /* SENSOR_CS2102 1 */ | 5979 | [SENSOR_CS2102] = ov7620_matrix, |
5979 | NULL, /* SENSOR_CS2102K 2 */ | 5980 | [SENSOR_CS2102K] = NULL, |
5980 | gc0305_matrix, /* SENSOR_GC0305 3 */ | 5981 | [SENSOR_GC0305] = gc0305_matrix, |
5981 | NULL, /* SENSOR_HDCS2020b 4 */ | 5982 | [SENSOR_HDCS2020b] = NULL, |
5982 | NULL, /* SENSOR_HV7131B 5 */ | 5983 | [SENSOR_HV7131B] = NULL, |
5983 | NULL, /* SENSOR_HV7131C 6 */ | 5984 | [SENSOR_HV7131R] = NULL, |
5984 | NULL, /* SENSOR_ICM105A 7 */ | 5985 | [SENSOR_ICM105A] = po2030_matrix, |
5985 | NULL, /* SENSOR_MC501CB 8 */ | 5986 | [SENSOR_MC501CB] = NULL, |
5986 | gc0305_matrix, /* SENSOR_MI0360SOC 9 */ | 5987 | [SENSOR_MI0360SOC] = gc0305_matrix, |
5987 | ov7620_matrix, /* SENSOR_OV7620 10 */ | 5988 | [SENSOR_OV7620] = ov7620_matrix, |
5988 | NULL, /* SENSOR_OV7630C 11 */ | 5989 | [SENSOR_OV7630C] = NULL, |
5989 | NULL, /* SENSOR_PAS106 12 */ | 5990 | [SENSOR_PAS106] = NULL, |
5990 | pas202b_matrix, /* SENSOR_PAS202B 13 */ | 5991 | [SENSOR_PAS202B] = pas202b_matrix, |
5991 | gc0305_matrix, /* SENSOR_PB0330 14 */ | 5992 | [SENSOR_PB0330] = gc0305_matrix, |
5992 | po2030_matrix, /* SENSOR_PO2030 15 */ | 5993 | [SENSOR_PO2030] = po2030_matrix, |
5993 | NULL, /* SENSOR_TAS5130CK 16 */ | 5994 | [SENSOR_TAS5130CK] = NULL, |
5994 | tas5130c_matrix, /* SENSOR_TAS5130CXX 17 */ | 5995 | [SENSOR_TAS5130C] = tas5130c_matrix, |
5995 | vf0250_matrix, /* SENSOR_TAS5130C_VF0250 18 */ | 5996 | [SENSOR_TAS5130C_VF0250] = vf0250_matrix, |
5996 | }; | 5997 | }; |
5997 | 5998 | ||
5998 | matrix = matrix_tb[sd->sensor]; | 5999 | matrix = matrix_tb[sd->sensor]; |
@@ -6124,79 +6125,79 @@ static int setlightfreq(struct gspca_dev *gspca_dev) | |||
6124 | int i, mode; | 6125 | int i, mode; |
6125 | const struct usb_action *zc3_freq; | 6126 | const struct usb_action *zc3_freq; |
6126 | static const struct usb_action *freq_tb[SENSOR_MAX][6] = { | 6127 | static const struct usb_action *freq_tb[SENSOR_MAX][6] = { |
6127 | /* SENSOR_ADCM2700 0 */ | 6128 | [SENSOR_ADCM2700] = |
6128 | {adcm2700_NoFliker, adcm2700_NoFliker, | 6129 | {adcm2700_NoFliker, adcm2700_NoFliker, |
6129 | adcm2700_50HZ, adcm2700_50HZ, | 6130 | adcm2700_50HZ, adcm2700_50HZ, |
6130 | adcm2700_60HZ, adcm2700_60HZ}, | 6131 | adcm2700_60HZ, adcm2700_60HZ}, |
6131 | /* SENSOR_CS2102 1 */ | 6132 | [SENSOR_CS2102] = |
6132 | {cs2102_NoFliker, cs2102_NoFlikerScale, | 6133 | {cs2102_NoFliker, cs2102_NoFlikerScale, |
6133 | cs2102_50HZ, cs2102_50HZScale, | 6134 | cs2102_50HZ, cs2102_50HZScale, |
6134 | cs2102_60HZ, cs2102_60HZScale}, | 6135 | cs2102_60HZ, cs2102_60HZScale}, |
6135 | /* SENSOR_CS2102K 2 */ | 6136 | [SENSOR_CS2102K] = |
6136 | {cs2102_NoFliker, cs2102_NoFlikerScale, | 6137 | {cs2102_NoFliker, cs2102_NoFlikerScale, |
6137 | NULL, NULL, /* currently disabled */ | 6138 | NULL, NULL, /* currently disabled */ |
6138 | NULL, NULL}, | 6139 | NULL, NULL}, |
6139 | /* SENSOR_GC0305 3 */ | 6140 | [SENSOR_GC0305] = |
6140 | {gc0305_NoFliker, gc0305_NoFliker, | 6141 | {gc0305_NoFliker, gc0305_NoFliker, |
6141 | gc0305_50HZ, gc0305_50HZ, | 6142 | gc0305_50HZ, gc0305_50HZ, |
6142 | gc0305_60HZ, gc0305_60HZ}, | 6143 | gc0305_60HZ, gc0305_60HZ}, |
6143 | /* SENSOR_HDCS2020b 4 */ | 6144 | [SENSOR_HDCS2020b] = |
6144 | {hdcs2020b_NoFliker, hdcs2020b_NoFliker, | 6145 | {hdcs2020b_NoFliker, hdcs2020b_NoFliker, |
6145 | hdcs2020b_50HZ, hdcs2020b_50HZ, | 6146 | hdcs2020b_50HZ, hdcs2020b_50HZ, |
6146 | hdcs2020b_60HZ, hdcs2020b_60HZ}, | 6147 | hdcs2020b_60HZ, hdcs2020b_60HZ}, |
6147 | /* SENSOR_HV7131B 5 */ | 6148 | [SENSOR_HV7131B] = |
6148 | {hv7131b_NoFliker, hv7131b_NoFlikerScale, | 6149 | {hv7131b_NoFliker, hv7131b_NoFlikerScale, |
6149 | hv7131b_50HZ, hv7131b_50HZScale, | 6150 | hv7131b_50HZ, hv7131b_50HZScale, |
6150 | hv7131b_60HZ, hv7131b_60HZScale}, | 6151 | hv7131b_60HZ, hv7131b_60HZScale}, |
6151 | /* SENSOR_HV7131C 6 */ | 6152 | [SENSOR_HV7131R] = |
6152 | {NULL, NULL, | 6153 | {NULL, NULL, |
6153 | NULL, NULL, | 6154 | NULL, NULL, |
6154 | NULL, NULL}, | 6155 | NULL, NULL}, |
6155 | /* SENSOR_ICM105A 7 */ | 6156 | [SENSOR_ICM105A] = |
6156 | {icm105a_NoFliker, icm105a_NoFlikerScale, | 6157 | {icm105a_NoFliker, icm105a_NoFlikerScale, |
6157 | icm105a_50HZ, icm105a_50HZScale, | 6158 | icm105a_50HZ, icm105a_50HZScale, |
6158 | icm105a_60HZ, icm105a_60HZScale}, | 6159 | icm105a_60HZ, icm105a_60HZScale}, |
6159 | /* SENSOR_MC501CB 8 */ | 6160 | [SENSOR_MC501CB] = |
6160 | {mc501cb_NoFliker, mc501cb_NoFlikerScale, | 6161 | {mc501cb_NoFliker, mc501cb_NoFlikerScale, |
6161 | mc501cb_50HZ, mc501cb_50HZScale, | 6162 | mc501cb_50HZ, mc501cb_50HZScale, |
6162 | mc501cb_60HZ, mc501cb_60HZScale}, | 6163 | mc501cb_60HZ, mc501cb_60HZScale}, |
6163 | /* SENSOR_MI0360SOC 9 */ | 6164 | [SENSOR_MI0360SOC] = |
6164 | {mi360soc_AENoFliker, mi360soc_AENoFlikerScale, | 6165 | {mi360soc_AENoFliker, mi360soc_AENoFlikerScale, |
6165 | mi360soc_AE50HZ, mi360soc_AE50HZScale, | 6166 | mi360soc_AE50HZ, mi360soc_AE50HZScale, |
6166 | mi360soc_AE60HZ, mi360soc_AE60HZScale}, | 6167 | mi360soc_AE60HZ, mi360soc_AE60HZScale}, |
6167 | /* SENSOR_OV7620 10 */ | 6168 | [SENSOR_OV7620] = |
6168 | {ov7620_NoFliker, ov7620_NoFliker, | 6169 | {ov7620_NoFliker, ov7620_NoFliker, |
6169 | ov7620_50HZ, ov7620_50HZ, | 6170 | ov7620_50HZ, ov7620_50HZ, |
6170 | ov7620_60HZ, ov7620_60HZ}, | 6171 | ov7620_60HZ, ov7620_60HZ}, |
6171 | /* SENSOR_OV7630C 11 */ | 6172 | [SENSOR_OV7630C] = |
6172 | {NULL, NULL, | 6173 | {NULL, NULL, |
6173 | NULL, NULL, | 6174 | NULL, NULL, |
6174 | NULL, NULL}, | 6175 | NULL, NULL}, |
6175 | /* SENSOR_PAS106 12 */ | 6176 | [SENSOR_PAS106] = |
6176 | {pas106b_NoFliker, pas106b_NoFliker, | 6177 | {pas106b_NoFliker, pas106b_NoFliker, |
6177 | pas106b_50HZ, pas106b_50HZ, | 6178 | pas106b_50HZ, pas106b_50HZ, |
6178 | pas106b_60HZ, pas106b_60HZ}, | 6179 | pas106b_60HZ, pas106b_60HZ}, |
6179 | /* SENSOR_PAS202B 13 */ | 6180 | [SENSOR_PAS202B] = |
6180 | {pas202b_NoFliker, pas202b_NoFlikerScale, | 6181 | {pas202b_NoFliker, pas202b_NoFlikerScale, |
6181 | pas202b_50HZ, pas202b_50HZScale, | 6182 | pas202b_50HZ, pas202b_50HZScale, |
6182 | pas202b_60HZ, pas202b_60HZScale}, | 6183 | pas202b_60HZ, pas202b_60HZScale}, |
6183 | /* SENSOR_PB0330 14 */ | 6184 | [SENSOR_PB0330] = |
6184 | {pb0330_NoFliker, pb0330_NoFlikerScale, | 6185 | {pb0330_NoFliker, pb0330_NoFlikerScale, |
6185 | pb0330_50HZ, pb0330_50HZScale, | 6186 | pb0330_50HZ, pb0330_50HZScale, |
6186 | pb0330_60HZ, pb0330_60HZScale}, | 6187 | pb0330_60HZ, pb0330_60HZScale}, |
6187 | /* SENSOR_PO2030 15 */ | 6188 | [SENSOR_PO2030] = |
6188 | {po2030_NoFliker, po2030_NoFliker, | 6189 | {po2030_NoFliker, po2030_NoFliker, |
6189 | po2030_50HZ, po2030_50HZ, | 6190 | po2030_50HZ, po2030_50HZ, |
6190 | po2030_60HZ, po2030_60HZ}, | 6191 | po2030_60HZ, po2030_60HZ}, |
6191 | /* SENSOR_TAS5130CK 16 */ | 6192 | [SENSOR_TAS5130CK] = |
6192 | {tas5130cxx_NoFliker, tas5130cxx_NoFlikerScale, | 6193 | {tas5130c_NoFliker, tas5130c_NoFlikerScale, |
6193 | tas5130cxx_50HZ, tas5130cxx_50HZScale, | 6194 | tas5130c_50HZ, tas5130c_50HZScale, |
6194 | tas5130cxx_60HZ, tas5130cxx_60HZScale}, | 6195 | tas5130c_60HZ, tas5130c_60HZScale}, |
6195 | /* SENSOR_TAS5130CXX 17 */ | 6196 | [SENSOR_TAS5130C] = |
6196 | {tas5130cxx_NoFliker, tas5130cxx_NoFlikerScale, | 6197 | {tas5130c_NoFliker, tas5130c_NoFlikerScale, |
6197 | tas5130cxx_50HZ, tas5130cxx_50HZScale, | 6198 | tas5130c_50HZ, tas5130c_50HZScale, |
6198 | tas5130cxx_60HZ, tas5130cxx_60HZScale}, | 6199 | tas5130c_60HZ, tas5130c_60HZScale}, |
6199 | /* SENSOR_TAS5130C_VF0250 18 */ | 6200 | [SENSOR_TAS5130C_VF0250] = |
6200 | {tas5130c_vf0250_NoFliker, tas5130c_vf0250_NoFlikerScale, | 6201 | {tas5130c_vf0250_NoFliker, tas5130c_vf0250_NoFlikerScale, |
6201 | tas5130c_vf0250_50HZ, tas5130c_vf0250_50HZScale, | 6202 | tas5130c_vf0250_50HZ, tas5130c_vf0250_50HZScale, |
6202 | tas5130c_vf0250_60HZ, tas5130c_vf0250_60HZScale}, | 6203 | tas5130c_vf0250_60HZ, tas5130c_vf0250_60HZScale}, |
@@ -6207,27 +6208,27 @@ static int setlightfreq(struct gspca_dev *gspca_dev) | |||
6207 | if (mode) | 6208 | if (mode) |
6208 | i++; /* 320x240 */ | 6209 | i++; /* 320x240 */ |
6209 | zc3_freq = freq_tb[sd->sensor][i]; | 6210 | zc3_freq = freq_tb[sd->sensor][i]; |
6210 | if (zc3_freq != NULL) { | 6211 | if (zc3_freq == NULL) |
6211 | usb_exchange(gspca_dev, zc3_freq); | 6212 | return 0; |
6212 | switch (sd->sensor) { | 6213 | usb_exchange(gspca_dev, zc3_freq); |
6213 | case SENSOR_GC0305: | 6214 | switch (sd->sensor) { |
6214 | if (mode /* if 320x240 */ | 6215 | case SENSOR_GC0305: |
6215 | && sd->lightfreq == 1) /* and 50Hz */ | 6216 | if (mode /* if 320x240 */ |
6216 | reg_w(gspca_dev->dev, 0x85, 0x018d); | 6217 | && sd->lightfreq == 1) /* and 50Hz */ |
6217 | /* win: 0x80, 0x018d */ | 6218 | reg_w(gspca_dev->dev, 0x85, 0x018d); |
6218 | break; | 6219 | /* win: 0x80, 0x018d */ |
6219 | case SENSOR_OV7620: | 6220 | break; |
6220 | if (!mode) { /* if 640x480 */ | 6221 | case SENSOR_OV7620: |
6221 | if (sd->lightfreq != 0) /* and 50 or 60 Hz */ | 6222 | if (!mode) { /* if 640x480 */ |
6222 | reg_w(gspca_dev->dev, 0x40, 0x0002); | 6223 | if (sd->lightfreq != 0) /* and 50 or 60 Hz */ |
6223 | else | 6224 | reg_w(gspca_dev->dev, 0x40, 0x0002); |
6224 | reg_w(gspca_dev->dev, 0x44, 0x0002); | 6225 | else |
6225 | } | 6226 | reg_w(gspca_dev->dev, 0x44, 0x0002); |
6226 | break; | ||
6227 | case SENSOR_PAS202B: | ||
6228 | reg_w(gspca_dev->dev, 0x00, 0x01a7); | ||
6229 | break; | ||
6230 | } | 6227 | } |
6228 | break; | ||
6229 | case SENSOR_PAS202B: | ||
6230 | reg_w(gspca_dev->dev, 0x00, 0x01a7); | ||
6231 | break; | ||
6231 | } | 6232 | } |
6232 | return 0; | 6233 | return 0; |
6233 | } | 6234 | } |
@@ -6442,17 +6443,14 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev) | |||
6442 | retword |= reg_r(gspca_dev, 0x000a); | 6443 | retword |= reg_r(gspca_dev, 0x000a); |
6443 | PDEBUG(D_PROBE, "probe 3wr vga 1 0x%04x", retword); | 6444 | PDEBUG(D_PROBE, "probe 3wr vga 1 0x%04x", retword); |
6444 | reg_r(gspca_dev, 0x0010); | 6445 | reg_r(gspca_dev, 0x0010); |
6445 | /* value 0x4001 is meaningless */ | 6446 | if ((retword & 0xff00) == 0x6400) |
6446 | if (retword != 0x4001) { | 6447 | return 0x02; /* TAS5130C */ |
6447 | if ((retword & 0xff00) == 0x6400) | 6448 | for (i = 0; i < ARRAY_SIZE(chipset_revision_sensor); i++) { |
6448 | return 0x02; /* TAS5130C */ | 6449 | if (chipset_revision_sensor[i].revision == retword) { |
6449 | for (i = 0; i < ARRAY_SIZE(chipset_revision_sensor); i++) { | 6450 | sd->chip_revision = retword; |
6450 | if (chipset_revision_sensor[i].revision == retword) { | 6451 | send_unknown(dev, SENSOR_PB0330); |
6451 | sd->chip_revision = retword; | 6452 | return chipset_revision_sensor[i] |
6452 | send_unknown(dev, SENSOR_PB0330); | 6453 | .internal_sensor_id; |
6453 | return chipset_revision_sensor[i] | ||
6454 | .internal_sensor_id; | ||
6455 | } | ||
6456 | } | 6454 | } |
6457 | } | 6455 | } |
6458 | 6456 | ||
@@ -6464,7 +6462,7 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev) | |||
6464 | reg_w(dev, 0x01, 0x0012); | 6462 | reg_w(dev, 0x01, 0x0012); |
6465 | retword = i2c_read(gspca_dev, 0x00); | 6463 | retword = i2c_read(gspca_dev, 0x00); |
6466 | if (retword != 0) { | 6464 | if (retword != 0) { |
6467 | PDEBUG(D_PROBE, "probe 3wr vga type 0a ?"); | 6465 | PDEBUG(D_PROBE, "probe 3wr vga type 0a"); |
6468 | return 0x0a; /* PB0330 */ | 6466 | return 0x0a; /* PB0330 */ |
6469 | } | 6467 | } |
6470 | 6468 | ||
@@ -6563,46 +6561,46 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
6563 | struct cam *cam; | 6561 | struct cam *cam; |
6564 | int sensor; | 6562 | int sensor; |
6565 | static const u8 gamma[SENSOR_MAX] = { | 6563 | static const u8 gamma[SENSOR_MAX] = { |
6566 | 4, /* SENSOR_ADCM2700 0 */ | 6564 | [SENSOR_ADCM2700] = 4, |
6567 | 4, /* SENSOR_CS2102 1 */ | 6565 | [SENSOR_CS2102] = 4, |
6568 | 5, /* SENSOR_CS2102K 2 */ | 6566 | [SENSOR_CS2102K] = 5, |
6569 | 4, /* SENSOR_GC0305 3 */ | 6567 | [SENSOR_GC0305] = 4, |
6570 | 4, /* SENSOR_HDCS2020b 4 */ | 6568 | [SENSOR_HDCS2020b] = 4, |
6571 | 4, /* SENSOR_HV7131B 5 */ | 6569 | [SENSOR_HV7131B] = 4, |
6572 | 4, /* SENSOR_HV7131C 6 */ | 6570 | [SENSOR_HV7131R] = 4, |
6573 | 4, /* SENSOR_ICM105A 7 */ | 6571 | [SENSOR_ICM105A] = 4, |
6574 | 4, /* SENSOR_MC501CB 8 */ | 6572 | [SENSOR_MC501CB] = 4, |
6575 | 4, /* SENSOR_MI0360SOC 9 */ | 6573 | [SENSOR_MI0360SOC] = 4, |
6576 | 3, /* SENSOR_OV7620 10 */ | 6574 | [SENSOR_OV7620] = 3, |
6577 | 4, /* SENSOR_OV7630C 11 */ | 6575 | [SENSOR_OV7630C] = 4, |
6578 | 4, /* SENSOR_PAS106 12 */ | 6576 | [SENSOR_PAS106] = 4, |
6579 | 4, /* SENSOR_PAS202B 13 */ | 6577 | [SENSOR_PAS202B] = 4, |
6580 | 4, /* SENSOR_PB0330 14 */ | 6578 | [SENSOR_PB0330] = 4, |
6581 | 4, /* SENSOR_PO2030 15 */ | 6579 | [SENSOR_PO2030] = 4, |
6582 | 4, /* SENSOR_TAS5130CK 16 */ | 6580 | [SENSOR_TAS5130CK] = 4, |
6583 | 3, /* SENSOR_TAS5130CXX 17 */ | 6581 | [SENSOR_TAS5130C] = 3, |
6584 | 3, /* SENSOR_TAS5130C_VF0250 18 */ | 6582 | [SENSOR_TAS5130C_VF0250] = 3, |
6585 | }; | 6583 | }; |
6586 | static const u8 mode_tb[SENSOR_MAX] = { | 6584 | static const u8 mode_tb[SENSOR_MAX] = { |
6587 | 2, /* SENSOR_ADCM2700 0 */ | 6585 | [SENSOR_ADCM2700] = 2, |
6588 | 1, /* SENSOR_CS2102 1 */ | 6586 | [SENSOR_CS2102] = 1, |
6589 | 1, /* SENSOR_CS2102K 2 */ | 6587 | [SENSOR_CS2102K] = 1, |
6590 | 1, /* SENSOR_GC0305 3 */ | 6588 | [SENSOR_GC0305] = 1, |
6591 | 1, /* SENSOR_HDCS2020b 4 */ | 6589 | [SENSOR_HDCS2020b] = 1, |
6592 | 1, /* SENSOR_HV7131B 5 */ | 6590 | [SENSOR_HV7131B] = 1, |
6593 | 1, /* SENSOR_HV7131C 6 */ | 6591 | [SENSOR_HV7131R] = 1, |
6594 | 1, /* SENSOR_ICM105A 7 */ | 6592 | [SENSOR_ICM105A] = 1, |
6595 | 2, /* SENSOR_MC501CB 8 */ | 6593 | [SENSOR_MC501CB] = 2, |
6596 | 1, /* SENSOR_MI0360SOC 9 */ | 6594 | [SENSOR_MI0360SOC] = 1, |
6597 | 2, /* SENSOR_OV7620 10 */ | 6595 | [SENSOR_OV7620] = 2, |
6598 | 1, /* SENSOR_OV7630C 11 */ | 6596 | [SENSOR_OV7630C] = 1, |
6599 | 0, /* SENSOR_PAS106 12 */ | 6597 | [SENSOR_PAS106] = 0, |
6600 | 1, /* SENSOR_PAS202B 13 */ | 6598 | [SENSOR_PAS202B] = 1, |
6601 | 1, /* SENSOR_PB0330 14 */ | 6599 | [SENSOR_PB0330] = 1, |
6602 | 1, /* SENSOR_PO2030 15 */ | 6600 | [SENSOR_PO2030] = 1, |
6603 | 1, /* SENSOR_TAS5130CK 16 */ | 6601 | [SENSOR_TAS5130CK] = 1, |
6604 | 1, /* SENSOR_TAS5130CXX 17 */ | 6602 | [SENSOR_TAS5130C] = 1, |
6605 | 1, /* SENSOR_TAS5130C_VF0250 18 */ | 6603 | [SENSOR_TAS5130C_VF0250] = 1, |
6606 | }; | 6604 | }; |
6607 | 6605 | ||
6608 | /* define some sensors from the vendor/product */ | 6606 | /* define some sensors from the vendor/product */ |
@@ -6626,8 +6624,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
6626 | break; | 6624 | break; |
6627 | default: | 6625 | default: |
6628 | PDEBUG(D_PROBE, | 6626 | PDEBUG(D_PROBE, |
6629 | "Sensor UNKNOWN_0 force Tas5130"); | 6627 | "Unknown sensor - set to TAS5130C"); |
6630 | sd->sensor = SENSOR_TAS5130CXX; | 6628 | sd->sensor = SENSOR_TAS5130C; |
6631 | } | 6629 | } |
6632 | break; | 6630 | break; |
6633 | case 0: | 6631 | case 0: |
@@ -6642,14 +6640,14 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
6642 | break; | 6640 | break; |
6643 | default: | 6641 | default: |
6644 | /* case 2: * hv7131r */ | 6642 | /* case 2: * hv7131r */ |
6645 | PDEBUG(D_PROBE, "Find Sensor HV7131R(c)"); | 6643 | PDEBUG(D_PROBE, "Find Sensor HV7131R"); |
6646 | sd->sensor = SENSOR_HV7131C; | 6644 | sd->sensor = SENSOR_HV7131R; |
6647 | break; | 6645 | break; |
6648 | } | 6646 | } |
6649 | break; | 6647 | break; |
6650 | case 0x02: | 6648 | case 0x02: |
6651 | PDEBUG(D_PROBE, "Sensor TAS5130C"); | 6649 | PDEBUG(D_PROBE, "Sensor TAS5130C"); |
6652 | sd->sensor = SENSOR_TAS5130CXX; | 6650 | sd->sensor = SENSOR_TAS5130C; |
6653 | break; | 6651 | break; |
6654 | case 0x04: | 6652 | case 0x04: |
6655 | PDEBUG(D_PROBE, "Find Sensor CS2102"); | 6653 | PDEBUG(D_PROBE, "Find Sensor CS2102"); |
@@ -6681,11 +6679,11 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
6681 | case 0x10: | 6679 | case 0x10: |
6682 | case 0x12: | 6680 | case 0x12: |
6683 | PDEBUG(D_PROBE, "Find Sensor TAS5130C"); | 6681 | PDEBUG(D_PROBE, "Find Sensor TAS5130C"); |
6684 | sd->sensor = SENSOR_TAS5130CXX; | 6682 | sd->sensor = SENSOR_TAS5130C; |
6685 | break; | 6683 | break; |
6686 | case 0x11: | 6684 | case 0x11: |
6687 | PDEBUG(D_PROBE, "Find Sensor HV7131R(c)"); | 6685 | PDEBUG(D_PROBE, "Find Sensor HV7131R"); |
6688 | sd->sensor = SENSOR_HV7131C; | 6686 | sd->sensor = SENSOR_HV7131R; |
6689 | break; | 6687 | break; |
6690 | case 0x13: | 6688 | case 0x13: |
6691 | PDEBUG(D_PROBE, | 6689 | PDEBUG(D_PROBE, |
@@ -6772,7 +6770,7 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
6772 | 6770 | ||
6773 | switch (sd->sensor) { | 6771 | switch (sd->sensor) { |
6774 | case SENSOR_HV7131B: | 6772 | case SENSOR_HV7131B: |
6775 | case SENSOR_HV7131C: | 6773 | case SENSOR_HV7131R: |
6776 | case SENSOR_OV7630C: | 6774 | case SENSOR_OV7630C: |
6777 | gspca_dev->ctrl_dis = (1 << LIGHTFREQ_IDX); | 6775 | gspca_dev->ctrl_dis = (1 << LIGHTFREQ_IDX); |
6778 | break; | 6776 | break; |
@@ -6795,26 +6793,44 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
6795 | struct usb_device *dev = gspca_dev->dev; | 6793 | struct usb_device *dev = gspca_dev->dev; |
6796 | int mode; | 6794 | int mode; |
6797 | static const struct usb_action *init_tb[SENSOR_MAX][2] = { | 6795 | static const struct usb_action *init_tb[SENSOR_MAX][2] = { |
6798 | {adcm2700_Initial, adcm2700_InitialScale}, /* 0 */ | 6796 | [SENSOR_ADCM2700] = |
6799 | {cs2102_Initial, cs2102_InitialScale}, /* 1 */ | 6797 | {adcm2700_Initial, adcm2700_InitialScale}, |
6800 | {cs2102K_Initial, cs2102K_InitialScale}, /* 2 */ | 6798 | [SENSOR_CS2102] = |
6801 | {gc0305_Initial, gc0305_InitialScale}, /* 3 */ | 6799 | {cs2102_Initial, cs2102_InitialScale}, |
6802 | {hdcs2020b_Initial, hdcs2020b_InitialScale}, /* 4 */ | 6800 | [SENSOR_CS2102K] = |
6803 | {hv7131b_Initial, hv7131b_InitialScale}, /* 5 */ | 6801 | {cs2102K_Initial, cs2102K_InitialScale}, |
6804 | {hv7131r_Initial, hv7131r_InitialScale}, /* 6 */ | 6802 | [SENSOR_GC0305] = |
6805 | {icm105a_Initial, icm105a_InitialScale}, /* 7 */ | 6803 | {gc0305_Initial, gc0305_InitialScale}, |
6806 | {mc501cb_Initial, mc501cb_InitialScale}, /* 8 */ | 6804 | [SENSOR_HDCS2020b] = |
6807 | {mi0360soc_Initial, mi0360soc_InitialScale}, /* 9 */ | 6805 | {hdcs2020b_Initial, hdcs2020b_InitialScale}, |
6808 | {ov7620_Initial, ov7620_InitialScale}, /* 10 */ | 6806 | [SENSOR_HV7131B] = |
6809 | {ov7630c_Initial, ov7630c_InitialScale}, /* 11 */ | 6807 | {hv7131b_Initial, hv7131b_InitialScale}, |
6810 | {pas106b_Initial, pas106b_InitialScale}, /* 12 */ | 6808 | [SENSOR_HV7131R] = |
6811 | {pas202b_Initial, pas202b_InitialScale}, /* 13 */ | 6809 | {hv7131r_Initial, hv7131r_InitialScale}, |
6812 | {pb0330_Initial, pb0330_InitialScale}, /* 14 */ | 6810 | [SENSOR_ICM105A] = |
6813 | {po2030_Initial, po2030_InitialScale}, /* 15 */ | 6811 | {icm105a_Initial, icm105a_InitialScale}, |
6814 | {tas5130cK_Initial, tas5130cK_InitialScale}, /* 16 */ | 6812 | [SENSOR_MC501CB] = |
6815 | {tas5130cxx_Initial, tas5130cxx_InitialScale}, /* 17 */ | 6813 | {mc501cb_Initial, mc501cb_InitialScale}, |
6814 | [SENSOR_MI0360SOC] = | ||
6815 | {mi0360soc_Initial, mi0360soc_InitialScale}, | ||
6816 | [SENSOR_OV7620] = | ||
6817 | {ov7620_Initial, ov7620_InitialScale}, | ||
6818 | [SENSOR_OV7630C] = | ||
6819 | {ov7630c_Initial, ov7630c_InitialScale}, | ||
6820 | [SENSOR_PAS106] = | ||
6821 | {pas106b_Initial, pas106b_InitialScale}, | ||
6822 | [SENSOR_PAS202B] = | ||
6823 | {pas202b_Initial, pas202b_InitialScale}, | ||
6824 | [SENSOR_PB0330] = | ||
6825 | {pb0330_Initial, pb0330_InitialScale}, | ||
6826 | [SENSOR_PO2030] = | ||
6827 | {po2030_Initial, po2030_InitialScale}, | ||
6828 | [SENSOR_TAS5130CK] = | ||
6829 | {tas5130cK_Initial, tas5130cK_InitialScale}, | ||
6830 | [SENSOR_TAS5130C] = | ||
6831 | {tas5130c_Initial, tas5130c_InitialScale}, | ||
6832 | [SENSOR_TAS5130C_VF0250] = | ||
6816 | {tas5130c_vf0250_Initial, tas5130c_vf0250_InitialScale}, | 6833 | {tas5130c_vf0250_Initial, tas5130c_vf0250_InitialScale}, |
6817 | /* 18 */ | ||
6818 | }; | 6834 | }; |
6819 | 6835 | ||
6820 | /* create the JPEG header */ | 6836 | /* create the JPEG header */ |
@@ -6824,7 +6840,7 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
6824 | 6840 | ||
6825 | mode = gspca_dev->cam.cam_mode[gspca_dev->curr_mode].priv; | 6841 | mode = gspca_dev->cam.cam_mode[gspca_dev->curr_mode].priv; |
6826 | switch (sd->sensor) { | 6842 | switch (sd->sensor) { |
6827 | case SENSOR_HV7131C: | 6843 | case SENSOR_HV7131R: |
6828 | zcxx_probeSensor(gspca_dev); | 6844 | zcxx_probeSensor(gspca_dev); |
6829 | break; | 6845 | break; |
6830 | case SENSOR_PAS106: | 6846 | case SENSOR_PAS106: |
@@ -6838,13 +6854,13 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
6838 | case SENSOR_GC0305: | 6854 | case SENSOR_GC0305: |
6839 | case SENSOR_OV7620: | 6855 | case SENSOR_OV7620: |
6840 | case SENSOR_PO2030: | 6856 | case SENSOR_PO2030: |
6841 | case SENSOR_TAS5130CXX: | 6857 | case SENSOR_TAS5130C: |
6842 | case SENSOR_TAS5130C_VF0250: | 6858 | case SENSOR_TAS5130C_VF0250: |
6843 | /* msleep(100); * ?? */ | 6859 | /* msleep(100); * ?? */ |
6844 | reg_r(gspca_dev, 0x0002); /* --> 0x40 */ | 6860 | reg_r(gspca_dev, 0x0002); /* --> 0x40 */ |
6845 | reg_w(dev, 0x09, 0x01ad); /* (from win traces) */ | 6861 | reg_w(dev, 0x09, 0x01ad); /* (from win traces) */ |
6846 | reg_w(dev, 0x15, 0x01ae); | 6862 | reg_w(dev, 0x15, 0x01ae); |
6847 | if (sd->sensor == SENSOR_TAS5130CXX) | 6863 | if (sd->sensor == SENSOR_TAS5130C) |
6848 | break; | 6864 | break; |
6849 | reg_w(dev, 0x0d, 0x003a); | 6865 | reg_w(dev, 0x0d, 0x003a); |
6850 | reg_w(dev, 0x02, 0x003b); | 6866 | reg_w(dev, 0x02, 0x003b); |
@@ -6866,7 +6882,7 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
6866 | break; | 6882 | break; |
6867 | case SENSOR_PAS202B: | 6883 | case SENSOR_PAS202B: |
6868 | case SENSOR_GC0305: | 6884 | case SENSOR_GC0305: |
6869 | case SENSOR_TAS5130CXX: | 6885 | case SENSOR_TAS5130C: |
6870 | reg_r(gspca_dev, 0x0008); | 6886 | reg_r(gspca_dev, 0x0008); |
6871 | /* fall thru */ | 6887 | /* fall thru */ |
6872 | case SENSOR_PO2030: | 6888 | case SENSOR_PO2030: |
@@ -6908,7 +6924,7 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
6908 | reg_w(dev, 0x40, 0x0117); | 6924 | reg_w(dev, 0x40, 0x0117); |
6909 | break; | 6925 | break; |
6910 | case SENSOR_GC0305: | 6926 | case SENSOR_GC0305: |
6911 | case SENSOR_TAS5130CXX: | 6927 | case SENSOR_TAS5130C: |
6912 | reg_w(dev, 0x09, 0x01ad); /* (from win traces) */ | 6928 | reg_w(dev, 0x09, 0x01ad); /* (from win traces) */ |
6913 | reg_w(dev, 0x15, 0x01ae); | 6929 | reg_w(dev, 0x15, 0x01ae); |
6914 | /* fall thru */ | 6930 | /* fall thru */ |
@@ -7220,7 +7236,6 @@ static const __devinitdata struct usb_device_id device_table[] = { | |||
7220 | {USB_DEVICE(0x10fd, 0x8050)}, | 7236 | {USB_DEVICE(0x10fd, 0x8050)}, |
7221 | {} /* end of entry */ | 7237 | {} /* end of entry */ |
7222 | }; | 7238 | }; |
7223 | #undef DVNAME | ||
7224 | MODULE_DEVICE_TABLE(usb, device_table); | 7239 | MODULE_DEVICE_TABLE(usb, device_table); |
7225 | 7240 | ||
7226 | /* -- device connect -- */ | 7241 | /* -- device connect -- */ |