aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2008-07-21 04:42:17 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-23 18:00:31 -0400
commit63fc4a038d8ca5e2da8c14c01b16876685beacf4 (patch)
treea13970979232f3049f3b4f33902d7036e8a2137f /drivers/media/video
parentbb64e86c3ad55e70a8001d87c050fd3a82004d17 (diff)
V4L/DVB (8438): gspca: Lack of matrix for zc3xx - tas5130c (vf0250).
Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/gspca/zc3xx.c362
1 files changed, 185 insertions, 177 deletions
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c
index b761b11c5c6a..f8d6f1780a45 100644
--- a/drivers/media/video/gspca/zc3xx.c
+++ b/drivers/media/video/gspca/zc3xx.c
@@ -24,9 +24,6 @@
24 24
25#include "gspca.h" 25#include "gspca.h"
26 26
27#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7)
28static const char version[] = "2.1.7";
29
30MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>, " 27MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>, "
31 "Serge A. Suchkov <Serge.A.S@tochka.ru>"); 28 "Serge A. Suchkov <Serge.A.S@tochka.ru>");
32MODULE_DESCRIPTION("GSPCA ZC03xx/VC3xx USB Camera Driver"); 29MODULE_DESCRIPTION("GSPCA ZC03xx/VC3xx USB Camera Driver");
@@ -49,7 +46,7 @@ struct sd {
49 __u8 sharpness; 46 __u8 sharpness;
50 47
51 char qindex; 48 char qindex;
52 char sensor; /* Type of image sensor chip */ 49 signed char sensor; /* Type of image sensor chip */
53/* !! values used in different tables */ 50/* !! values used in different tables */
54#define SENSOR_CS2102 0 51#define SENSOR_CS2102 0
55#define SENSOR_CS2102K 1 52#define SENSOR_CS2102K 1
@@ -2205,10 +2202,10 @@ static const struct usb_action hdcs2020xb_InitialScale[] = {
2205}; 2202};
2206static const struct usb_action hdcs2020b_50HZ[] = { 2203static const struct usb_action hdcs2020b_50HZ[] = {
2207 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ 2204 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2208 {0xaa, 0x13, 0x0018}, /* 00,13,18,aa */ 2205 {0xaa, 0x13, 0x0018}, /* 00,13,18,aa */
2209 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */ 2206 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
2210 {0xaa, 0x0e, 0x0005}, /* 00,0e,05,aa */ 2207 {0xaa, 0x0e, 0x0005}, /* 00,0e,05,aa */
2211 {0xaa, 0x19, 0x001f}, /* 00,19,1f,aa */ 2208 {0xaa, 0x19, 0x001f}, /* 00,19,1f,aa */
2212 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */ 2209 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2213 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */ 2210 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
2214 {0xa0, 0x76, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,76,cc */ 2211 {0xa0, 0x76, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,76,cc */
@@ -2226,10 +2223,10 @@ static const struct usb_action hdcs2020b_50HZ[] = {
2226}; 2223};
2227static const struct usb_action hdcs2020b_60HZ[] = { 2224static const struct usb_action hdcs2020b_60HZ[] = {
2228 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ 2225 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2229 {0xaa, 0x13, 0x0031}, /* 00,13,31,aa */ 2226 {0xaa, 0x13, 0x0031}, /* 00,13,31,aa */
2230 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */ 2227 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
2231 {0xaa, 0x0e, 0x0004}, /* 00,0e,04,aa */ 2228 {0xaa, 0x0e, 0x0004}, /* 00,0e,04,aa */
2232 {0xaa, 0x19, 0x00cd}, /* 00,19,cd,aa */ 2229 {0xaa, 0x19, 0x00cd}, /* 00,19,cd,aa */
2233 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */ 2230 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2234 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */ 2231 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
2235 {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,62,cc */ 2232 {0xa0, 0x62, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,62,cc */
@@ -2247,10 +2244,10 @@ static const struct usb_action hdcs2020b_60HZ[] = {
2247}; 2244};
2248static const struct usb_action hdcs2020b_NoFliker[] = { 2245static const struct usb_action hdcs2020b_NoFliker[] = {
2249 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ 2246 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
2250 {0xaa, 0x13, 0x0010}, /* 00,13,10,aa */ 2247 {0xaa, 0x13, 0x0010}, /* 00,13,10,aa */
2251 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */ 2248 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
2252 {0xaa, 0x0e, 0x0004}, /* 00,0e,04,aa */ 2249 {0xaa, 0x0e, 0x0004}, /* 00,0e,04,aa */
2253 {0xaa, 0x19, 0x0000}, /* 00,19,00,aa */ 2250 {0xaa, 0x19, 0x0000}, /* 00,19,00,aa */
2254 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */ 2251 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */
2255 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */ 2252 {0xa0, 0x02, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,02,cc */
2256 {0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */ 2253 {0xa0, 0x70, ZC3XX_R192_EXPOSURELIMITLOW}, /* 01,92,70,cc */
@@ -4102,27 +4099,27 @@ static const struct usb_action pas106b_Initial_com[] = {
4102 4099
4103static const struct usb_action pas106b_Initial[] = { /* 176x144 */ 4100static const struct usb_action pas106b_Initial[] = { /* 176x144 */
4104/* JPEG control */ 4101/* JPEG control */
4105 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* ClockSetting */ 4102 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4106/* Sream and Sensor specific */ 4103/* Sream and Sensor specific */
4107 {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT}, /* CMOSSensorSelect */ 4104 {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT},
4108/* Picture size */ 4105/* Picture size */
4109 {0xa0, 0x00, ZC3XX_R003_FRAMEWIDTHHIGH}, /* FrameWidthHigh 00 */ 4106 {0xa0, 0x00, ZC3XX_R003_FRAMEWIDTHHIGH},
4110 {0xa0, 0xb0, ZC3XX_R004_FRAMEWIDTHLOW}, /* FrameWidthLow B0 */ 4107 {0xa0, 0xb0, ZC3XX_R004_FRAMEWIDTHLOW},
4111 {0xa0, 0x00, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* FrameHeightHigh 00 */ 4108 {0xa0, 0x00, ZC3XX_R005_FRAMEHEIGHTHIGH},
4112 {0xa0, 0x90, ZC3XX_R006_FRAMEHEIGHTLOW}, /* FrameHightLow 90 */ 4109 {0xa0, 0x90, ZC3XX_R006_FRAMEHEIGHTLOW},
4113/* System */ 4110/* System */
4114 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* SystemOperating */ 4111 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4115/* Sream and Sensor specific */ 4112/* Sream and Sensor specific */
4116 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* VideoControlFunction */ 4113 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
4117 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* VideoControlFunction */ 4114 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
4118/* Sensor Interface */ 4115/* Sensor Interface */
4119 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* Compatibily Mode */ 4116 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
4120/* Window inside sensor array */ 4117/* Window inside sensor array */
4121 {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW}, /* WinXStartLow */ 4118 {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
4122 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* FirstYLow */ 4119 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4123 {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW}, /* FirstxLow */ 4120 {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
4124 {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW}, /* WinHeightLow */ 4121 {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW},
4125 {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW}, /* WinWidthLow */ 4122 {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW},
4126/* Init the sensor */ 4123/* Init the sensor */
4127 {0xaa, 0x02, 0x0004}, 4124 {0xaa, 0x02, 0x0004},
4128 {0xaa, 0x08, 0x0000}, 4125 {0xaa, 0x08, 0x0000},
@@ -4135,40 +4132,40 @@ static const struct usb_action pas106b_Initial[] = { /* 176x144 */
4135 {0xaa, 0x14, 0x0081}, 4132 {0xaa, 0x14, 0x0081},
4136 4133
4137/* Other registors */ 4134/* Other registors */
4138 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* SensorCorrection */ 4135 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4139/* Frame retreiving */ 4136/* Frame retreiving */
4140 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* AutoAdjustFPS */ 4137 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4141/* Gains */ 4138/* Gains */
4142 {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN}, /* DigitalGain */ 4139 {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN},
4143/* Unknown */ 4140/* Unknown */
4144 {0xa0, 0x00, 0x01ad}, 4141 {0xa0, 0x00, 0x01ad},
4145/* Sharpness */ 4142/* Sharpness */
4146 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* SharpnessMode */ 4143 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4147 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* Sharpness05 */ 4144 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4148/* Other registors */ 4145/* Other registors */
4149 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* OperationMode */ 4146 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4150/* Auto exposure and white balance */ 4147/* Auto exposure and white balance */
4151 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* AWBStatus */ 4148 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4152/*Dead pixels */ 4149/*Dead pixels */
4153 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* DeadPixelsMode */ 4150 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4154/* EEPROM */ 4151/* EEPROM */
4155 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* EEPROMAccess */ 4152 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4156/* JPEG control */ 4153/* JPEG control */
4157 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* ClockSetting */ 4154 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4158 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */ 4155 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
4159 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */ 4156 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
4160/* Other registers */ 4157/* Other registers */
4161 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* OperationMode */ 4158 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4162/* Auto exposure and white balance */ 4159/* Auto exposure and white balance */
4163 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* AWBStatus */ 4160 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4164/*Dead pixels */ 4161/*Dead pixels */
4165 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* DeadPixelsMode */ 4162 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4166/* EEPROM */ 4163/* EEPROM */
4167 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* EEPROMAccess */ 4164 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4168/* JPEG control */ 4165/* JPEG control */
4169 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* ClockSetting */ 4166 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4170 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */ 4167 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
4171 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */ 4168 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
4172 4169
4173 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */ 4170 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
4174 {0xa0, 0xf4, ZC3XX_R10B_RGB01}, 4171 {0xa0, 0xf4, ZC3XX_R10B_RGB01},
@@ -4180,67 +4177,67 @@ static const struct usb_action pas106b_Initial[] = { /* 176x144 */
4180 {0xa0, 0xf4, ZC3XX_R111_RGB21}, 4177 {0xa0, 0xf4, ZC3XX_R111_RGB21},
4181 {0xa0, 0x58, ZC3XX_R112_RGB22}, 4178 {0xa0, 0x58, ZC3XX_R112_RGB22},
4182/* Auto correction */ 4179/* Auto correction */
4183 {0xa0, 0x03, ZC3XX_R181_WINXSTART}, /* WinXstart */ 4180 {0xa0, 0x03, ZC3XX_R181_WINXSTART},
4184 {0xa0, 0x08, ZC3XX_R182_WINXWIDTH}, /* WinXWidth */ 4181 {0xa0, 0x08, ZC3XX_R182_WINXWIDTH},
4185 {0xa0, 0x16, ZC3XX_R183_WINXCENTER}, /* WinXCenter */ 4182 {0xa0, 0x16, ZC3XX_R183_WINXCENTER},
4186 {0xa0, 0x03, ZC3XX_R184_WINYSTART}, /* WinYStart */ 4183 {0xa0, 0x03, ZC3XX_R184_WINYSTART},
4187 {0xa0, 0x05, ZC3XX_R185_WINYWIDTH}, /* WinYWidth */ 4184 {0xa0, 0x05, ZC3XX_R185_WINYWIDTH},
4188 {0xa0, 0x14, ZC3XX_R186_WINYCENTER}, /* WinYCenter */ 4185 {0xa0, 0x14, ZC3XX_R186_WINYCENTER},
4189 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE}, /* AutoCorrectEnable */ 4186 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4190 4187
4191/* Auto exposure and white balance */ 4188/* Auto exposure and white balance */
4192 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* ExposureLimitHigh */ 4189 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4193 {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID}, /* ExposureLimitMid */ 4190 {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
4194 {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW}, /* ExposureLimitLow */ 4191 {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW},
4195 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* AntiFlickerHigh */ 4192 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4196 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* AntiFlickerLow */ 4193 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4197 {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW}, /* AntiFlickerLow */ 4194 {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW},
4198 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE}, /* AEBFreeze */ 4195 {0xa0, 0x0c, ZC3XX_R18C_AEFREEZE},
4199 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE}, /* AEBUnfreeze */ 4196 {0xa0, 0x18, ZC3XX_R18F_AEUNFREEZE},
4200/* sensor on */ 4197/* sensor on */
4201 {0xaa, 0x07, 0x00b1}, 4198 {0xaa, 0x07, 0x00b1},
4202 {0xaa, 0x05, 0x0003}, 4199 {0xaa, 0x05, 0x0003},
4203 {0xaa, 0x04, 0x0001}, 4200 {0xaa, 0x04, 0x0001},
4204 {0xaa, 0x03, 0x003b}, 4201 {0xaa, 0x03, 0x003b},
4205/* Gains */ 4202/* Gains */
4206 {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* DigitalLimitDiff */ 4203 {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF},
4207 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* DigitalGainStep */ 4204 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
4208 {0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN}, /* GlobalGain */ 4205 {0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN},
4209 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN}, /* GlobalGain */ 4206 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4210/* Auto correction */ 4207/* Auto correction */
4211 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE}, /* AutoCorrectEnable */ 4208 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
4212 {0xa1, 0x01, 0x0180}, /* AutoCorrectEnable */ 4209 {0xa1, 0x01, 0x0180}, /* AutoCorrectEnable */
4213 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* AutoCorrectEnable */ 4210 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4214/* Gains */ 4211/* Gains */
4215 {0xa0, 0x40, ZC3XX_R116_RGAIN}, /* RGain */ 4212 {0xa0, 0x40, ZC3XX_R116_RGAIN},
4216 {0xa0, 0x40, ZC3XX_R117_GGAIN}, /* GGain */ 4213 {0xa0, 0x40, ZC3XX_R117_GGAIN},
4217 {0xa0, 0x40, ZC3XX_R118_BGAIN}, /* BGain */ 4214 {0xa0, 0x40, ZC3XX_R118_BGAIN},
4218 {} 4215 {}
4219}; 4216};
4220 4217
4221static const struct usb_action pas106b_InitialScale[] = { /* 352x288 */ 4218static const struct usb_action pas106b_InitialScale[] = { /* 352x288 */
4222/* JPEG control */ 4219/* JPEG control */
4223 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* ClockSetting */ 4220 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4224/* Sream and Sensor specific */ 4221/* Sream and Sensor specific */
4225 {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT}, /* CMOSSensorSelect */ 4222 {0xa0, 0x0f, ZC3XX_R010_CMOSSENSORSELECT},
4226/* Picture size */ 4223/* Picture size */
4227 {0xa0, 0x01, ZC3XX_R003_FRAMEWIDTHHIGH}, /* FrameWidthHigh */ 4224 {0xa0, 0x01, ZC3XX_R003_FRAMEWIDTHHIGH},
4228 {0xa0, 0x60, ZC3XX_R004_FRAMEWIDTHLOW}, /* FrameWidthLow */ 4225 {0xa0, 0x60, ZC3XX_R004_FRAMEWIDTHLOW},
4229 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, /* FrameHeightHigh */ 4226 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
4230 {0xa0, 0x20, ZC3XX_R006_FRAMEHEIGHTLOW}, /* FrameHightLow */ 4227 {0xa0, 0x20, ZC3XX_R006_FRAMEHEIGHTLOW},
4231/* System */ 4228/* System */
4232 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING}, /* SystemOperating */ 4229 {0xa0, 0x01, ZC3XX_R001_SYSTEMOPERATING},
4233/* Sream and Sensor specific */ 4230/* Sream and Sensor specific */
4234 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC}, /* VideoControlFunction */ 4231 {0xa0, 0x03, ZC3XX_R012_VIDEOCONTROLFUNC},
4235 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC}, /* VideoControlFunction */ 4232 {0xa0, 0x01, ZC3XX_R012_VIDEOCONTROLFUNC},
4236/* Sensor Interface */ 4233/* Sensor Interface */
4237 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE}, /* Compatibily Mode */ 4234 {0xa0, 0x08, ZC3XX_R08D_COMPABILITYMODE},
4238/* Window inside sensor array */ 4235/* Window inside sensor array */
4239 {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW}, /* WinXStartLow */ 4236 {0xa0, 0x03, ZC3XX_R09A_WINXSTARTLOW},
4240 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW}, /* FirstYLow */ 4237 {0xa0, 0x00, ZC3XX_R11A_FIRSTYLOW},
4241 {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW}, /* FirstxLow */ 4238 {0xa0, 0x03, ZC3XX_R11C_FIRSTXLOW},
4242 {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW}, /* WinHeightLow */ 4239 {0xa0, 0x28, ZC3XX_R09C_WINHEIGHTLOW},
4243 {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW}, /* WinWidthLow */ 4240 {0xa0, 0x68, ZC3XX_R09E_WINWIDTHLOW},
4244/* Init the sensor */ 4241/* Init the sensor */
4245 {0xaa, 0x02, 0x0004}, 4242 {0xaa, 0x02, 0x0004},
4246 {0xaa, 0x08, 0x0000}, 4243 {0xaa, 0x08, 0x0000},
@@ -4253,41 +4250,41 @@ static const struct usb_action pas106b_InitialScale[] = { /* 352x288 */
4253 {0xaa, 0x14, 0x0081}, 4250 {0xaa, 0x14, 0x0081},
4254 4251
4255/* Other registors */ 4252/* Other registors */
4256 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION}, /* SensorCorrection */ 4253 {0xa0, 0x37, ZC3XX_R101_SENSORCORRECTION},
4257/* Frame retreiving */ 4254/* Frame retreiving */
4258 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* AutoAdjustFPS */ 4255 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS},
4259/* Gains */ 4256/* Gains */
4260 {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN}, /* DigitalGain */ 4257 {0xa0, 0xa0, ZC3XX_R1A8_DIGITALGAIN},
4261/* Unknown */ 4258/* Unknown */
4262 {0xa0, 0x00, 0x01ad}, 4259 {0xa0, 0x00, 0x01ad},
4263/* Sharpness */ 4260/* Sharpness */
4264 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE}, /* SharpnessMode */ 4261 {0xa0, 0x03, ZC3XX_R1C5_SHARPNESSMODE},
4265 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05}, /* Sharpness05 */ 4262 {0xa0, 0x13, ZC3XX_R1CB_SHARPNESS05},
4266/* Other registors */ 4263/* Other registors */
4267 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* OperationMode */ 4264 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4268/* Auto exposure and white balance */ 4265/* Auto exposure and white balance */
4269 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* AWBStatus */ 4266 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4270 {0xa0, 0x80, ZC3XX_R18D_YTARGET}, /* ????????? */ 4267 {0xa0, 0x80, ZC3XX_R18D_YTARGET},
4271/*Dead pixels */ 4268/*Dead pixels */
4272 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* DeadPixelsMode */ 4269 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4273/* EEPROM */ 4270/* EEPROM */
4274 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* EEPROMAccess */ 4271 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4275/* JPEG control */ 4272/* JPEG control */
4276 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* ClockSetting */ 4273 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4277 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */ 4274 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
4278 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */ 4275 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
4279/* Other registers */ 4276/* Other registers */
4280 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE}, /* OperationMode */ 4277 {0xa0, 0x0d, ZC3XX_R100_OPERATIONMODE},
4281/* Auto exposure and white balance */ 4278/* Auto exposure and white balance */
4282 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS}, /* AWBStatus */ 4279 {0xa0, 0x06, ZC3XX_R189_AWBSTATUS},
4283/*Dead pixels */ 4280/*Dead pixels */
4284 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE}, /* DeadPixelsMode */ 4281 {0xa0, 0x08, ZC3XX_R250_DEADPIXELSMODE},
4285/* EEPROM */ 4282/* EEPROM */
4286 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS}, /* EEPROMAccess */ 4283 {0xa0, 0x08, ZC3XX_R301_EEPROMACCESS},
4287/* JPEG control */ 4284/* JPEG control */
4288 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* ClockSetting */ 4285 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4289 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */ 4286 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
4290 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05}, /* sharpness- */ 4287 {0xa0, 0x0f, ZC3XX_R1CB_SHARPNESS05},
4291 4288
4292 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */ 4289 {0xa0, 0x58, ZC3XX_R10A_RGB00}, /* matrix */
4293 {0xa0, 0xf4, ZC3XX_R10B_RGB01}, 4290 {0xa0, 0xf4, ZC3XX_R10B_RGB01},
@@ -4299,43 +4296,43 @@ static const struct usb_action pas106b_InitialScale[] = { /* 352x288 */
4299 {0xa0, 0xf4, ZC3XX_R111_RGB21}, 4296 {0xa0, 0xf4, ZC3XX_R111_RGB21},
4300 {0xa0, 0x58, ZC3XX_R112_RGB22}, 4297 {0xa0, 0x58, ZC3XX_R112_RGB22},
4301/* Auto correction */ 4298/* Auto correction */
4302 {0xa0, 0x03, ZC3XX_R181_WINXSTART}, /* WinXstart */ 4299 {0xa0, 0x03, ZC3XX_R181_WINXSTART},
4303 {0xa0, 0x08, ZC3XX_R182_WINXWIDTH}, /* WinXWidth */ 4300 {0xa0, 0x08, ZC3XX_R182_WINXWIDTH},
4304 {0xa0, 0x16, ZC3XX_R183_WINXCENTER}, /* WinXCenter */ 4301 {0xa0, 0x16, ZC3XX_R183_WINXCENTER},
4305 {0xa0, 0x03, ZC3XX_R184_WINYSTART}, /* WinYStart */ 4302 {0xa0, 0x03, ZC3XX_R184_WINYSTART},
4306 {0xa0, 0x05, ZC3XX_R185_WINYWIDTH}, /* WinYWidth */ 4303 {0xa0, 0x05, ZC3XX_R185_WINYWIDTH},
4307 {0xa0, 0x14, ZC3XX_R186_WINYCENTER}, /* WinYCenter */ 4304 {0xa0, 0x14, ZC3XX_R186_WINYCENTER},
4308 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE}, /* AutoCorrectEnable */ 4305 {0xa0, 0x00, ZC3XX_R180_AUTOCORRECTENABLE},
4309 4306
4310/* Auto exposure and white balance */ 4307/* Auto exposure and white balance */
4311 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* ExposureLimitHigh 0 */ 4308 {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH},
4312 {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID}, /* ExposureLimitMid */ 4309 {0xa0, 0x03, ZC3XX_R191_EXPOSURELIMITMID},
4313 {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW}, /* ExposureLimitLow 0xb1 */ 4310 {0xa0, 0xb1, ZC3XX_R192_EXPOSURELIMITLOW},
4314 4311
4315 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH}, /* AntiFlickerHigh 0x00 */ 4312 {0xa0, 0x00, ZC3XX_R195_ANTIFLICKERHIGH},
4316 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID}, /* AntiFlickerLow 0x00 */ 4313 {0xa0, 0x00, ZC3XX_R196_ANTIFLICKERMID},
4317 {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW}, /* AntiFlickerLow 0x87 */ 4314 {0xa0, 0x87, ZC3XX_R197_ANTIFLICKERLOW},
4318 4315
4319 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE}, /* AEBFreeze 0x10 0x0c */ 4316 {0xa0, 0x10, ZC3XX_R18C_AEFREEZE},
4320 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE}, /* AEBUnfreeze 0x30 0x18 */ 4317 {0xa0, 0x20, ZC3XX_R18F_AEUNFREEZE},
4321/* sensor on */ 4318/* sensor on */
4322 {0xaa, 0x07, 0x00b1}, 4319 {0xaa, 0x07, 0x00b1},
4323 {0xaa, 0x05, 0x0003}, 4320 {0xaa, 0x05, 0x0003},
4324 {0xaa, 0x04, 0x0001}, 4321 {0xaa, 0x04, 0x0001},
4325 {0xaa, 0x03, 0x003b}, 4322 {0xaa, 0x03, 0x003b},
4326/* Gains */ 4323/* Gains */
4327 {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF}, /* DigitalLimitDiff */ 4324 {0xa0, 0x20, ZC3XX_R1A9_DIGITALLIMITDIFF},
4328 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP}, /* DigitalGainStep */ 4325 {0xa0, 0x26, ZC3XX_R1AA_DIGITALGAINSTEP},
4329 {0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN}, /* GlobalGain */ 4326 {0xa0, 0xa0, ZC3XX_R11D_GLOBALGAIN},
4330 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN}, /* GlobalGain */ 4327 {0xa0, 0x60, ZC3XX_R11D_GLOBALGAIN},
4331/* Auto correction */ 4328/* Auto correction */
4332 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE}, /* AutoCorrectEnable */ 4329 {0xa0, 0x40, ZC3XX_R180_AUTOCORRECTENABLE},
4333 {0xa1, 0x01, 0x0180}, /* AutoCorrectEnable */ 4330 {0xa1, 0x01, 0x0180}, /* AutoCorrectEnable */
4334 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE}, /* AutoCorrectEnable */ 4331 {0xa0, 0x42, ZC3XX_R180_AUTOCORRECTENABLE},
4335/* Gains */ 4332/* Gains */
4336 {0xa0, 0x40, ZC3XX_R116_RGAIN}, /* RGain */ 4333 {0xa0, 0x40, ZC3XX_R116_RGAIN},
4337 {0xa0, 0x40, ZC3XX_R117_GGAIN}, /* GGain */ 4334 {0xa0, 0x40, ZC3XX_R117_GGAIN},
4338 {0xa0, 0x40, ZC3XX_R118_BGAIN}, /* BGain */ 4335 {0xa0, 0x40, ZC3XX_R118_BGAIN},
4339 4336
4340 {0xa0, 0x00, 0x0007}, /* AutoCorrectEnable */ 4337 {0xa0, 0x00, 0x0007}, /* AutoCorrectEnable */
4341 {0xa0, 0xff, ZC3XX_R018_FRAMELOST}, /* Frame adjust */ 4338 {0xa0, 0xff, ZC3XX_R018_FRAMELOST}, /* Frame adjust */
@@ -4459,8 +4456,8 @@ static const struct usb_action pb03303x_Initial[] = {
4459 {0xa0, 0x50, ZC3XX_R112_RGB22}, 4456 {0xa0, 0x50, ZC3XX_R112_RGB22},
4460 4457
4461 {0xa1, 0x01, 0x0008}, 4458 {0xa1, 0x01, 0x0008},
4462 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* clock ? */ 4459 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
4463 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00}, /* sharpness+ */ 4460 {0xa0, 0x08, ZC3XX_R1C6_SHARPNESS00},
4464 {0xa1, 0x01, 0x01c8}, 4461 {0xa1, 0x01, 0x01c8},
4465 {0xa1, 0x01, 0x01c9}, 4462 {0xa1, 0x01, 0x01c9},
4466 {0xa1, 0x01, 0x01ca}, 4463 {0xa1, 0x01, 0x01ca},
@@ -5984,7 +5981,7 @@ static const struct usb_action tas5130c_vf0250_Initial[] = {
5984 {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa, */ 5981 {0xaa, 0x1b, 0x0000}, /* 00,1b,00,aa, */
5985 {0xaa, 0x13, 0x0002}, /* 00,13,02,aa, */ 5982 {0xaa, 0x13, 0x0002}, /* 00,13,02,aa, */
5986 {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */ 5983 {0xaa, 0x15, 0x0004}, /* 00,15,04,aa */
5987 {0xaa, 0x01, 0x0000}, 5984/*?? {0xaa, 0x01, 0x0000}, */
5988 {0xaa, 0x01, 0x0000}, 5985 {0xaa, 0x01, 0x0000},
5989 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa, */ 5986 {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa, */
5990 {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa, */ 5987 {0xaa, 0x1c, 0x0017}, /* 00,1c,17,aa, */
@@ -6000,8 +5997,8 @@ static const struct usb_action tas5130c_vf0250_Initial[] = {
6000 {0xaa, 0x0f, 0x00a0}, /* 00,0f,a0,aa, */ 5997 {0xaa, 0x0f, 0x00a0}, /* 00,0f,a0,aa, */
6001 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa, */ 5998 {0xaa, 0x10, 0x0000}, /* 00,10,00,aa, */
6002 {0xaa, 0x11, 0x00a0}, /* 00,11,a0,aa, */ 5999 {0xaa, 0x11, 0x00a0}, /* 00,11,a0,aa, */
6003 {0xa0, 0x00, 0x0039}, 6000/*?? {0xa0, 0x00, 0x0039},
6004 {0xa1, 0x01, 0x0037}, 6001 {0xa1, 0x01, 0x0037}, */
6005 {0xaa, 0x16, 0x0001}, /* 00,16,01,aa, */ 6002 {0xaa, 0x16, 0x0001}, /* 00,16,01,aa, */
6006 {0xaa, 0x17, 0x00e8}, /* 00,17,e6,aa, (e6 -> e8) */ 6003 {0xaa, 0x17, 0x00e8}, /* 00,17,e6,aa, (e6 -> e8) */
6007 {0xaa, 0x18, 0x0002}, /* 00,18,02,aa, */ 6004 {0xaa, 0x18, 0x0002}, /* 00,18,02,aa, */
@@ -6272,7 +6269,7 @@ static void reg_w(struct usb_device *dev,
6272 __u8 value, 6269 __u8 value,
6273 __u16 index) 6270 __u16 index)
6274{ 6271{
6275 PDEBUG(D_USBO, "reg w %02x -> [%04x]", value, index); 6272 PDEBUG(D_USBO, "reg w [%04x] = %02x", index, value);
6276 reg_w_i(dev, value, index); 6273 reg_w_i(dev, value, index);
6277} 6274}
6278 6275
@@ -6280,17 +6277,17 @@ static __u16 i2c_read(struct gspca_dev *gspca_dev,
6280 __u8 reg) 6277 __u8 reg)
6281{ 6278{
6282 __u8 retbyte; 6279 __u8 retbyte;
6283 __u8 retval[2]; 6280 __u16 retval;
6284 6281
6285 reg_w_i(gspca_dev->dev, reg, 0x92); 6282 reg_w_i(gspca_dev->dev, reg, 0x92);
6286 reg_w_i(gspca_dev->dev, 0x02, 0x90); /* <- read command */ 6283 reg_w_i(gspca_dev->dev, 0x02, 0x90); /* <- read command */
6287 msleep(25); 6284 msleep(25);
6288 retbyte = reg_r_i(gspca_dev, 0x0091); /* read status */ 6285 retbyte = reg_r_i(gspca_dev, 0x0091); /* read status */
6289 retval[0] = reg_r_i(gspca_dev, 0x0095); /* read Lowbyte */ 6286 retval = reg_r_i(gspca_dev, 0x0095); /* read Lowbyte */
6290 retval[1] = reg_r_i(gspca_dev, 0x0096); /* read Hightbyte */ 6287 retval |= reg_r_i(gspca_dev, 0x0096) << 8; /* read Hightbyte */
6291 PDEBUG(D_USBO, "i2c r [%02x] -> (%02x) %02x%02x", 6288 PDEBUG(D_USBO, "i2c r [%02x] -> %04x (%02x)",
6292 reg, retbyte, retval[1], retval[0]); 6289 reg, retval, retbyte);
6293 return (retval[1] << 8) | retval[0]; 6290 return retval;
6294} 6291}
6295 6292
6296static __u8 i2c_write(struct gspca_dev *gspca_dev, 6293static __u8 i2c_write(struct gspca_dev *gspca_dev,
@@ -6306,7 +6303,7 @@ static __u8 i2c_write(struct gspca_dev *gspca_dev,
6306 reg_w_i(gspca_dev->dev, 0x01, 0x90); /* <- write command */ 6303 reg_w_i(gspca_dev->dev, 0x01, 0x90); /* <- write command */
6307 msleep(5); 6304 msleep(5);
6308 retbyte = reg_r_i(gspca_dev, 0x0091); /* read status */ 6305 retbyte = reg_r_i(gspca_dev, 0x0091); /* read status */
6309 PDEBUG(D_USBO, "i2c w [%02x] %02x%02x (%02x)", 6306 PDEBUG(D_USBO, "i2c w [%02x] = %02x%02x (%02x)",
6310 reg, valH, valL, retbyte); 6307 reg, valH, valL, retbyte);
6311 return retbyte; 6308 return retbyte;
6312} 6309}
@@ -6349,6 +6346,8 @@ static void setmatrix(struct gspca_dev *gspca_dev)
6349 {0x58, 0xf4, 0xf4, 0xf4, 0x58, 0xf4, 0xf4, 0xf4, 0x58}; 6346 {0x58, 0xf4, 0xf4, 0xf4, 0x58, 0xf4, 0xf4, 0xf4, 0x58};
6350 static const __u8 po2030_matrix[9] = 6347 static const __u8 po2030_matrix[9] =
6351 {0x60, 0xf0, 0xf0, 0xf0, 0x60, 0xf0, 0xf0, 0xf0, 0x60}; 6348 {0x60, 0xf0, 0xf0, 0xf0, 0x60, 0xf0, 0xf0, 0xf0, 0x60};
6349 static const __u8 vf0250_matrix[9] =
6350 {0x7b, 0xea, 0xea, 0xea, 0x7b, 0xea, 0xea, 0xea, 0x7b};
6352 6351
6353 switch (sd->sensor) { 6352 switch (sd->sensor) {
6354 case SENSOR_GC0305: 6353 case SENSOR_GC0305:
@@ -6363,8 +6362,9 @@ static void setmatrix(struct gspca_dev *gspca_dev)
6363 case SENSOR_PO2030: 6362 case SENSOR_PO2030:
6364 matrix = po2030_matrix; 6363 matrix = po2030_matrix;
6365 break; 6364 break;
6366 case SENSOR_TAS5130C_VF0250: /* no matrix? */ 6365 case SENSOR_TAS5130C_VF0250:
6367 return; 6366 matrix = vf0250_matrix;
6367 break;
6368 default: /* matrix already loaded */ 6368 default: /* matrix already loaded */
6369 return; 6369 return;
6370 } 6370 }
@@ -6744,7 +6744,7 @@ static int vga_2wr_probe(struct gspca_dev *gspca_dev)
6744 return 0x04; /* CS2102 */ 6744 return 0x04; /* CS2102 */
6745 6745
6746 start_2wr_probe(dev, 0x06); /* OmniVision */ 6746 start_2wr_probe(dev, 0x06); /* OmniVision */
6747 reg_w(dev, 0x08, 0x8d); 6747 reg_w(dev, 0x08, 0x008d);
6748 i2c_write(gspca_dev, 0x11, 0xaa, 0x00); 6748 i2c_write(gspca_dev, 0x11, 0xaa, 0x00);
6749 retbyte = i2c_read(gspca_dev, 0x11); 6749 retbyte = i2c_read(gspca_dev, 0x11);
6750 if (retbyte != 0) { 6750 if (retbyte != 0) {
@@ -6778,7 +6778,7 @@ static int vga_2wr_probe(struct gspca_dev *gspca_dev)
6778 return 0x0c; /* ICM105A */ 6778 return 0x0c; /* ICM105A */
6779 6779
6780 start_2wr_probe(dev, 0x0e); /* PAS202BCB */ 6780 start_2wr_probe(dev, 0x0e); /* PAS202BCB */
6781 reg_w(dev, 0x08, 0x8d); 6781 reg_w(dev, 0x08, 0x008d);
6782 i2c_write(gspca_dev, 0x03, 0xaa, 0x00); 6782 i2c_write(gspca_dev, 0x03, 0xaa, 0x00);
6783 msleep(500); 6783 msleep(500);
6784 retbyte = i2c_read(gspca_dev, 0x03); 6784 retbyte = i2c_read(gspca_dev, 0x03);
@@ -6830,7 +6830,6 @@ static const struct sensor_by_chipset_revision chipset_revision_sensor[] = {
6830 {0x8001, 0x13}, 6830 {0x8001, 0x13},
6831 {0x8000, 0x14}, /* CS2102K */ 6831 {0x8000, 0x14}, /* CS2102K */
6832 {0x8400, 0x15}, /* TAS5130K */ 6832 {0x8400, 0x15}, /* TAS5130K */
6833 {0, 0}
6834}; 6833};
6835 6834
6836static int vga_3wr_probe(struct gspca_dev *gspca_dev) 6835static int vga_3wr_probe(struct gspca_dev *gspca_dev)
@@ -6843,7 +6842,7 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev)
6843 6842
6844/*fixme: lack of 8b=b3 (11,12)-> 10, 8b=e0 (14,15,16)-> 12 found in gspcav1*/ 6843/*fixme: lack of 8b=b3 (11,12)-> 10, 8b=e0 (14,15,16)-> 12 found in gspcav1*/
6845 reg_w(dev, 0x02, 0x0010); 6844 reg_w(dev, 0x02, 0x0010);
6846 reg_r(gspca_dev, 0x10); 6845 reg_r(gspca_dev, 0x0010);
6847 reg_w(dev, 0x01, 0x0000); 6846 reg_w(dev, 0x01, 0x0000);
6848 reg_w(dev, 0x00, 0x0010); 6847 reg_w(dev, 0x00, 0x0010);
6849 reg_w(dev, 0x01, 0x0001); 6848 reg_w(dev, 0x01, 0x0001);
@@ -6869,17 +6868,15 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev)
6869 PDEBUG(D_PROBE, "probe 3wr vga 1 0x%04x", checkword); 6868 PDEBUG(D_PROBE, "probe 3wr vga 1 0x%04x", checkword);
6870 reg_r(gspca_dev, 0x0010); 6869 reg_r(gspca_dev, 0x0010);
6871 /* this is tested only once anyway */ 6870 /* this is tested only once anyway */
6872 i = 0; 6871 for (i = 0; i < ARRAY_SIZE(chipset_revision_sensor); i++) {
6873 while (chipset_revision_sensor[i].revision) {
6874 if (chipset_revision_sensor[i].revision == checkword) { 6872 if (chipset_revision_sensor[i].revision == checkword) {
6875 sd->chip_revision = checkword; 6873 sd->chip_revision = checkword;
6876 send_unknown(dev, SENSOR_PB0330); 6874 send_unknown(dev, SENSOR_PB0330);
6877 return chipset_revision_sensor[i].internal_sensor_id; 6875 return chipset_revision_sensor[i].internal_sensor_id;
6878 } 6876 }
6879 i++;
6880 } 6877 }
6881 6878
6882 reg_w(dev, 0x01, 0x0000); 6879 reg_w(dev, 0x01, 0x0000); /* check ?? */
6883 reg_w(dev, 0x01, 0x0001); 6880 reg_w(dev, 0x01, 0x0001);
6884 reg_w(dev, 0xdd, 0x008b); 6881 reg_w(dev, 0xdd, 0x008b);
6885 reg_w(dev, 0x0a, 0x0010); 6882 reg_w(dev, 0x0a, 0x0010);
@@ -6901,8 +6898,11 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev)
6901 retbyte = i2c_read(gspca_dev, 0x00); 6898 retbyte = i2c_read(gspca_dev, 0x00);
6902 if (retbyte != 0) { 6899 if (retbyte != 0) {
6903 PDEBUG(D_PROBE, "probe 3wr vga type %02x", retbyte); 6900 PDEBUG(D_PROBE, "probe 3wr vga type %02x", retbyte);
6904 send_unknown(dev, SENSOR_GC0305); 6901 if (retbyte == 0x11) /* VF0250 */
6905 return retbyte; /* 0x29 = gc0305 - should continue? */ 6902 return 0x0250;
6903 if (retbyte == 0x29) /* gc0305 */
6904 send_unknown(dev, SENSOR_GC0305);
6905 return retbyte;
6906 } 6906 }
6907 6907
6908 reg_w(dev, 0x01, 0x0000); /* check OmniVision */ 6908 reg_w(dev, 0x01, 0x0000); /* check OmniVision */
@@ -6918,18 +6918,18 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev)
6918 return 0x06; /* OmniVision confirm ? */ 6918 return 0x06; /* OmniVision confirm ? */
6919 } 6919 }
6920 6920
6921 reg_w(dev, 0x01, 0x00); 6921 reg_w(dev, 0x01, 0x0000);
6922 reg_w(dev, 0x00, 0x02); 6922 reg_w(dev, 0x00, 0x0002);
6923 reg_w(dev, 0x01, 0x10); 6923 reg_w(dev, 0x01, 0x0010);
6924 reg_w(dev, 0x01, 0x01); 6924 reg_w(dev, 0x01, 0x0001);
6925 reg_w(dev, 0xee, 0x8b); 6925 reg_w(dev, 0xee, 0x008b);
6926 reg_w(dev, 0x03, 0x12); 6926 reg_w(dev, 0x03, 0x0012);
6927/* msleep(150); */ 6927/* msleep(150); */
6928 reg_w(dev, 0x01, 0x12); 6928 reg_w(dev, 0x01, 0x0012);
6929 reg_w(dev, 0x05, 0x12); 6929 reg_w(dev, 0x05, 0x0012);
6930 retbyte = i2c_read(gspca_dev, 0x00); /* ID 0 */ 6930 retbyte = i2c_read(gspca_dev, 0x0000); /* ID 0 */
6931 checkword = retbyte << 8; 6931 checkword = retbyte << 8;
6932 retbyte = i2c_read(gspca_dev, 0x01); /* ID 1 */ 6932 retbyte = i2c_read(gspca_dev, 0x0001); /* ID 1 */
6933 checkword |= retbyte; 6933 checkword |= retbyte;
6934 PDEBUG(D_PROBE, "probe 3wr vga 2 0x%04x", checkword); 6934 PDEBUG(D_PROBE, "probe 3wr vga 2 0x%04x", checkword);
6935 if (checkword == 0x2030) { 6935 if (checkword == 0x2030) {
@@ -6939,14 +6939,14 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev)
6939 return checkword; 6939 return checkword;
6940 } 6940 }
6941 6941
6942 reg_w(dev, 0x01, 0x00); 6942 reg_w(dev, 0x01, 0x0000);
6943 reg_w(dev, 0x0a, 0x10); 6943 reg_w(dev, 0x0a, 0x0010);
6944 reg_w(dev, 0xd3, 0x8b); 6944 reg_w(dev, 0xd3, 0x008b);
6945 reg_w(dev, 0x01, 0x01); 6945 reg_w(dev, 0x01, 0x0001);
6946 reg_w(dev, 0x03, 0x12); 6946 reg_w(dev, 0x03, 0x0012);
6947 reg_w(dev, 0x01, 0x12); 6947 reg_w(dev, 0x01, 0x0012);
6948 reg_w(dev, 0x05, 0x01); 6948 reg_w(dev, 0x05, 0x0001);
6949 reg_w(dev, 0xd3, 0x8b); 6949 reg_w(dev, 0xd3, 0x008b);
6950 retbyte = i2c_read(gspca_dev, 0x01); 6950 retbyte = i2c_read(gspca_dev, 0x01);
6951 if (retbyte != 0) { 6951 if (retbyte != 0) {
6952 PDEBUG(D_PROBE, "probe 3wr vga type 0a ?"); 6952 PDEBUG(D_PROBE, "probe 3wr vga type 0a ?");
@@ -6962,7 +6962,9 @@ static int zcxx_probeSensor(struct gspca_dev *gspca_dev)
6962 6962
6963 switch (sd->sensor) { 6963 switch (sd->sensor) {
6964 case SENSOR_MC501CB: 6964 case SENSOR_MC501CB:
6965 return -1; /* don't probe */
6965 case SENSOR_TAS5130C_VF0250: 6966 case SENSOR_TAS5130C_VF0250:
6967 /* may probe but with write in reg 0x0010 */
6966 return -1; /* don't probe */ 6968 return -1; /* don't probe */
6967 } 6969 }
6968 sensor = vga_2wr_probe(gspca_dev); 6970 sensor = vga_2wr_probe(gspca_dev);
@@ -7010,6 +7012,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
7010 7012
7011 /* define some sensors from the vendor/product */ 7013 /* define some sensors from the vendor/product */
7012 sd->sharpness = 2; 7014 sd->sharpness = 2;
7015 sd->sensor = -1;
7013 switch (id->idVendor) { 7016 switch (id->idVendor) {
7014 case 0x041e: /* Creative */ 7017 case 0x041e: /* Creative */
7015 switch (id->idProduct) { 7018 switch (id->idProduct) {
@@ -7119,6 +7122,10 @@ static int sd_config(struct gspca_dev *gspca_dev,
7119 PDEBUG(D_PROBE, "Find Sensor GC0305"); 7122 PDEBUG(D_PROBE, "Find Sensor GC0305");
7120 sd->sensor = SENSOR_GC0305; 7123 sd->sensor = SENSOR_GC0305;
7121 break; 7124 break;
7125 case 0x0250:
7126 PDEBUG(D_PROBE, "Sensor Tas5130 (VF0250)");
7127 sd->sensor = SENSOR_TAS5130C_VF0250;
7128 break;
7122 case 0x2030: 7129 case 0x2030:
7123 PDEBUG(D_PROBE, "Find Sensor PO2030"); 7130 PDEBUG(D_PROBE, "Find Sensor PO2030");
7124 sd->sensor = SENSOR_PO2030; 7131 sd->sensor = SENSOR_PO2030;
@@ -7235,6 +7242,7 @@ static void sd_start(struct gspca_dev *gspca_dev)
7235 case SENSOR_GC0305: 7242 case SENSOR_GC0305:
7236 case SENSOR_OV7620: 7243 case SENSOR_OV7620:
7237 case SENSOR_PO2030: 7244 case SENSOR_PO2030:
7245 case SENSOR_TAS5130C_VF0250:
7238 msleep(100); /* ?? */ 7246 msleep(100); /* ?? */
7239 reg_r(gspca_dev, 0x0002); /* --> 0x40 */ 7247 reg_r(gspca_dev, 0x0002); /* --> 0x40 */
7240 reg_w(dev, 0x09, 0x01ad); /* (from win traces) */ 7248 reg_w(dev, 0x09, 0x01ad); /* (from win traces) */
@@ -7605,7 +7613,7 @@ static int __init sd_mod_init(void)
7605{ 7613{
7606 if (usb_register(&sd_driver) < 0) 7614 if (usb_register(&sd_driver) < 0)
7607 return -1; 7615 return -1;
7608 PDEBUG(D_PROBE, "v%s registered", version); 7616 PDEBUG(D_PROBE, "registered");
7609 return 0; 7617 return 0;
7610} 7618}
7611 7619