diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2008-07-04 10:16:16 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-20 06:16:53 -0400 |
commit | a5ae2062252e697d38e53dbbeb91460252208914 (patch) | |
tree | 38706e9f36e2d93cd3dee8eea639bb74a17b3efa /drivers | |
parent | 54ab92ca05550550bcec2462de2605f35d079b66 (diff) |
V4L/DVB (8195): gspca: Input buffer overwritten in spca561 + cleanup code.
spca561: Input buffer may be changed on reg write.
(all sd): Cleanup code, 'const' added.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/gspca/conex.c | 98 | ||||
-rw-r--r-- | drivers/media/video/gspca/etoms.c | 546 | ||||
-rw-r--r-- | drivers/media/video/gspca/gspca.c | 6 | ||||
-rw-r--r-- | drivers/media/video/gspca/gspca.h | 26 | ||||
-rw-r--r-- | drivers/media/video/gspca/mars.c | 13 | ||||
-rw-r--r-- | drivers/media/video/gspca/ov519.c | 60 | ||||
-rw-r--r-- | drivers/media/video/gspca/pac207.c | 14 | ||||
-rw-r--r-- | drivers/media/video/gspca/pac7311.c | 40 | ||||
-rw-r--r-- | drivers/media/video/gspca/sonixj.c | 165 | ||||
-rw-r--r-- | drivers/media/video/gspca/spca500.c | 301 | ||||
-rw-r--r-- | drivers/media/video/gspca/spca501.c | 27 | ||||
-rw-r--r-- | drivers/media/video/gspca/spca505.c | 22 | ||||
-rw-r--r-- | drivers/media/video/gspca/spca508.c | 22 | ||||
-rw-r--r-- | drivers/media/video/gspca/spca561.c | 30 | ||||
-rw-r--r-- | drivers/media/video/gspca/stk014.c | 36 | ||||
-rw-r--r-- | drivers/media/video/gspca/sunplus.c | 28 | ||||
-rw-r--r-- | drivers/media/video/gspca/t613.c | 198 | ||||
-rw-r--r-- | drivers/media/video/gspca/tv8532.c | 22 | ||||
-rw-r--r-- | drivers/media/video/gspca/vc032x.c | 80 | ||||
-rw-r--r-- | drivers/media/video/gspca/zc3xx.c | 246 |
20 files changed, 932 insertions, 1048 deletions
diff --git a/drivers/media/video/gspca/conex.c b/drivers/media/video/gspca/conex.c index 473bea750b5f..6d50247b7ad2 100644 --- a/drivers/media/video/gspca/conex.c +++ b/drivers/media/video/gspca/conex.c | |||
@@ -25,8 +25,8 @@ | |||
25 | #define CONEX_CAM 1 /* special JPEG header */ | 25 | #define CONEX_CAM 1 /* special JPEG header */ |
26 | #include "jpeg.h" | 26 | #include "jpeg.h" |
27 | 27 | ||
28 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 3) | 28 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4) |
29 | static const char version[] = "2.1.3"; | 29 | static const char version[] = "2.1.4"; |
30 | 30 | ||
31 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); | 31 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); |
32 | MODULE_DESCRIPTION("GSPCA USB Conexant Camera Driver"); | 32 | MODULE_DESCRIPTION("GSPCA USB Conexant Camera Driver"); |
@@ -229,7 +229,7 @@ static void cx11646_fw(struct gspca_dev*gspca_dev) | |||
229 | reg_w(gspca_dev->dev, 0x006a, &val, 1); | 229 | reg_w(gspca_dev->dev, 0x006a, &val, 1); |
230 | } | 230 | } |
231 | 231 | ||
232 | static __u8 cxsensor[] = { | 232 | static const __u8 cxsensor[] = { |
233 | 0x88, 0x12, 0x70, 0x01, | 233 | 0x88, 0x12, 0x70, 0x01, |
234 | 0x88, 0x0d, 0x02, 0x01, | 234 | 0x88, 0x0d, 0x02, 0x01, |
235 | 0x88, 0x0f, 0x00, 0x01, | 235 | 0x88, 0x0f, 0x00, 0x01, |
@@ -244,24 +244,24 @@ static __u8 cxsensor[] = { | |||
244 | 0x00 | 244 | 0x00 |
245 | }; | 245 | }; |
246 | 246 | ||
247 | static __u8 reg20[] = { 0x10, 0x42, 0x81, 0x19, 0xd3, 0xff, 0xa7, 0xff }; | 247 | static const __u8 reg20[] = { 0x10, 0x42, 0x81, 0x19, 0xd3, 0xff, 0xa7, 0xff }; |
248 | static __u8 reg28[] = { 0x87, 0x00, 0x87, 0x00, 0x8f, 0xff, 0xea, 0xff }; | 248 | static const __u8 reg28[] = { 0x87, 0x00, 0x87, 0x00, 0x8f, 0xff, 0xea, 0xff }; |
249 | static __u8 reg10[] = { 0xb1, 0xb1 }; | 249 | static const __u8 reg10[] = { 0xb1, 0xb1 }; |
250 | static __u8 reg71a[] = { 0x08, 0x18, 0x0a, 0x1e }; /* 640 */ | 250 | static const __u8 reg71a[] = { 0x08, 0x18, 0x0a, 0x1e }; /* 640 */ |
251 | static __u8 reg71b[] = { 0x04, 0x0c, 0x05, 0x0f }; | 251 | static const __u8 reg71b[] = { 0x04, 0x0c, 0x05, 0x0f }; |
252 | /* 352{0x04,0x0a,0x06,0x12}; //352{0x05,0x0e,0x06,0x11}; //352 */ | 252 | /* 352{0x04,0x0a,0x06,0x12}; //352{0x05,0x0e,0x06,0x11}; //352 */ |
253 | static __u8 reg71c[] = { 0x02, 0x07, 0x03, 0x09 }; | 253 | static const __u8 reg71c[] = { 0x02, 0x07, 0x03, 0x09 }; |
254 | /* 320{0x04,0x0c,0x05,0x0f}; //320 */ | 254 | /* 320{0x04,0x0c,0x05,0x0f}; //320 */ |
255 | static __u8 reg71d[] = { 0x02, 0x07, 0x03, 0x09 }; /* 176 */ | 255 | static const __u8 reg71d[] = { 0x02, 0x07, 0x03, 0x09 }; /* 176 */ |
256 | static __u8 reg7b[] = { 0x00, 0xff, 0x00, 0xff, 0x00, 0xff }; | 256 | static const __u8 reg7b[] = { 0x00, 0xff, 0x00, 0xff, 0x00, 0xff }; |
257 | 257 | ||
258 | static void cx_sensor(struct gspca_dev*gspca_dev) | 258 | static void cx_sensor(struct gspca_dev*gspca_dev) |
259 | { | 259 | { |
260 | __u8 val = 0; | 260 | __u8 val; |
261 | int i = 0; | 261 | int i = 0; |
262 | __u8 bufread[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; | 262 | __u8 bufread[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; |
263 | int length = 0; | 263 | int length; |
264 | __u8 *ptsensor = cxsensor; | 264 | const __u8 *ptsensor = cxsensor; |
265 | 265 | ||
266 | reg_w(gspca_dev->dev, 0x0020, reg20, 8); | 266 | reg_w(gspca_dev->dev, 0x0020, reg20, 8); |
267 | reg_w(gspca_dev->dev, 0x0028, reg28, 8); | 267 | reg_w(gspca_dev->dev, 0x0028, reg28, 8); |
@@ -305,7 +305,7 @@ static void cx_sensor(struct gspca_dev*gspca_dev) | |||
305 | reg_r(gspca_dev->dev, 0x00e7, bufread, 8); | 305 | reg_r(gspca_dev->dev, 0x00e7, bufread, 8); |
306 | } | 306 | } |
307 | 307 | ||
308 | static __u8 cx_inits_176[] = { | 308 | static const __u8 cx_inits_176[] = { |
309 | 0x33, 0x81, 0xB0, 0x00, 0x90, 0x00, 0x0A, 0x03, /* 176x144 */ | 309 | 0x33, 0x81, 0xB0, 0x00, 0x90, 0x00, 0x0A, 0x03, /* 176x144 */ |
310 | 0x00, 0x03, 0x03, 0x03, 0x1B, 0x05, 0x30, 0x03, | 310 | 0x00, 0x03, 0x03, 0x03, 0x1B, 0x05, 0x30, 0x03, |
311 | 0x65, 0x15, 0x18, 0x25, 0x03, 0x25, 0x08, 0x30, | 311 | 0x65, 0x15, 0x18, 0x25, 0x03, 0x25, 0x08, 0x30, |
@@ -314,7 +314,7 @@ static __u8 cx_inits_176[] = { | |||
314 | 0xF7, 0xFF, 0x88, 0xFF, 0x66, 0x02, 0x28, 0x02, | 314 | 0xF7, 0xFF, 0x88, 0xFF, 0x66, 0x02, 0x28, 0x02, |
315 | 0x1E, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | 315 | 0x1E, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 |
316 | }; | 316 | }; |
317 | static __u8 cx_inits_320[] = { | 317 | static const __u8 cx_inits_320[] = { |
318 | 0x7f, 0x7f, 0x40, 0x01, 0xf0, 0x00, 0x02, 0x01, | 318 | 0x7f, 0x7f, 0x40, 0x01, 0xf0, 0x00, 0x02, 0x01, |
319 | 0x00, 0x01, 0x01, 0x01, 0x10, 0x00, 0x02, 0x01, | 319 | 0x00, 0x01, 0x01, 0x01, 0x10, 0x00, 0x02, 0x01, |
320 | 0x65, 0x45, 0xfa, 0x4c, 0x2c, 0xdf, 0xb9, 0x81, | 320 | 0x65, 0x45, 0xfa, 0x4c, 0x2c, 0xdf, 0xb9, 0x81, |
@@ -323,7 +323,7 @@ static __u8 cx_inits_320[] = { | |||
323 | 0xf5, 0xff, 0x6d, 0xff, 0xf6, 0x01, 0x43, 0x02, | 323 | 0xf5, 0xff, 0x6d, 0xff, 0xf6, 0x01, 0x43, 0x02, |
324 | 0xd3, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | 324 | 0xd3, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 |
325 | }; | 325 | }; |
326 | static __u8 cx_inits_352[] = { | 326 | static const __u8 cx_inits_352[] = { |
327 | 0x2e, 0x7c, 0x60, 0x01, 0x20, 0x01, 0x05, 0x03, | 327 | 0x2e, 0x7c, 0x60, 0x01, 0x20, 0x01, 0x05, 0x03, |
328 | 0x00, 0x06, 0x03, 0x06, 0x1b, 0x10, 0x05, 0x3b, | 328 | 0x00, 0x06, 0x03, 0x06, 0x1b, 0x10, 0x05, 0x3b, |
329 | 0x30, 0x25, 0x18, 0x25, 0x08, 0x30, 0x03, 0x25, | 329 | 0x30, 0x25, 0x18, 0x25, 0x08, 0x30, 0x03, 0x25, |
@@ -332,7 +332,7 @@ static __u8 cx_inits_352[] = { | |||
332 | 0xf5, 0xff, 0x6b, 0xff, 0xee, 0x01, 0x43, 0x02, | 332 | 0xf5, 0xff, 0x6b, 0xff, 0xee, 0x01, 0x43, 0x02, |
333 | 0xe4, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | 333 | 0xe4, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 |
334 | }; | 334 | }; |
335 | static __u8 cx_inits_640[] = { | 335 | static const __u8 cx_inits_640[] = { |
336 | 0x7e, 0x7e, 0x80, 0x02, 0xe0, 0x01, 0x01, 0x01, | 336 | 0x7e, 0x7e, 0x80, 0x02, 0xe0, 0x01, 0x01, 0x01, |
337 | 0x00, 0x02, 0x01, 0x02, 0x10, 0x30, 0x01, 0x01, | 337 | 0x00, 0x02, 0x01, 0x02, 0x10, 0x30, 0x01, 0x01, |
338 | 0x65, 0x45, 0xf7, 0x52, 0x2c, 0xdf, 0xb9, 0x81, | 338 | 0x65, 0x45, 0xf7, 0x52, 0x2c, 0xdf, 0xb9, 0x81, |
@@ -344,7 +344,7 @@ static __u8 cx_inits_640[] = { | |||
344 | 344 | ||
345 | static int cx11646_initsize(struct gspca_dev *gspca_dev) | 345 | static int cx11646_initsize(struct gspca_dev *gspca_dev) |
346 | { | 346 | { |
347 | __u8 *cxinit; | 347 | const __u8 *cxinit; |
348 | __u8 val; | 348 | __u8 val; |
349 | static const __u8 reg12[] = { 0x08, 0x05, 0x07, 0x04, 0x24 }; | 349 | static const __u8 reg12[] = { 0x08, 0x05, 0x07, 0x04, 0x24 }; |
350 | static const __u8 reg17[] = | 350 | static const __u8 reg17[] = |
@@ -396,7 +396,7 @@ static int cx11646_initsize(struct gspca_dev *gspca_dev) | |||
396 | return val; | 396 | return val; |
397 | } | 397 | } |
398 | 398 | ||
399 | static __u8 cx_jpeg_init[][8] = { | 399 | static const __u8 cx_jpeg_init[][8] = { |
400 | {0xff, 0xd8, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x15}, /* 1 */ | 400 | {0xff, 0xd8, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x15}, /* 1 */ |
401 | {0x0f, 0x10, 0x12, 0x10, 0x0d, 0x15, 0x12, 0x11}, | 401 | {0x0f, 0x10, 0x12, 0x10, 0x0d, 0x15, 0x12, 0x11}, |
402 | {0x12, 0x18, 0x16, 0x15, 0x19, 0x20, 0x35, 0x22}, | 402 | {0x12, 0x18, 0x16, 0x15, 0x19, 0x20, 0x35, 0x22}, |
@@ -479,7 +479,7 @@ static __u8 cx_jpeg_init[][8] = { | |||
479 | }; | 479 | }; |
480 | 480 | ||
481 | 481 | ||
482 | static __u8 cxjpeg_640[][8] = { | 482 | static const __u8 cxjpeg_640[][8] = { |
483 | {0xff, 0xd8, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x10}, /* 1 */ | 483 | {0xff, 0xd8, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x10}, /* 1 */ |
484 | {0x0b, 0x0c, 0x0e, 0x0c, 0x0a, 0x10, 0x0e, 0x0d}, | 484 | {0x0b, 0x0c, 0x0e, 0x0c, 0x0a, 0x10, 0x0e, 0x0d}, |
485 | {0x0e, 0x12, 0x11, 0x10, 0x13, 0x18, 0x28, 0x1a}, | 485 | {0x0e, 0x12, 0x11, 0x10, 0x13, 0x18, 0x28, 0x1a}, |
@@ -508,7 +508,7 @@ static __u8 cxjpeg_640[][8] = { | |||
508 | {0x00, 0x01, 0x11, 0x02, 0x11, 0x00, 0x3F, 0x00}, | 508 | {0x00, 0x01, 0x11, 0x02, 0x11, 0x00, 0x3F, 0x00}, |
509 | {0xFF, 0xD9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} /* 27 */ | 509 | {0xFF, 0xD9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} /* 27 */ |
510 | }; | 510 | }; |
511 | static __u8 cxjpeg_352[][8] = { | 511 | static const __u8 cxjpeg_352[][8] = { |
512 | {0xff, 0xd8, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x0d}, | 512 | {0xff, 0xd8, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x0d}, |
513 | {0x09, 0x09, 0x0b, 0x09, 0x08, 0x0D, 0x0b, 0x0a}, | 513 | {0x09, 0x09, 0x0b, 0x09, 0x08, 0x0D, 0x0b, 0x0a}, |
514 | {0x0b, 0x0e, 0x0d, 0x0d, 0x0f, 0x13, 0x1f, 0x14}, | 514 | {0x0b, 0x0e, 0x0d, 0x0d, 0x0f, 0x13, 0x1f, 0x14}, |
@@ -537,7 +537,7 @@ static __u8 cxjpeg_352[][8] = { | |||
537 | {0x00, 0x01, 0x11, 0x02, 0x11, 0x00, 0x3F, 0x00}, | 537 | {0x00, 0x01, 0x11, 0x02, 0x11, 0x00, 0x3F, 0x00}, |
538 | {0xFF, 0xD9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} | 538 | {0xFF, 0xD9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} |
539 | }; | 539 | }; |
540 | static __u8 cxjpeg_320[][8] = { | 540 | static const __u8 cxjpeg_320[][8] = { |
541 | {0xff, 0xd8, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x05}, | 541 | {0xff, 0xd8, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x05}, |
542 | {0x03, 0x04, 0x04, 0x04, 0x03, 0x05, 0x04, 0x04}, | 542 | {0x03, 0x04, 0x04, 0x04, 0x03, 0x05, 0x04, 0x04}, |
543 | {0x04, 0x05, 0x05, 0x05, 0x06, 0x07, 0x0c, 0x08}, | 543 | {0x04, 0x05, 0x05, 0x05, 0x06, 0x07, 0x0c, 0x08}, |
@@ -566,7 +566,7 @@ static __u8 cxjpeg_320[][8] = { | |||
566 | {0x00, 0x01, 0x11, 0x02, 0x11, 0x00, 0x3F, 0x00}, | 566 | {0x00, 0x01, 0x11, 0x02, 0x11, 0x00, 0x3F, 0x00}, |
567 | {0xFF, 0xD9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} /* 27 */ | 567 | {0xFF, 0xD9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} /* 27 */ |
568 | }; | 568 | }; |
569 | static __u8 cxjpeg_176[][8] = { | 569 | static const __u8 cxjpeg_176[][8] = { |
570 | {0xff, 0xd8, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x0d}, | 570 | {0xff, 0xd8, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x0d}, |
571 | {0x09, 0x09, 0x0B, 0x09, 0x08, 0x0D, 0x0B, 0x0A}, | 571 | {0x09, 0x09, 0x0B, 0x09, 0x08, 0x0D, 0x0B, 0x0A}, |
572 | {0x0B, 0x0E, 0x0D, 0x0D, 0x0F, 0x13, 0x1F, 0x14}, | 572 | {0x0B, 0x0E, 0x0D, 0x0D, 0x0F, 0x13, 0x1F, 0x14}, |
@@ -595,7 +595,8 @@ static __u8 cxjpeg_176[][8] = { | |||
595 | {0x00, 0x01, 0x11, 0x02, 0x11, 0x00, 0x3F, 0x00}, | 595 | {0x00, 0x01, 0x11, 0x02, 0x11, 0x00, 0x3F, 0x00}, |
596 | {0xFF, 0xD9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} | 596 | {0xFF, 0xD9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} |
597 | }; | 597 | }; |
598 | static __u8 cxjpeg_qtable[][8] = { /* 640 take with the zcx30x part */ | 598 | /* 640 take with the zcx30x part */ |
599 | static const __u8 cxjpeg_qtable[][8] = { | ||
599 | {0xff, 0xd8, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x08}, | 600 | {0xff, 0xd8, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x08}, |
600 | {0x06, 0x06, 0x07, 0x06, 0x05, 0x08, 0x07, 0x07}, | 601 | {0x06, 0x06, 0x07, 0x06, 0x05, 0x08, 0x07, 0x07}, |
601 | {0x07, 0x09, 0x09, 0x08, 0x0a, 0x0c, 0x14, 0x0a}, | 602 | {0x07, 0x09, 0x09, 0x08, 0x0a, 0x0c, 0x14, 0x0a}, |
@@ -641,22 +642,23 @@ static void cx11646_jpegInit(struct gspca_dev*gspca_dev) | |||
641 | reg_w(gspca_dev->dev, 0x0055, &val, 1); | 642 | reg_w(gspca_dev->dev, 0x0055, &val, 1); |
642 | } | 643 | } |
643 | 644 | ||
644 | static __u8 reg12[] = { 0x0a, 0x05, 0x07, 0x04, 0x19 }; | 645 | static const __u8 reg12[] = { 0x0a, 0x05, 0x07, 0x04, 0x19 }; |
645 | static __u8 regE5_8[] = { 0x88, 0x00, 0xd4, 0x01, 0x88, 0x01, 0x01, 0x01 }; | 646 | static const __u8 regE5_8[] = |
646 | static __u8 regE5a[] = { 0x88, 0x0a, 0x0c, 0x01 }; | 647 | { 0x88, 0x00, 0xd4, 0x01, 0x88, 0x01, 0x01, 0x01 }; |
647 | static __u8 regE5b[] = { 0x88, 0x0b, 0x12, 0x01 }; | 648 | static const __u8 regE5a[] = { 0x88, 0x0a, 0x0c, 0x01 }; |
648 | static __u8 regE5c[] = { 0x88, 0x05, 0x01, 0x01 }; | 649 | static const __u8 regE5b[] = { 0x88, 0x0b, 0x12, 0x01 }; |
649 | static __u8 reg51[] = { 0x77, 0x03 }; | 650 | static const __u8 regE5c[] = { 0x88, 0x05, 0x01, 0x01 }; |
650 | static __u8 reg70 = 0x03; | 651 | static const __u8 reg51[] = { 0x77, 0x03 }; |
652 | static const __u8 reg70 = 0x03; | ||
651 | 653 | ||
652 | static void cx11646_jpeg(struct gspca_dev*gspca_dev) | 654 | static void cx11646_jpeg(struct gspca_dev*gspca_dev) |
653 | { | 655 | { |
654 | __u8 val; | 656 | __u8 val; |
655 | int i; | 657 | int i; |
656 | int length = 8; | 658 | int length; |
657 | __u8 Reg55 = 0x14; | 659 | __u8 Reg55; |
658 | __u8 bufread[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; | 660 | __u8 bufread[8]; |
659 | int retry = 50; | 661 | int retry; |
660 | 662 | ||
661 | val = 0x01; | 663 | val = 0x01; |
662 | reg_w(gspca_dev->dev, 0x00c0, &val, 1); | 664 | reg_w(gspca_dev->dev, 0x00c0, &val, 1); |
@@ -665,6 +667,7 @@ static void cx11646_jpeg(struct gspca_dev*gspca_dev) | |||
665 | val = 0x00; | 667 | val = 0x00; |
666 | reg_w(gspca_dev->dev, 0x00c0, &val, 1); | 668 | reg_w(gspca_dev->dev, 0x00c0, &val, 1); |
667 | reg_r(gspca_dev->dev, 0x0001, &val, 1); | 669 | reg_r(gspca_dev->dev, 0x0001, &val, 1); |
670 | length = 8; | ||
668 | switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode) { | 671 | switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode) { |
669 | case 0: | 672 | case 0: |
670 | for (i = 0; i < 27; i++) { | 673 | for (i = 0; i < 27; i++) { |
@@ -719,6 +722,7 @@ static void cx11646_jpeg(struct gspca_dev*gspca_dev) | |||
719 | val = 0x00; | 722 | val = 0x00; |
720 | reg_w(gspca_dev->dev, 0x0000, &val, 1); | 723 | reg_w(gspca_dev->dev, 0x0000, &val, 1); |
721 | /* wait for completion */ | 724 | /* wait for completion */ |
725 | retry = 50; | ||
722 | while (retry--) { | 726 | while (retry--) { |
723 | reg_r(gspca_dev->dev, 0x0002, &val, 1); | 727 | reg_r(gspca_dev->dev, 0x0002, &val, 1); |
724 | /* 0x07 until 0x00 */ | 728 | /* 0x07 until 0x00 */ |
@@ -796,8 +800,8 @@ static void cx11646_init1(struct gspca_dev *gspca_dev) | |||
796 | reg_w(gspca_dev->dev, 0x003f, &val, 1); | 800 | reg_w(gspca_dev->dev, 0x003f, &val, 1); |
797 | val = 0x40; | 801 | val = 0x40; |
798 | reg_w(gspca_dev->dev, 0x003d, &val, 1); | 802 | reg_w(gspca_dev->dev, 0x003d, &val, 1); |
799 | /* val= 0x60; */ | 803 | /* val= 0x60; */ |
800 | /* reg_w(gspca_dev->dev,0x00,0x00,0x003d,&val,1); */ | 804 | /* reg_w(gspca_dev->dev, 0x00, 0x00, 0x003d, &val, 1); */ |
801 | reg_r(gspca_dev->dev, 0x0099, &val, 1); /* ->0x07 */ | 805 | reg_r(gspca_dev->dev, 0x0099, &val, 1); /* ->0x07 */ |
802 | 806 | ||
803 | while (cx_sensor_init[i][0]) { | 807 | while (cx_sensor_init[i][0]) { |
@@ -827,7 +831,7 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
827 | cam->cam_mode = vga_mode; | 831 | cam->cam_mode = vga_mode; |
828 | cam->nmodes = sizeof vga_mode / sizeof vga_mode[0]; | 832 | cam->nmodes = sizeof vga_mode / sizeof vga_mode[0]; |
829 | 833 | ||
830 | sd->qindex = 0; /* set the quantization table */ | 834 | sd->qindex = 0; /* set the quantization */ |
831 | sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value; | 835 | sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value; |
832 | sd->contrast = sd_ctrls[SD_CONTRAST].qctrl.default_value; | 836 | sd->contrast = sd_ctrls[SD_CONTRAST].qctrl.default_value; |
833 | sd->colors = sd_ctrls[SD_COLOR].qctrl.default_value; | 837 | sd->colors = sd_ctrls[SD_COLOR].qctrl.default_value; |
@@ -891,7 +895,7 @@ static void sd_close(struct gspca_dev *gspca_dev) | |||
891 | 895 | ||
892 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 896 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
893 | struct gspca_frame *frame, /* target */ | 897 | struct gspca_frame *frame, /* target */ |
894 | unsigned char *data, /* isoc packet */ | 898 | __u8 *data, /* isoc packet */ |
895 | int len) /* iso packet length */ | 899 | int len) /* iso packet length */ |
896 | { | 900 | { |
897 | if (data[0] == 0xff && data[1] == 0xd8) { | 901 | if (data[0] == 0xff && data[1] == 0xd8) { |
@@ -914,21 +918,22 @@ static void setbrightness(struct gspca_dev*gspca_dev) | |||
914 | { | 918 | { |
915 | struct sd *sd = (struct sd *) gspca_dev; | 919 | struct sd *sd = (struct sd *) gspca_dev; |
916 | __u8 regE5cbx[] = { 0x88, 0x00, 0xd4, 0x01, 0x88, 0x01, 0x01, 0x01 }; | 920 | __u8 regE5cbx[] = { 0x88, 0x00, 0xd4, 0x01, 0x88, 0x01, 0x01, 0x01 }; |
917 | __u8 reg51c[] = { 0x77, 0x03 }; | 921 | __u8 reg51c[2]; |
918 | __u8 bright; | 922 | __u8 bright; |
919 | __u8 colors; | 923 | __u8 colors; |
920 | __u8 val; | 924 | __u8 val; |
921 | __u8 bufread[8]; | 925 | __u8 bufread[8]; |
922 | 926 | ||
923 | bright = sd->brightness; | 927 | bright = sd->brightness; |
924 | colors = sd->colors; | ||
925 | regE5cbx[2] = bright; | 928 | regE5cbx[2] = bright; |
926 | reg51c[1] = colors; | ||
927 | reg_w(gspca_dev->dev, 0x00e5, regE5cbx, 8); | 929 | reg_w(gspca_dev->dev, 0x00e5, regE5cbx, 8); |
928 | reg_r(gspca_dev->dev, 0x00e8, bufread, 8); | 930 | reg_r(gspca_dev->dev, 0x00e8, bufread, 8); |
929 | reg_w(gspca_dev->dev, 0x00e5, regE5c, 4); | 931 | reg_w(gspca_dev->dev, 0x00e5, regE5c, 4); |
930 | reg_r(gspca_dev->dev, 0x00e8, &val, 1); /* 0x00 */ | 932 | reg_r(gspca_dev->dev, 0x00e8, &val, 1); /* 0x00 */ |
931 | 933 | ||
934 | colors = sd->colors; | ||
935 | reg51c[0] = 0x77; | ||
936 | reg51c[1] = colors; | ||
932 | reg_w(gspca_dev->dev, 0x0051, reg51c, 2); | 937 | reg_w(gspca_dev->dev, 0x0051, reg51c, 2); |
933 | reg_w(gspca_dev->dev, 0x0010, reg10, 2); | 938 | reg_w(gspca_dev->dev, 0x0010, reg10, 2); |
934 | reg_w(gspca_dev->dev, 0x0070, ®70, 1); | 939 | reg_w(gspca_dev->dev, 0x0070, ®70, 1); |
@@ -938,14 +943,15 @@ static void setcontrast(struct gspca_dev*gspca_dev) | |||
938 | { | 943 | { |
939 | struct sd *sd = (struct sd *) gspca_dev; | 944 | struct sd *sd = (struct sd *) gspca_dev; |
940 | __u8 regE5acx[] = { 0x88, 0x0a, 0x0c, 0x01 }; /* seem MSB */ | 945 | __u8 regE5acx[] = { 0x88, 0x0a, 0x0c, 0x01 }; /* seem MSB */ |
941 | /* __u8 regE5bcx[]={0x88,0x0b,0x12,0x01}; // LSB */ | 946 | /* __u8 regE5bcx[] = { 0x88, 0x0b, 0x12, 0x01}; * LSB */ |
942 | __u8 reg51c[] = { 0x77, 0x03 }; | 947 | __u8 reg51c[2]; |
943 | __u8 val; | 948 | __u8 val; |
944 | 949 | ||
945 | reg51c[1] = sd->colors; | ||
946 | regE5acx[2] = sd->contrast; | 950 | regE5acx[2] = sd->contrast; |
947 | reg_w(gspca_dev->dev, 0x00e5, regE5acx, 4); | 951 | reg_w(gspca_dev->dev, 0x00e5, regE5acx, 4); |
948 | reg_r(gspca_dev->dev, 0x00e8, &val, 1); /* 0x00 */ | 952 | reg_r(gspca_dev->dev, 0x00e8, &val, 1); /* 0x00 */ |
953 | reg51c[0] = 0x77; | ||
954 | reg51c[1] = sd->colors; | ||
949 | reg_w(gspca_dev->dev, 0x0051, reg51c, 2); | 955 | reg_w(gspca_dev->dev, 0x0051, reg51c, 2); |
950 | reg_w(gspca_dev->dev, 0x0010, reg10, 2); | 956 | reg_w(gspca_dev->dev, 0x0010, reg10, 2); |
951 | reg_w(gspca_dev->dev, 0x0070, ®70, 1); | 957 | reg_w(gspca_dev->dev, 0x0070, ®70, 1); |
diff --git a/drivers/media/video/gspca/etoms.c b/drivers/media/video/gspca/etoms.c index ed7a8f9c0d7a..bbbe65923cfc 100644 --- a/drivers/media/video/gspca/etoms.c +++ b/drivers/media/video/gspca/etoms.c | |||
@@ -22,8 +22,8 @@ | |||
22 | 22 | ||
23 | #include "gspca.h" | 23 | #include "gspca.h" |
24 | 24 | ||
25 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 3) | 25 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4) |
26 | static const char version[] = "2.1.3"; | 26 | static const char version[] = "2.1.4"; |
27 | 27 | ||
28 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); | 28 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); |
29 | MODULE_DESCRIPTION("Etoms USB Camera Driver"); | 29 | MODULE_DESCRIPTION("Etoms USB Camera Driver"); |
@@ -56,7 +56,6 @@ static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val); | |||
56 | static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val); | 56 | static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val); |
57 | 57 | ||
58 | static struct ctrl sd_ctrls[] = { | 58 | static struct ctrl sd_ctrls[] = { |
59 | #define SD_BRIGHTNESS 0 | ||
60 | { | 59 | { |
61 | { | 60 | { |
62 | .id = V4L2_CID_BRIGHTNESS, | 61 | .id = V4L2_CID_BRIGHTNESS, |
@@ -65,12 +64,12 @@ static struct ctrl sd_ctrls[] = { | |||
65 | .minimum = 1, | 64 | .minimum = 1, |
66 | .maximum = 127, | 65 | .maximum = 127, |
67 | .step = 1, | 66 | .step = 1, |
68 | .default_value = 63, | 67 | #define BRIGHTNESS_DEF 63 |
68 | .default_value = BRIGHTNESS_DEF, | ||
69 | }, | 69 | }, |
70 | .set = sd_setbrightness, | 70 | .set = sd_setbrightness, |
71 | .get = sd_getbrightness, | 71 | .get = sd_getbrightness, |
72 | }, | 72 | }, |
73 | #define SD_CONTRAST 1 | ||
74 | { | 73 | { |
75 | { | 74 | { |
76 | .id = V4L2_CID_CONTRAST, | 75 | .id = V4L2_CID_CONTRAST, |
@@ -79,12 +78,12 @@ static struct ctrl sd_ctrls[] = { | |||
79 | .minimum = 0, | 78 | .minimum = 0, |
80 | .maximum = 255, | 79 | .maximum = 255, |
81 | .step = 1, | 80 | .step = 1, |
82 | .default_value = 127, | 81 | #define CONTRAST_DEF 127 |
82 | .default_value = CONTRAST_DEF, | ||
83 | }, | 83 | }, |
84 | .set = sd_setcontrast, | 84 | .set = sd_setcontrast, |
85 | .get = sd_getcontrast, | 85 | .get = sd_getcontrast, |
86 | }, | 86 | }, |
87 | #define SD_COLOR 2 | ||
88 | { | 87 | { |
89 | { | 88 | { |
90 | .id = V4L2_CID_SATURATION, | 89 | .id = V4L2_CID_SATURATION, |
@@ -93,12 +92,12 @@ static struct ctrl sd_ctrls[] = { | |||
93 | .minimum = 0, | 92 | .minimum = 0, |
94 | .maximum = 15, | 93 | .maximum = 15, |
95 | .step = 1, | 94 | .step = 1, |
96 | .default_value = 7, | 95 | #define COLOR_DEF 7 |
96 | .default_value = COLOR_DEF, | ||
97 | }, | 97 | }, |
98 | .set = sd_setcolors, | 98 | .set = sd_setcolors, |
99 | .get = sd_getcolors, | 99 | .get = sd_getcolors, |
100 | }, | 100 | }, |
101 | #define SD_AUTOGAIN 3 | ||
102 | { | 101 | { |
103 | { | 102 | { |
104 | .id = V4L2_CID_AUTOGAIN, | 103 | .id = V4L2_CID_AUTOGAIN, |
@@ -107,7 +106,8 @@ static struct ctrl sd_ctrls[] = { | |||
107 | .minimum = 0, | 106 | .minimum = 0, |
108 | .maximum = 1, | 107 | .maximum = 1, |
109 | .step = 1, | 108 | .step = 1, |
110 | .default_value = 1, | 109 | #define AUTOGAIN_DEF 1 |
110 | .default_value = AUTOGAIN_DEF, | ||
111 | }, | 111 | }, |
112 | .set = sd_setautogain, | 112 | .set = sd_setautogain, |
113 | .get = sd_getautogain, | 113 | .get = sd_getautogain, |
@@ -205,13 +205,13 @@ static struct cam_mode sif_mode[] = { | |||
205 | #define PAS106_REG0e 0x0e /* global gain [4..0](default 0x0e) */ | 205 | #define PAS106_REG0e 0x0e /* global gain [4..0](default 0x0e) */ |
206 | #define PAS106_REG13 0x13 /* end i2c write */ | 206 | #define PAS106_REG13 0x13 /* end i2c write */ |
207 | 207 | ||
208 | static __u8 GainRGBG[] = { 0x80, 0x80, 0x80, 0x80, 0x00, 0x00 }; | 208 | static const __u8 GainRGBG[] = { 0x80, 0x80, 0x80, 0x80, 0x00, 0x00 }; |
209 | 209 | ||
210 | static __u8 I2c2[] = { 0x08, 0x08, 0x08, 0x08, 0x0d }; | 210 | static const __u8 I2c2[] = { 0x08, 0x08, 0x08, 0x08, 0x0d }; |
211 | 211 | ||
212 | static __u8 I2c3[] = { 0x12, 0x05 }; | 212 | static const __u8 I2c3[] = { 0x12, 0x05 }; |
213 | 213 | ||
214 | static __u8 I2c4[] = { 0x41, 0x08 }; | 214 | static const __u8 I2c4[] = { 0x41, 0x08 }; |
215 | 215 | ||
216 | static void reg_r(struct usb_device *dev, | 216 | static void reg_r(struct usb_device *dev, |
217 | __u16 index, __u8 *buffer, int len) | 217 | __u16 index, __u8 *buffer, int len) |
@@ -223,8 +223,21 @@ static void reg_r(struct usb_device *dev, | |||
223 | 0, index, buffer, len, 500); | 223 | 0, index, buffer, len, 500); |
224 | } | 224 | } |
225 | 225 | ||
226 | static void reg_w_val(struct usb_device *dev, | ||
227 | __u16 index, __u8 val) | ||
228 | { | ||
229 | __u8 data; | ||
230 | |||
231 | data = val; | ||
232 | usb_control_msg(dev, | ||
233 | usb_sndctrlpipe(dev, 0), | ||
234 | 0, | ||
235 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, | ||
236 | 0, index, &data, 1, 500); | ||
237 | } | ||
238 | |||
226 | static void reg_w(struct usb_device *dev, | 239 | static void reg_w(struct usb_device *dev, |
227 | __u16 index, __u8 *buffer, __u16 len) | 240 | __u16 index, const __u8 *buffer, __u16 len) |
228 | { | 241 | { |
229 | __u8 tmpbuf[8]; | 242 | __u8 tmpbuf[8]; |
230 | 243 | ||
@@ -236,48 +249,42 @@ static void reg_w(struct usb_device *dev, | |||
236 | 0, index, tmpbuf, len, 500); | 249 | 0, index, tmpbuf, len, 500); |
237 | } | 250 | } |
238 | 251 | ||
239 | static int Et_i2cwrite(struct usb_device *dev, __u8 reg, __u8 *buffer, | 252 | static int Et_i2cwrite(struct usb_device *dev, __u8 reg, |
240 | __u16 length, __u8 mode) | 253 | const __u8 *buffer, |
254 | __u16 len, __u8 mode) | ||
241 | { | 255 | { |
242 | /* buffer should be [D0..D7] */ | 256 | /* buffer should be [D0..D7] */ |
243 | int i, j; | 257 | __u8 ptchcount; |
244 | __u8 base = 0x40; /* sensor base for the pas106 */ | 258 | |
245 | __u8 ptchcount = 0; | 259 | /* set the base address */ |
246 | 260 | reg_w_val(dev, ET_I2C_BASE, 0x40); /* sensor base for the pas106 */ | |
247 | ptchcount = (((length & 0x07) << 4) | (mode & 0x03)); | 261 | /* set count and prefetch */ |
248 | /* set the base address */ | 262 | ptchcount = ((len & 0x07) << 4) | (mode & 0x03); |
249 | reg_w(dev, ET_I2C_BASE, &base, 1); | 263 | reg_w_val(dev, ET_I2C_COUNT, ptchcount); |
250 | /* set count and prefetch */ | 264 | /* set the register base */ |
251 | reg_w(dev, ET_I2C_COUNT, &ptchcount, 1); | 265 | reg_w_val(dev, ET_I2C_REG, reg); |
252 | /* set the register base */ | 266 | while (--len >= 0) |
253 | reg_w(dev, ET_I2C_REG, ®, 1); | 267 | reg_w_val(dev, ET_I2C_DATA0 + len, buffer[len]); |
254 | j = length - 1; | ||
255 | for (i = 0; i < length; i++) { | ||
256 | reg_w(dev, (ET_I2C_DATA0 + j), &buffer[j], 1); | ||
257 | j--; | ||
258 | } | ||
259 | return 0; | 268 | return 0; |
260 | } | 269 | } |
261 | 270 | ||
262 | static int Et_i2cread(struct usb_device *dev, __u8 reg, __u8 *buffer, | 271 | static int Et_i2cread(struct usb_device *dev, __u8 reg, |
263 | __u16 length, __u8 mode) | 272 | __u8 *buffer, |
273 | __u16 length, __u8 mode) | ||
264 | { | 274 | { |
265 | /* buffer should be [D0..D7] */ | 275 | /* buffer should be [D0..D7] */ |
266 | int i, j; | 276 | int i, j; |
267 | __u8 base = 0x40; /* sensor base for the pas106 */ | ||
268 | __u8 ptchcount; | 277 | __u8 ptchcount; |
269 | __u8 prefetch = 0x02; | 278 | |
270 | 279 | /* set the base address */ | |
271 | ptchcount = (((length & 0x07) << 4) | (mode & 0x03)); | 280 | reg_w_val(dev, ET_I2C_BASE, 0x40); /* sensor base for the pas106 */ |
272 | /* set the base address */ | 281 | /* set count and prefetch */ |
273 | reg_w(dev, ET_I2C_BASE, &base, 1); | 282 | ptchcount = ((length & 0x07) << 4) | (mode & 0x03); |
274 | /* set count and prefetch */ | 283 | reg_w_val(dev, ET_I2C_COUNT, ptchcount); |
275 | reg_w(dev, ET_I2C_COUNT, &ptchcount, 1); | 284 | /* set the register base */ |
276 | /* set the register base */ | 285 | reg_w_val(dev, ET_I2C_REG, reg); |
277 | reg_w(dev, ET_I2C_REG, ®, 1); | 286 | reg_w_val(dev, ET_I2C_PREFETCH, 0x02); /* prefetch */ |
278 | reg_w(dev, ET_I2C_PREFETCH, &prefetch, 1); | 287 | reg_w_val(dev, ET_I2C_PREFETCH, 0); |
279 | prefetch = 0x00; | ||
280 | reg_w(dev, ET_I2C_PREFETCH, &prefetch, 1); | ||
281 | j = length - 1; | 288 | j = length - 1; |
282 | for (i = 0; i < length; i++) { | 289 | for (i = 0; i < length; i++) { |
283 | reg_r(dev, (ET_I2C_DATA0 + j), &buffer[j], 1); | 290 | reg_r(dev, (ET_I2C_DATA0 + j), &buffer[j], 1); |
@@ -299,222 +306,139 @@ static int Et_WaitStatus(struct usb_device *dev) | |||
299 | return 0; | 306 | return 0; |
300 | } | 307 | } |
301 | 308 | ||
302 | static int Et_videoOff(struct usb_device *dev) | 309 | static int et_video(struct usb_device *dev, int on) |
303 | { | 310 | { |
304 | int err; | 311 | int err; |
305 | __u8 stopvideo = 0; | ||
306 | 312 | ||
307 | reg_w(dev, ET_GPIO_OUT, &stopvideo, 1); | 313 | reg_w_val(dev, ET_GPIO_OUT, on |
314 | ? 0x10 /* startvideo - set Bit5 */ | ||
315 | : 0); /* stopvideo */ | ||
308 | err = Et_WaitStatus(dev); | 316 | err = Et_WaitStatus(dev); |
309 | if (!err) | 317 | if (!err) |
310 | PDEBUG(D_ERR, "timeout Et_waitStatus VideoON"); | 318 | PDEBUG(D_ERR, "timeout video on/off"); |
311 | return err; | ||
312 | } | ||
313 | |||
314 | static int Et_videoOn(struct usb_device *dev) | ||
315 | { | ||
316 | int err; | ||
317 | __u8 startvideo = 0x10; /* set Bit5 */ | ||
318 | |||
319 | reg_w(dev, ET_GPIO_OUT, &startvideo, 1); | ||
320 | err = Et_WaitStatus(dev); | ||
321 | if (!err) | ||
322 | PDEBUG(D_ERR, "timeout Et_waitStatus VideoOFF"); | ||
323 | return err; | 319 | return err; |
324 | } | 320 | } |
325 | 321 | ||
326 | static void Et_init2(struct gspca_dev *gspca_dev) | 322 | static void Et_init2(struct gspca_dev *gspca_dev) |
327 | { | 323 | { |
328 | struct usb_device *dev = gspca_dev->dev; | 324 | struct usb_device *dev = gspca_dev->dev; |
329 | __u8 value = 0x00; | 325 | __u8 value; |
330 | __u8 received = 0x00; | 326 | __u8 received; |
331 | __u8 FormLine[] = { 0x84, 0x03, 0x14, 0xf4, 0x01, 0x05 }; | 327 | static const __u8 FormLine[] = { 0x84, 0x03, 0x14, 0xf4, 0x01, 0x05 }; |
332 | 328 | ||
333 | PDEBUG(D_STREAM, "Open Init2 ET"); | 329 | PDEBUG(D_STREAM, "Open Init2 ET"); |
334 | value = 0x2f; | 330 | reg_w_val(dev, ET_GPIO_DIR_CTRL, 0x2f); |
335 | reg_w(dev, ET_GPIO_DIR_CTRL, &value, 1); | 331 | reg_w_val(dev, ET_GPIO_OUT, 0x10); |
336 | value = 0x10; | ||
337 | reg_w(dev, ET_GPIO_OUT, &value, 1); | ||
338 | reg_r(dev, ET_GPIO_IN, &received, 1); | 332 | reg_r(dev, ET_GPIO_IN, &received, 1); |
339 | value = 0x14; /* 0x14 // 0x16 enabled pattern */ | 333 | reg_w_val(dev, ET_ClCK, 0x14); /* 0x14 // 0x16 enabled pattern */ |
340 | reg_w(dev, ET_ClCK, &value, 1); | 334 | reg_w_val(dev, ET_CTRL, 0x1b); |
341 | value = 0x1b; | ||
342 | reg_w(dev, ET_CTRL, &value, 1); | ||
343 | 335 | ||
344 | /* compression et subsampling */ | 336 | /* compression et subsampling */ |
345 | if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode) | 337 | if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode) |
346 | value = ET_COMP_VAL1; /* 320 */ | 338 | value = ET_COMP_VAL1; /* 320 */ |
347 | else | 339 | else |
348 | value = ET_COMP_VAL0; /* 640 */ | 340 | value = ET_COMP_VAL0; /* 640 */ |
349 | reg_w(dev, ET_COMP, &value, 1); | 341 | reg_w_val(dev, ET_COMP, value); |
350 | value = 0x1f; | 342 | reg_w_val(dev, ET_MAXQt, 0x1f); |
351 | reg_w(dev, ET_MAXQt, &value, 1); | 343 | reg_w_val(dev, ET_MINQt, 0x04); |
352 | value = 0x04; | ||
353 | reg_w(dev, ET_MINQt, &value, 1); | ||
354 | /* undocumented registers */ | 344 | /* undocumented registers */ |
355 | value = 0xff; | 345 | reg_w_val(dev, ET_REG1d, 0xff); |
356 | reg_w(dev, ET_REG1d, &value, 1); | 346 | reg_w_val(dev, ET_REG1e, 0xff); |
357 | value = 0xff; | 347 | reg_w_val(dev, ET_REG1f, 0xff); |
358 | reg_w(dev, ET_REG1e, &value, 1); | 348 | reg_w_val(dev, ET_REG20, 0x35); |
359 | value = 0xff; | 349 | reg_w_val(dev, ET_REG21, 0x01); |
360 | reg_w(dev, ET_REG1f, &value, 1); | 350 | reg_w_val(dev, ET_REG22, 0x00); |
361 | value = 0x35; | 351 | reg_w_val(dev, ET_REG23, 0xff); |
362 | reg_w(dev, ET_REG20, &value, 1); | 352 | reg_w_val(dev, ET_REG24, 0xff); |
363 | value = 0x01; | 353 | reg_w_val(dev, ET_REG25, 0x0f); |
364 | reg_w(dev, ET_REG21, &value, 1); | ||
365 | value = 0x00; | ||
366 | reg_w(dev, ET_REG22, &value, 1); | ||
367 | value = 0xff; | ||
368 | reg_w(dev, ET_REG23, &value, 1); | ||
369 | value = 0xff; | ||
370 | reg_w(dev, ET_REG24, &value, 1); | ||
371 | value = 0x0f; | ||
372 | reg_w(dev, ET_REG25, &value, 1); | ||
373 | /* colors setting */ | 354 | /* colors setting */ |
374 | value = 0x11; | 355 | reg_w_val(dev, 0x30, 0x11); /* 0x30 */ |
375 | reg_w(dev, 0x30, &value, 1); /* 0x30 */ | 356 | reg_w_val(dev, 0x31, 0x40); |
376 | value = 0x40; | 357 | reg_w_val(dev, 0x32, 0x00); |
377 | reg_w(dev, 0x31, &value, 1); | 358 | reg_w_val(dev, ET_O_RED, 0x00); /* 0x34 */ |
378 | value = 0x00; | 359 | reg_w_val(dev, ET_O_GREEN1, 0x00); |
379 | reg_w(dev, 0x32, &value, 1); | 360 | reg_w_val(dev, ET_O_BLUE, 0x00); |
380 | value = 0x00; | 361 | reg_w_val(dev, ET_O_GREEN2, 0x00); |
381 | reg_w(dev, ET_O_RED, &value, 1); /* 0x34 */ | ||
382 | value = 0x00; | ||
383 | reg_w(dev, ET_O_GREEN1, &value, 1); | ||
384 | value = 0x00; | ||
385 | reg_w(dev, ET_O_BLUE, &value, 1); | ||
386 | value = 0x00; | ||
387 | reg_w(dev, ET_O_GREEN2, &value, 1); | ||
388 | /*************/ | 362 | /*************/ |
389 | value = 0x80; | 363 | reg_w_val(dev, ET_G_RED, 0x80); /* 0x4d */ |
390 | reg_w(dev, ET_G_RED, &value, 1); /* 0x4d */ | 364 | reg_w_val(dev, ET_G_GREEN1, 0x80); |
391 | value = 0x80; | 365 | reg_w_val(dev, ET_G_BLUE, 0x80); |
392 | reg_w(dev, ET_G_GREEN1, &value, 1); | 366 | reg_w_val(dev, ET_G_GREEN2, 0x80); |
393 | value = 0x80; | 367 | reg_w_val(dev, ET_G_GR_H, 0x00); |
394 | reg_w(dev, ET_G_BLUE, &value, 1); | 368 | reg_w_val(dev, ET_G_GB_H, 0x00); /* 0x52 */ |
395 | value = 0x80; | ||
396 | reg_w(dev, ET_G_GREEN2, &value, 1); | ||
397 | value = 0x00; | ||
398 | reg_w(dev, ET_G_GR_H, &value, 1); | ||
399 | value = 0x00; | ||
400 | reg_w(dev, ET_G_GB_H, &value, 1); /* 0x52 */ | ||
401 | /* Window control registers */ | 369 | /* Window control registers */ |
402 | 370 | reg_w_val(dev, 0x61, 0x80); /* use cmc_out */ | |
403 | value = 0x80; /* use cmc_out */ | 371 | reg_w_val(dev, 0x62, 0x02); |
404 | reg_w(dev, 0x61, &value, 1); | 372 | reg_w_val(dev, 0x63, 0x03); |
405 | 373 | reg_w_val(dev, 0x64, 0x14); | |
406 | value = 0x02; | 374 | reg_w_val(dev, 0x65, 0x0e); |
407 | reg_w(dev, 0x62, &value, 1); | 375 | reg_w_val(dev, 0x66, 0x02); |
408 | value = 0x03; | 376 | reg_w_val(dev, 0x67, 0x02); |
409 | reg_w(dev, 0x63, &value, 1); | ||
410 | value = 0x14; | ||
411 | reg_w(dev, 0x64, &value, 1); | ||
412 | value = 0x0e; | ||
413 | reg_w(dev, 0x65, &value, 1); | ||
414 | value = 0x02; | ||
415 | reg_w(dev, 0x66, &value, 1); | ||
416 | value = 0x02; | ||
417 | reg_w(dev, 0x67, &value, 1); | ||
418 | 377 | ||
419 | /**************************************/ | 378 | /**************************************/ |
420 | value = 0x8f; | 379 | reg_w_val(dev, ET_SYNCHRO, 0x8f); /* 0x68 */ |
421 | reg_w(dev, ET_SYNCHRO, &value, 1); /* 0x68 */ | 380 | reg_w_val(dev, ET_STARTX, 0x69); /* 0x6a //0x69 */ |
422 | value = 0x69; /* 0x6a //0x69 */ | 381 | reg_w_val(dev, ET_STARTY, 0x0d); /* 0x0d //0x0c */ |
423 | reg_w(dev, ET_STARTX, &value, 1); | 382 | reg_w_val(dev, ET_WIDTH_LOW, 0x80); |
424 | value = 0x0d; /* 0x0d //0x0c */ | 383 | reg_w_val(dev, ET_HEIGTH_LOW, 0xe0); |
425 | reg_w(dev, ET_STARTY, &value, 1); | 384 | reg_w_val(dev, ET_W_H_HEIGTH, 0x60); /* 6d */ |
426 | value = 0x80; | 385 | reg_w_val(dev, ET_REG6e, 0x86); |
427 | reg_w(dev, ET_WIDTH_LOW, &value, 1); | 386 | reg_w_val(dev, ET_REG6f, 0x01); |
428 | value = 0xe0; | 387 | reg_w_val(dev, ET_REG70, 0x26); |
429 | reg_w(dev, ET_HEIGTH_LOW, &value, 1); | 388 | reg_w_val(dev, ET_REG71, 0x7a); |
430 | value = 0x60; | 389 | reg_w_val(dev, ET_REG72, 0x01); |
431 | reg_w(dev, ET_W_H_HEIGTH, &value, 1); /* 6d */ | ||
432 | value = 0x86; | ||
433 | reg_w(dev, ET_REG6e, &value, 1); | ||
434 | value = 0x01; | ||
435 | reg_w(dev, ET_REG6f, &value, 1); | ||
436 | value = 0x26; | ||
437 | reg_w(dev, ET_REG70, &value, 1); | ||
438 | value = 0x7a; | ||
439 | reg_w(dev, ET_REG71, &value, 1); | ||
440 | value = 0x01; | ||
441 | reg_w(dev, ET_REG72, &value, 1); | ||
442 | /* Clock Pattern registers ***************** */ | 390 | /* Clock Pattern registers ***************** */ |
443 | value = 0x00; | 391 | reg_w_val(dev, ET_REG73, 0x00); |
444 | reg_w(dev, ET_REG73, &value, 1); | 392 | reg_w_val(dev, ET_REG74, 0x18); /* 0x28 */ |
445 | value = 0x18; /* 0x28 */ | 393 | reg_w_val(dev, ET_REG75, 0x0f); /* 0x01 */ |
446 | reg_w(dev, ET_REG74, &value, 1); | ||
447 | value = 0x0f; /* 0x01 */ | ||
448 | reg_w(dev, ET_REG75, &value, 1); | ||
449 | /**********************************************/ | 394 | /**********************************************/ |
450 | value = 0x20; | 395 | reg_w_val(dev, 0x8a, 0x20); |
451 | reg_w(dev, 0x8a, &value, 1); | 396 | reg_w_val(dev, 0x8d, 0x0f); |
452 | value = 0x0f; | 397 | reg_w_val(dev, 0x8e, 0x08); |
453 | reg_w(dev, 0x8d, &value, 1); | ||
454 | value = 0x08; | ||
455 | reg_w(dev, 0x8e, &value, 1); | ||
456 | /**************************************/ | 398 | /**************************************/ |
457 | value = 0x08; | 399 | reg_w_val(dev, 0x03, 0x08); |
458 | reg_w(dev, 0x03, &value, 1); | 400 | reg_w_val(dev, ET_PXL_CLK, 0x03); |
459 | value = 0x03; | 401 | reg_w_val(dev, 0x81, 0xff); |
460 | reg_w(dev, ET_PXL_CLK, &value, 1); | 402 | reg_w_val(dev, 0x80, 0x00); |
461 | value = 0xff; | 403 | reg_w_val(dev, 0x81, 0xff); |
462 | reg_w(dev, 0x81, &value, 1); | 404 | reg_w_val(dev, 0x80, 0x20); |
463 | value = 0x00; | 405 | reg_w_val(dev, 0x03, 0x01); |
464 | reg_w(dev, 0x80, &value, 1); | 406 | reg_w_val(dev, 0x03, 0x00); |
465 | value = 0xff; | 407 | reg_w_val(dev, 0x03, 0x08); |
466 | reg_w(dev, 0x81, &value, 1); | ||
467 | value = 0x20; | ||
468 | reg_w(dev, 0x80, &value, 1); | ||
469 | value = 0x01; | ||
470 | reg_w(dev, 0x03, &value, 1); | ||
471 | value = 0x00; | ||
472 | reg_w(dev, 0x03, &value, 1); | ||
473 | value = 0x08; | ||
474 | reg_w(dev, 0x03, &value, 1); | ||
475 | /********************************************/ | 408 | /********************************************/ |
476 | 409 | ||
477 | /* reg_r(dev,0x0,ET_I2C_BASE,&received,1); | 410 | /* reg_r(dev, ET_I2C_BASE, &received, 1); |
478 | always 0x40 as the pas106 ??? */ | 411 | always 0x40 as the pas106 ??? */ |
479 | /* set the sensor */ | 412 | /* set the sensor */ |
480 | if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode) { | 413 | if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode) |
481 | value = 0x04; /* 320 */ | 414 | value = 0x04; /* 320 */ |
482 | reg_w(dev, ET_PXL_CLK, &value, 1); | 415 | else /* 640 */ |
483 | /* now set by fifo the FormatLine setting */ | 416 | value = 0x1e; /* 0x17 * setting PixelClock |
484 | reg_w(dev, 0x62, FormLine, 6); | 417 | * 0x03 mean 24/(3+1) = 6 Mhz |
485 | } else { /* 640 */ | 418 | * 0x05 -> 24/(5+1) = 4 Mhz |
486 | /* setting PixelClock | 419 | * 0x0b -> 24/(11+1) = 2 Mhz |
487 | 0x03 mean 24/(3+1) = 6 Mhz | 420 | * 0x17 -> 24/(23+1) = 1 Mhz |
488 | 0x05 -> 24/(5+1) = 4 Mhz | 421 | */ |
489 | 0x0b -> 24/(11+1) = 2 Mhz | 422 | reg_w_val(dev, ET_PXL_CLK, value); |
490 | 0x17 -> 24/(23+1) = 1 Mhz | 423 | /* now set by fifo the FormatLine setting */ |
491 | */ | 424 | reg_w(dev, 0x62, FormLine, 6); |
492 | value = 0x1e; /* 0x17 */ | ||
493 | reg_w(dev, ET_PXL_CLK, &value, 1); | ||
494 | /* now set by fifo the FormatLine setting */ | ||
495 | reg_w(dev, 0x62, FormLine, 6); | ||
496 | } | ||
497 | 425 | ||
498 | /* set exposure times [ 0..0x78] 0->longvalue 0x78->shortvalue */ | 426 | /* set exposure times [ 0..0x78] 0->longvalue 0x78->shortvalue */ |
499 | value = 0x47; /* 0x47; */ | 427 | reg_w_val(dev, 0x81, 0x47); /* 0x47; */ |
500 | reg_w(dev, 0x81, &value, 1); | 428 | reg_w_val(dev, 0x80, 0x40); /* 0x40; */ |
501 | value = 0x40; /* 0x40; */ | ||
502 | reg_w(dev, 0x80, &value, 1); | ||
503 | /* Pedro change */ | 429 | /* Pedro change */ |
504 | /* Brightness change Brith+ decrease value */ | 430 | /* Brightness change Brith+ decrease value */ |
505 | /* Brigth- increase value */ | 431 | /* Brigth- increase value */ |
506 | /* original value = 0x70; */ | 432 | /* original value = 0x70; */ |
507 | value = 0x30; /* 0x20; */ | 433 | reg_w_val(dev, 0x81, 0x30); /* 0x20; - set brightness */ |
508 | reg_w(dev, 0x81, &value, 1); /* set brightness */ | 434 | reg_w_val(dev, 0x80, 0x20); /* 0x20; */ |
509 | value = 0x20; /* 0x20; */ | ||
510 | reg_w(dev, 0x80, &value, 1); | ||
511 | } | 435 | } |
512 | 436 | ||
513 | static void setcolors(struct gspca_dev *gspca_dev) | 437 | static void setcolors(struct gspca_dev *gspca_dev) |
514 | { | 438 | { |
515 | struct sd *sd = (struct sd *) gspca_dev; | 439 | struct sd *sd = (struct sd *) gspca_dev; |
516 | struct usb_device *dev = gspca_dev->dev; | 440 | struct usb_device *dev = gspca_dev->dev; |
517 | static __u8 I2cc[] = { 0x05, 0x02, 0x02, 0x05, 0x0d }; | 441 | __u8 I2cc[] = { 0x05, 0x02, 0x02, 0x05, 0x0d }; |
518 | __u8 i2cflags = 0x01; | 442 | __u8 i2cflags = 0x01; |
519 | /* __u8 green = 0; */ | 443 | /* __u8 green = 0; */ |
520 | __u8 colors = sd->colors; | 444 | __u8 colors = sd->colors; |
@@ -525,7 +449,7 @@ static void setcolors(struct gspca_dev *gspca_dev) | |||
525 | /* I2cc[1] = I2cc[2] = green; */ | 449 | /* I2cc[1] = I2cc[2] = green; */ |
526 | if (sd->sensor == SENSOR_PAS106) { | 450 | if (sd->sensor == SENSOR_PAS106) { |
527 | Et_i2cwrite(dev, PAS106_REG13, &i2cflags, 1, 3); | 451 | Et_i2cwrite(dev, PAS106_REG13, &i2cflags, 1, 3); |
528 | Et_i2cwrite(dev, PAS106_REG9, I2cc, sizeof(I2cc), 1); | 452 | Et_i2cwrite(dev, PAS106_REG9, I2cc, sizeof I2cc, 1); |
529 | } | 453 | } |
530 | /* PDEBUG(D_CONF , "Etoms red %d blue %d green %d", | 454 | /* PDEBUG(D_CONF , "Etoms red %d blue %d green %d", |
531 | I2cc[3], I2cc[0], green); */ | 455 | I2cc[3], I2cc[0], green); */ |
@@ -534,11 +458,11 @@ static void setcolors(struct gspca_dev *gspca_dev) | |||
534 | static void getcolors(struct gspca_dev *gspca_dev) | 458 | static void getcolors(struct gspca_dev *gspca_dev) |
535 | { | 459 | { |
536 | struct sd *sd = (struct sd *) gspca_dev; | 460 | struct sd *sd = (struct sd *) gspca_dev; |
537 | /* __u8 valblue = 0; */ | 461 | /* __u8 valblue; */ |
538 | __u8 valred; | 462 | __u8 valred; |
539 | 463 | ||
540 | if (sd->sensor == SENSOR_PAS106) { | 464 | if (sd->sensor == SENSOR_PAS106) { |
541 | /* Et_i2cread(gspca_dev->dev,PAS106_REG9,&valblue,1,1); */ | 465 | /* Et_i2cread(gspca_dev->dev, PAS106_REG9, &valblue, 1, 1); */ |
542 | Et_i2cread(gspca_dev->dev, PAS106_REG9 + 3, &valred, 1, 1); | 466 | Et_i2cread(gspca_dev->dev, PAS106_REG9 + 3, &valred, 1, 1); |
543 | sd->colors = valred & 0x0f; | 467 | sd->colors = valred & 0x0f; |
544 | } | 468 | } |
@@ -547,126 +471,87 @@ static void getcolors(struct gspca_dev *gspca_dev) | |||
547 | static void Et_init1(struct gspca_dev *gspca_dev) | 471 | static void Et_init1(struct gspca_dev *gspca_dev) |
548 | { | 472 | { |
549 | struct usb_device *dev = gspca_dev->dev; | 473 | struct usb_device *dev = gspca_dev->dev; |
550 | __u8 value = 0x00; | 474 | __u8 value; |
551 | __u8 received = 0x00; | 475 | __u8 received; |
552 | /* __u8 I2c0 [] ={0x0a,0x12,0x05,0x22,0xac,0x00,0x01,0x00}; */ | 476 | /* __u8 I2c0 [] = {0x0a, 0x12, 0x05, 0x22, 0xac, 0x00, 0x01, 0x00}; */ |
553 | __u8 I2c0[] = { 0x0a, 0x12, 0x05, 0x6d, 0xcd, 0x00, 0x01, 0x00 }; | 477 | __u8 I2c0[] = { 0x0a, 0x12, 0x05, 0x6d, 0xcd, 0x00, 0x01, 0x00 }; |
554 | /* try 1/120 0x6d 0xcd 0x40 */ | 478 | /* try 1/120 0x6d 0xcd 0x40 */ |
555 | /* __u8 I2c0 [] ={0x0a,0x12,0x05,0xfe,0xfe,0xc0,0x01,0x00}; | 479 | /* __u8 I2c0 [] = {0x0a, 0x12, 0x05, 0xfe, 0xfe, 0xc0, 0x01, 0x00}; |
556 | * 1/60000 hmm ?? */ | 480 | * 1/60000 hmm ?? */ |
557 | 481 | ||
558 | PDEBUG(D_STREAM, "Open Init1 ET"); | 482 | PDEBUG(D_STREAM, "Open Init1 ET"); |
559 | value = 7; | 483 | reg_w_val(dev, ET_GPIO_DIR_CTRL, 7); |
560 | reg_w(dev, ET_GPIO_DIR_CTRL, &value, 1); | ||
561 | reg_r(dev, ET_GPIO_IN, &received, 1); | 484 | reg_r(dev, ET_GPIO_IN, &received, 1); |
562 | value = 1; | 485 | reg_w_val(dev, ET_RESET_ALL, 1); |
563 | reg_w(dev, ET_RESET_ALL, &value, 1); | 486 | reg_w_val(dev, ET_RESET_ALL, 0); |
564 | value = 0; | 487 | reg_w_val(dev, ET_ClCK, 0x10); |
565 | reg_w(dev, ET_RESET_ALL, &value, 1); | 488 | reg_w_val(dev, ET_CTRL, 0x19); |
566 | value = 0x10; | ||
567 | reg_w(dev, ET_ClCK, &value, 1); | ||
568 | value = 0x19; | ||
569 | reg_w(dev, ET_CTRL, &value, 1); | ||
570 | /* compression et subsampling */ | 489 | /* compression et subsampling */ |
571 | if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode) | 490 | if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode) |
572 | value = ET_COMP_VAL1; | 491 | value = ET_COMP_VAL1; |
573 | else | 492 | else |
574 | value = ET_COMP_VAL0; | 493 | value = ET_COMP_VAL0; |
575 | |||
576 | PDEBUG(D_STREAM, "Open mode %d Compression %d", | 494 | PDEBUG(D_STREAM, "Open mode %d Compression %d", |
577 | gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode, | 495 | gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode, |
578 | value); | 496 | value); |
579 | reg_w(dev, ET_COMP, &value, 1); | 497 | reg_w_val(dev, ET_COMP, value); |
580 | value = 0x1d; | 498 | reg_w_val(dev, ET_MAXQt, 0x1d); |
581 | reg_w(dev, ET_MAXQt, &value, 1); | 499 | reg_w_val(dev, ET_MINQt, 0x02); |
582 | value = 0x02; | ||
583 | reg_w(dev, ET_MINQt, &value, 1); | ||
584 | /* undocumented registers */ | 500 | /* undocumented registers */ |
585 | value = 0xff; | 501 | reg_w_val(dev, ET_REG1d, 0xff); |
586 | reg_w(dev, ET_REG1d, &value, 1); | 502 | reg_w_val(dev, ET_REG1e, 0xff); |
587 | value = 0xff; | 503 | reg_w_val(dev, ET_REG1f, 0xff); |
588 | reg_w(dev, ET_REG1e, &value, 1); | 504 | reg_w_val(dev, ET_REG20, 0x35); |
589 | value = 0xff; | 505 | reg_w_val(dev, ET_REG21, 0x01); |
590 | reg_w(dev, ET_REG1f, &value, 1); | 506 | reg_w_val(dev, ET_REG22, 0x00); |
591 | value = 0x35; | 507 | reg_w_val(dev, ET_REG23, 0xf7); |
592 | reg_w(dev, ET_REG20, &value, 1); | 508 | reg_w_val(dev, ET_REG24, 0xff); |
593 | value = 0x01; | 509 | reg_w_val(dev, ET_REG25, 0x07); |
594 | reg_w(dev, ET_REG21, &value, 1); | ||
595 | value = 0x00; | ||
596 | reg_w(dev, ET_REG22, &value, 1); | ||
597 | value = 0xf7; | ||
598 | reg_w(dev, ET_REG23, &value, 1); | ||
599 | value = 0xff; | ||
600 | reg_w(dev, ET_REG24, &value, 1); | ||
601 | value = 0x07; | ||
602 | reg_w(dev, ET_REG25, &value, 1); | ||
603 | /* colors setting */ | 510 | /* colors setting */ |
604 | value = 0x80; | 511 | reg_w_val(dev, ET_G_RED, 0x80); |
605 | reg_w(dev, ET_G_RED, &value, 1); | 512 | reg_w_val(dev, ET_G_GREEN1, 0x80); |
606 | value = 0x80; | 513 | reg_w_val(dev, ET_G_BLUE, 0x80); |
607 | reg_w(dev, ET_G_GREEN1, &value, 1); | 514 | reg_w_val(dev, ET_G_GREEN2, 0x80); |
608 | value = 0x80; | 515 | reg_w_val(dev, ET_G_GR_H, 0x00); |
609 | reg_w(dev, ET_G_BLUE, &value, 1); | 516 | reg_w_val(dev, ET_G_GB_H, 0x00); |
610 | value = 0x80; | ||
611 | reg_w(dev, ET_G_GREEN2, &value, 1); | ||
612 | value = 0x00; | ||
613 | reg_w(dev, ET_G_GR_H, &value, 1); | ||
614 | value = 0x00; | ||
615 | reg_w(dev, ET_G_GB_H, &value, 1); | ||
616 | /* Window control registers */ | 517 | /* Window control registers */ |
617 | value = 0xf0; | 518 | reg_w_val(dev, ET_SYNCHRO, 0xf0); |
618 | reg_w(dev, ET_SYNCHRO, &value, 1); | 519 | reg_w_val(dev, ET_STARTX, 0x56); /* 0x56 */ |
619 | value = 0x56; /* 0x56 */ | 520 | reg_w_val(dev, ET_STARTY, 0x05); /* 0x04 */ |
620 | reg_w(dev, ET_STARTX, &value, 1); | 521 | reg_w_val(dev, ET_WIDTH_LOW, 0x60); |
621 | value = 0x05; /* 0x04 */ | 522 | reg_w_val(dev, ET_HEIGTH_LOW, 0x20); |
622 | reg_w(dev, ET_STARTY, &value, 1); | 523 | reg_w_val(dev, ET_W_H_HEIGTH, 0x50); |
623 | value = 0x60; | 524 | reg_w_val(dev, ET_REG6e, 0x86); |
624 | reg_w(dev, ET_WIDTH_LOW, &value, 1); | 525 | reg_w_val(dev, ET_REG6f, 0x01); |
625 | value = 0x20; | 526 | reg_w_val(dev, ET_REG70, 0x86); |
626 | reg_w(dev, ET_HEIGTH_LOW, &value, 1); | 527 | reg_w_val(dev, ET_REG71, 0x14); |
627 | value = 0x50; | 528 | reg_w_val(dev, ET_REG72, 0x00); |
628 | reg_w(dev, ET_W_H_HEIGTH, &value, 1); | ||
629 | value = 0x86; | ||
630 | reg_w(dev, ET_REG6e, &value, 1); | ||
631 | value = 0x01; | ||
632 | reg_w(dev, ET_REG6f, &value, 1); | ||
633 | value = 0x86; | ||
634 | reg_w(dev, ET_REG70, &value, 1); | ||
635 | value = 0x14; | ||
636 | reg_w(dev, ET_REG71, &value, 1); | ||
637 | value = 0x00; | ||
638 | reg_w(dev, ET_REG72, &value, 1); | ||
639 | /* Clock Pattern registers */ | 529 | /* Clock Pattern registers */ |
640 | value = 0x00; | 530 | reg_w_val(dev, ET_REG73, 0x00); |
641 | reg_w(dev, ET_REG73, &value, 1); | 531 | reg_w_val(dev, ET_REG74, 0x00); |
642 | value = 0x00; | 532 | reg_w_val(dev, ET_REG75, 0x0a); |
643 | reg_w(dev, ET_REG74, &value, 1); | 533 | reg_w_val(dev, ET_I2C_CLK, 0x04); |
644 | value = 0x0a; | 534 | reg_w_val(dev, ET_PXL_CLK, 0x01); |
645 | reg_w(dev, ET_REG75, &value, 1); | ||
646 | value = 0x04; | ||
647 | reg_w(dev, ET_I2C_CLK, &value, 1); | ||
648 | value = 0x01; | ||
649 | reg_w(dev, ET_PXL_CLK, &value, 1); | ||
650 | /* set the sensor */ | 535 | /* set the sensor */ |
651 | if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode) { | 536 | if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode) { |
652 | I2c0[0] = 0x06; | 537 | I2c0[0] = 0x06; |
653 | Et_i2cwrite(dev, PAS106_REG2, I2c0, sizeof(I2c0), 1); | 538 | Et_i2cwrite(dev, PAS106_REG2, I2c0, sizeof I2c0, 1); |
654 | Et_i2cwrite(dev, PAS106_REG9, I2c2, sizeof(I2c2), 1); | 539 | Et_i2cwrite(dev, PAS106_REG9, I2c2, sizeof I2c2, 1); |
655 | value = 0x06; | 540 | value = 0x06; |
656 | Et_i2cwrite(dev, PAS106_REG2, &value, 1, 1); | 541 | Et_i2cwrite(dev, PAS106_REG2, &value, 1, 1); |
657 | Et_i2cwrite(dev, PAS106_REG3, I2c3, sizeof(I2c3), 1); | 542 | Et_i2cwrite(dev, PAS106_REG3, I2c3, sizeof I2c3, 1); |
658 | /* value = 0x1f; */ | 543 | /* value = 0x1f; */ |
659 | value = 0x04; | 544 | value = 0x04; |
660 | Et_i2cwrite(dev, PAS106_REG0e, &value, 1, 1); | 545 | Et_i2cwrite(dev, PAS106_REG0e, &value, 1, 1); |
661 | } else { | 546 | } else { |
662 | I2c0[0] = 0x0a; | 547 | I2c0[0] = 0x0a; |
663 | 548 | ||
664 | Et_i2cwrite(dev, PAS106_REG2, I2c0, sizeof(I2c0), 1); | 549 | Et_i2cwrite(dev, PAS106_REG2, I2c0, sizeof I2c0, 1); |
665 | Et_i2cwrite(dev, PAS106_REG9, I2c2, sizeof(I2c2), 1); | 550 | Et_i2cwrite(dev, PAS106_REG9, I2c2, sizeof I2c2, 1); |
666 | value = 0x0a; | 551 | value = 0x0a; |
667 | 552 | ||
668 | Et_i2cwrite(dev, PAS106_REG2, &value, 1, 1); | 553 | Et_i2cwrite(dev, PAS106_REG2, &value, 1, 1); |
669 | Et_i2cwrite(dev, PAS106_REG3, I2c3, sizeof(I2c3), 1); | 554 | Et_i2cwrite(dev, PAS106_REG3, I2c3, sizeof I2c3, 1); |
670 | value = 0x04; | 555 | value = 0x04; |
671 | /* value = 0x10; */ | 556 | /* value = 0x10; */ |
672 | Et_i2cwrite(dev, PAS106_REG0e, &value, 1, 1); | 557 | Et_i2cwrite(dev, PAS106_REG0e, &value, 1, 1); |
@@ -720,10 +605,10 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
720 | cam->cam_mode = vga_mode; | 605 | cam->cam_mode = vga_mode; |
721 | cam->nmodes = sizeof vga_mode / sizeof vga_mode[0]; | 606 | cam->nmodes = sizeof vga_mode / sizeof vga_mode[0]; |
722 | } | 607 | } |
723 | sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value; | 608 | sd->brightness = BRIGHTNESS_DEF; |
724 | sd->contrast = sd_ctrls[SD_CONTRAST].qctrl.default_value; | 609 | sd->contrast = CONTRAST_DEF; |
725 | sd->colors = sd_ctrls[SD_COLOR].qctrl.default_value; | 610 | sd->colors = COLOR_DEF; |
726 | sd->autogain = sd_ctrls[SD_AUTOGAIN].qctrl.default_value; | 611 | sd->autogain = AUTOGAIN_DEF; |
727 | return 0; | 612 | return 0; |
728 | } | 613 | } |
729 | 614 | ||
@@ -732,18 +617,13 @@ static int sd_open(struct gspca_dev *gspca_dev) | |||
732 | { | 617 | { |
733 | struct sd *sd = (struct sd *) gspca_dev; | 618 | struct sd *sd = (struct sd *) gspca_dev; |
734 | struct usb_device *dev = gspca_dev->dev; | 619 | struct usb_device *dev = gspca_dev->dev; |
735 | int err; | ||
736 | __u8 value; | ||
737 | 620 | ||
738 | PDEBUG(D_STREAM, "Initialize ET1"); | ||
739 | if (sd->sensor == SENSOR_PAS106) | 621 | if (sd->sensor == SENSOR_PAS106) |
740 | Et_init1(gspca_dev); | 622 | Et_init1(gspca_dev); |
741 | else | 623 | else |
742 | Et_init2(gspca_dev); | 624 | Et_init2(gspca_dev); |
743 | value = 0x08; | 625 | reg_w_val(dev, ET_RESET_ALL, 0x08); |
744 | reg_w(dev, ET_RESET_ALL, &value, 1); | 626 | et_video(dev, 0); /* video off */ |
745 | err = Et_videoOff(dev); | ||
746 | PDEBUG(D_STREAM, "Et_Init_VideoOff %d", err); | ||
747 | return 0; | 627 | return 0; |
748 | } | 628 | } |
749 | 629 | ||
@@ -752,27 +632,19 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
752 | { | 632 | { |
753 | struct sd *sd = (struct sd *) gspca_dev; | 633 | struct sd *sd = (struct sd *) gspca_dev; |
754 | struct usb_device *dev = gspca_dev->dev; | 634 | struct usb_device *dev = gspca_dev->dev; |
755 | int err; | ||
756 | __u8 value; | ||
757 | 635 | ||
758 | if (sd->sensor == SENSOR_PAS106) | 636 | if (sd->sensor == SENSOR_PAS106) |
759 | Et_init1(gspca_dev); | 637 | Et_init1(gspca_dev); |
760 | else | 638 | else |
761 | Et_init2(gspca_dev); | 639 | Et_init2(gspca_dev); |
762 | 640 | ||
763 | value = 0x08; | 641 | reg_w_val(dev, ET_RESET_ALL, 0x08); |
764 | reg_w(dev, ET_RESET_ALL, &value, 1); | 642 | et_video(dev, 1); /* video on */ |
765 | err = Et_videoOn(dev); | ||
766 | PDEBUG(D_STREAM, "Et_VideoOn %d", err); | ||
767 | } | 643 | } |
768 | 644 | ||
769 | static void sd_stopN(struct gspca_dev *gspca_dev) | 645 | static void sd_stopN(struct gspca_dev *gspca_dev) |
770 | { | 646 | { |
771 | int err; | 647 | et_video(gspca_dev->dev, 0); /* video off */ |
772 | |||
773 | err = Et_videoOff(gspca_dev->dev); | ||
774 | PDEBUG(D_STREAM, "Et_VideoOff %d", err); | ||
775 | |||
776 | } | 648 | } |
777 | 649 | ||
778 | static void sd_stop0(struct gspca_dev *gspca_dev) | 650 | static void sd_stop0(struct gspca_dev *gspca_dev) |
@@ -790,7 +662,7 @@ static void setbrightness(struct gspca_dev *gspca_dev) | |||
790 | __u8 brightness = sd->brightness; | 662 | __u8 brightness = sd->brightness; |
791 | 663 | ||
792 | for (i = 0; i < 4; i++) | 664 | for (i = 0; i < 4; i++) |
793 | reg_w(gspca_dev->dev, (ET_O_RED + i), &brightness, 1); | 665 | reg_w_val(gspca_dev->dev, (ET_O_RED + i), brightness); |
794 | } | 666 | } |
795 | 667 | ||
796 | static void getbrightness(struct gspca_dev *gspca_dev) | 668 | static void getbrightness(struct gspca_dev *gspca_dev) |
@@ -798,7 +670,7 @@ static void getbrightness(struct gspca_dev *gspca_dev) | |||
798 | struct sd *sd = (struct sd *) gspca_dev; | 670 | struct sd *sd = (struct sd *) gspca_dev; |
799 | int i; | 671 | int i; |
800 | int brightness = 0; | 672 | int brightness = 0; |
801 | __u8 value = 0; | 673 | __u8 value; |
802 | 674 | ||
803 | for (i = 0; i < 4; i++) { | 675 | for (i = 0; i < 4; i++) { |
804 | reg_r(gspca_dev->dev, (ET_O_RED + i), &value, 1); | 676 | reg_r(gspca_dev->dev, (ET_O_RED + i), &value, 1); |
@@ -895,7 +767,7 @@ static void setautogain(struct gspca_dev *gspca_dev) | |||
895 | 767 | ||
896 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 768 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
897 | struct gspca_frame *frame, /* target */ | 769 | struct gspca_frame *frame, /* target */ |
898 | unsigned char *data, /* isoc packet */ | 770 | __u8 *data, /* isoc packet */ |
899 | int len) /* iso packet length */ | 771 | int len) /* iso packet length */ |
900 | { | 772 | { |
901 | struct sd *sd; | 773 | struct sd *sd; |
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index b36913017d7b..ad4721b06920 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c | |||
@@ -247,7 +247,7 @@ static void isoc_transfer(struct gspca_dev *gspca_dev) | |||
247 | struct gspca_frame *gspca_frame_add(struct gspca_dev *gspca_dev, | 247 | struct gspca_frame *gspca_frame_add(struct gspca_dev *gspca_dev, |
248 | int packet_type, | 248 | int packet_type, |
249 | struct gspca_frame *frame, | 249 | struct gspca_frame *frame, |
250 | __u8 *data, | 250 | const __u8 *data, |
251 | int len) | 251 | int len) |
252 | { | 252 | { |
253 | int i, j; | 253 | int i, j; |
@@ -1053,7 +1053,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv, | |||
1053 | struct v4l2_control *ctrl) | 1053 | struct v4l2_control *ctrl) |
1054 | { | 1054 | { |
1055 | struct gspca_dev *gspca_dev = priv; | 1055 | struct gspca_dev *gspca_dev = priv; |
1056 | struct ctrl *ctrls; | 1056 | const struct ctrl *ctrls; |
1057 | int i, ret; | 1057 | int i, ret; |
1058 | 1058 | ||
1059 | for (i = 0, ctrls = gspca_dev->sd_desc->ctrls; | 1059 | for (i = 0, ctrls = gspca_dev->sd_desc->ctrls; |
@@ -1079,7 +1079,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv, | |||
1079 | { | 1079 | { |
1080 | struct gspca_dev *gspca_dev = priv; | 1080 | struct gspca_dev *gspca_dev = priv; |
1081 | 1081 | ||
1082 | struct ctrl *ctrls; | 1082 | const struct ctrl *ctrls; |
1083 | int i, ret; | 1083 | int i, ret; |
1084 | 1084 | ||
1085 | for (i = 0, ctrls = gspca_dev->sd_desc->ctrls; | 1085 | for (i = 0, ctrls = gspca_dev->sd_desc->ctrls; |
diff --git a/drivers/media/video/gspca/gspca.h b/drivers/media/video/gspca/gspca.h index 9c894daf356a..0d23e0a90c77 100644 --- a/drivers/media/video/gspca/gspca.h +++ b/drivers/media/video/gspca/gspca.h | |||
@@ -9,25 +9,6 @@ | |||
9 | #include <media/v4l2-common.h> | 9 | #include <media/v4l2-common.h> |
10 | #include <linux/mutex.h> | 10 | #include <linux/mutex.h> |
11 | 11 | ||
12 | /* values in 2.6.27 */ | ||
13 | #ifndef V4L2_PIX_FMT_SPCA501 | ||
14 | #define V4L2_PIX_FMT_SPCA501 v4l2_fourcc('S', '5', '0', '1') | ||
15 | #endif | ||
16 | #ifndef V4L2_PIX_FMT_SPCA561 | ||
17 | #define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') | ||
18 | #endif | ||
19 | |||
20 | /* values in 2.6.26 */ | ||
21 | #ifndef V4L2_CID_POWER_LINE_FREQUENCY | ||
22 | #define V4L2_CID_POWER_LINE_FREQUENCY (V4L2_CID_BASE+24) | ||
23 | #endif | ||
24 | #ifndef V4L2_CID_WHITE_BALANCE_TEMPERATURE | ||
25 | #define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE + 26) | ||
26 | #endif | ||
27 | #ifndef V4L2_CID_SHARPNESS | ||
28 | #define V4L2_CID_SHARPNESS (V4L2_CID_BASE+27) | ||
29 | #endif | ||
30 | |||
31 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 12 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
32 | /* GSPCA our debug messages */ | 13 | /* GSPCA our debug messages */ |
33 | extern int gspca_debug; | 14 | extern int gspca_debug; |
@@ -76,7 +57,6 @@ struct cam_mode { | |||
76 | short width; | 57 | short width; |
77 | short height; | 58 | short height; |
78 | short mode; /* subdriver value */ | 59 | short mode; /* subdriver value */ |
79 | short reserved; /* subdriver value */ | ||
80 | }; | 60 | }; |
81 | struct cam { | 61 | struct cam { |
82 | char *dev_name; | 62 | char *dev_name; |
@@ -110,9 +90,9 @@ struct ctrl { | |||
110 | /* subdriver description */ | 90 | /* subdriver description */ |
111 | struct sd_desc { | 91 | struct sd_desc { |
112 | /* information */ | 92 | /* information */ |
113 | char *name; /* sub-driver name */ | 93 | const char *name; /* sub-driver name */ |
114 | /* controls */ | 94 | /* controls */ |
115 | struct ctrl *ctrls; | 95 | const struct ctrl *ctrls; |
116 | int nctrls; | 96 | int nctrls; |
117 | /* operations */ | 97 | /* operations */ |
118 | cam_cf_op config; /* called on probe */ | 98 | cam_cf_op config; /* called on probe */ |
@@ -195,6 +175,6 @@ void gspca_disconnect(struct usb_interface *intf); | |||
195 | struct gspca_frame *gspca_frame_add(struct gspca_dev *gspca_dev, | 175 | struct gspca_frame *gspca_frame_add(struct gspca_dev *gspca_dev, |
196 | int packet_type, | 176 | int packet_type, |
197 | struct gspca_frame *frame, | 177 | struct gspca_frame *frame, |
198 | __u8 *data, | 178 | const __u8 *data, |
199 | int len); | 179 | int len); |
200 | #endif /* GSPCAV2_H */ | 180 | #endif /* GSPCAV2_H */ |
diff --git a/drivers/media/video/gspca/mars.c b/drivers/media/video/gspca/mars.c index 6556e0a330fa..c70ccc8fe68b 100644 --- a/drivers/media/video/gspca/mars.c +++ b/drivers/media/video/gspca/mars.c | |||
@@ -24,8 +24,8 @@ | |||
24 | #include "gspca.h" | 24 | #include "gspca.h" |
25 | #include "jpeg.h" | 25 | #include "jpeg.h" |
26 | 26 | ||
27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 0) | 27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4) |
28 | static const char version[] = "2.1.0"; | 28 | static const char version[] = "2.1.4"; |
29 | 29 | ||
30 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); | 30 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); |
31 | MODULE_DESCRIPTION("GSPCA/Mars USB Camera Driver"); | 31 | MODULE_DESCRIPTION("GSPCA/Mars USB Camera Driver"); |
@@ -140,7 +140,8 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
140 | __u16 MI_buf[242]; | 140 | __u16 MI_buf[242]; |
141 | int h_size, v_size; | 141 | int h_size, v_size; |
142 | int intpipe; | 142 | int intpipe; |
143 | /* struct usb_device *dev = pcam->dev; */ | 143 | /* struct usb_device *dev = pcam->dev; */ |
144 | |||
144 | memset(data, 0, sizeof data); | 145 | memset(data, 0, sizeof data); |
145 | memset(MI_buf, 0, sizeof MI_buf); | 146 | memset(MI_buf, 0, sizeof MI_buf); |
146 | 147 | ||
@@ -351,7 +352,7 @@ static void sd_close(struct gspca_dev *gspca_dev) | |||
351 | 352 | ||
352 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 353 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
353 | struct gspca_frame *frame, /* target */ | 354 | struct gspca_frame *frame, /* target */ |
354 | unsigned char *data, /* isoc packet */ | 355 | __u8 *data, /* isoc packet */ |
355 | int len) /* iso packet length */ | 356 | int len) /* iso packet length */ |
356 | { | 357 | { |
357 | struct sd *sd = (struct sd *) gspca_dev; | 358 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -389,7 +390,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
389 | } | 390 | } |
390 | 391 | ||
391 | /* sub-driver description */ | 392 | /* sub-driver description */ |
392 | static struct sd_desc sd_desc = { | 393 | static const struct sd_desc sd_desc = { |
393 | .name = MODULE_NAME, | 394 | .name = MODULE_NAME, |
394 | .ctrls = sd_ctrls, | 395 | .ctrls = sd_ctrls, |
395 | .nctrls = ARRAY_SIZE(sd_ctrls), | 396 | .nctrls = ARRAY_SIZE(sd_ctrls), |
@@ -404,7 +405,7 @@ static struct sd_desc sd_desc = { | |||
404 | 405 | ||
405 | /* -- module initialisation -- */ | 406 | /* -- module initialisation -- */ |
406 | #define DVNM(name) .driver_info = (kernel_ulong_t) name | 407 | #define DVNM(name) .driver_info = (kernel_ulong_t) name |
407 | static __devinitdata struct usb_device_id device_table[] = { | 408 | static const __devinitdata struct usb_device_id device_table[] = { |
408 | {USB_DEVICE(0x093a, 0x050f), DVNM("Mars-Semi Pc-Camera")}, | 409 | {USB_DEVICE(0x093a, 0x050f), DVNM("Mars-Semi Pc-Camera")}, |
409 | {} | 410 | {} |
410 | }; | 411 | }; |
diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c index 7d6237f18ba0..d92729ac41f0 100644 --- a/drivers/media/video/gspca/ov519.c +++ b/drivers/media/video/gspca/ov519.c | |||
@@ -24,8 +24,8 @@ | |||
24 | 24 | ||
25 | #include "gspca.h" | 25 | #include "gspca.h" |
26 | 26 | ||
27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 0) | 27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4) |
28 | static const char version[] = "2.1.0"; | 28 | static const char version[] = "2.1.4"; |
29 | 29 | ||
30 | MODULE_AUTHOR("Jean-Francois Moine <http://moinejf.free.fr>"); | 30 | MODULE_AUTHOR("Jean-Francois Moine <http://moinejf.free.fr>"); |
31 | MODULE_DESCRIPTION("OV519 USB Camera Driver"); | 31 | MODULE_DESCRIPTION("OV519 USB Camera Driver"); |
@@ -266,15 +266,15 @@ static unsigned char ov7670_abs_to_sm(unsigned char v) | |||
266 | static int reg_w(struct sd *sd, __u16 index, __u8 value) | 266 | static int reg_w(struct sd *sd, __u16 index, __u8 value) |
267 | { | 267 | { |
268 | int ret; | 268 | int ret; |
269 | __u8 buf[4]; | 269 | __u8 data; |
270 | 270 | ||
271 | buf[0] = value; | 271 | data = value; |
272 | ret = usb_control_msg(sd->gspca_dev.dev, | 272 | ret = usb_control_msg(sd->gspca_dev.dev, |
273 | usb_sndctrlpipe(sd->gspca_dev.dev, 0), | 273 | usb_sndctrlpipe(sd->gspca_dev.dev, 0), |
274 | 1, /* REQ_IO (ov518/519) */ | 274 | 1, /* REQ_IO (ov518/519) */ |
275 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 275 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
276 | 0, index, | 276 | 0, index, |
277 | &buf[0], 1, 500); | 277 | &data, 1, 500); |
278 | if (ret < 0) | 278 | if (ret < 0) |
279 | PDEBUG(D_ERR, "Write reg [%02x] %02x failed", index, value); | 279 | PDEBUG(D_ERR, "Write reg [%02x] %02x failed", index, value); |
280 | return ret; | 280 | return ret; |
@@ -285,16 +285,16 @@ static int reg_w(struct sd *sd, __u16 index, __u8 value) | |||
285 | static int reg_r(struct sd *sd, __u16 index) | 285 | static int reg_r(struct sd *sd, __u16 index) |
286 | { | 286 | { |
287 | int ret; | 287 | int ret; |
288 | __u8 buf[4]; | 288 | __u8 data; |
289 | 289 | ||
290 | ret = usb_control_msg(sd->gspca_dev.dev, | 290 | ret = usb_control_msg(sd->gspca_dev.dev, |
291 | usb_rcvctrlpipe(sd->gspca_dev.dev, 0), | 291 | usb_rcvctrlpipe(sd->gspca_dev.dev, 0), |
292 | 1, /* REQ_IO */ | 292 | 1, /* REQ_IO */ |
293 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 293 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
294 | 0, index, &buf[0], 1, 500); | 294 | 0, index, &data, 1, 500); |
295 | 295 | ||
296 | if (ret >= 0) | 296 | if (ret >= 0) |
297 | ret = buf[0]; | 297 | ret = data; |
298 | else | 298 | else |
299 | PDEBUG(D_ERR, "Read reg [0x%02x] failed", index); | 299 | PDEBUG(D_ERR, "Read reg [0x%02x] failed", index); |
300 | return ret; | 300 | return ret; |
@@ -302,7 +302,7 @@ static int reg_r(struct sd *sd, __u16 index) | |||
302 | 302 | ||
303 | /* Read 8 values from a OV519 register */ | 303 | /* Read 8 values from a OV519 register */ |
304 | static int reg_r8(struct sd *sd, | 304 | static int reg_r8(struct sd *sd, |
305 | __u16 index) | 305 | __u16 index) |
306 | { | 306 | { |
307 | int ret; | 307 | int ret; |
308 | __u8 buf[8]; | 308 | __u8 buf[8]; |
@@ -528,7 +528,7 @@ struct ov_i2c_regvals { | |||
528 | }; | 528 | }; |
529 | 529 | ||
530 | static int write_regvals(struct sd *sd, | 530 | static int write_regvals(struct sd *sd, |
531 | struct ov_regvals *regvals, | 531 | const struct ov_regvals *regvals, |
532 | int n) | 532 | int n) |
533 | { | 533 | { |
534 | int rc; | 534 | int rc; |
@@ -543,7 +543,7 @@ static int write_regvals(struct sd *sd, | |||
543 | } | 543 | } |
544 | 544 | ||
545 | static int write_i2c_regvals(struct sd *sd, | 545 | static int write_i2c_regvals(struct sd *sd, |
546 | struct ov_i2c_regvals *regvals, | 546 | const struct ov_i2c_regvals *regvals, |
547 | int n) | 547 | int n) |
548 | { | 548 | { |
549 | int rc; | 549 | int rc; |
@@ -569,7 +569,7 @@ static int write_i2c_regvals(struct sd *sd, | |||
569 | static int ov8xx0_configure(struct sd *sd) | 569 | static int ov8xx0_configure(struct sd *sd) |
570 | { | 570 | { |
571 | int rc; | 571 | int rc; |
572 | static struct ov_i2c_regvals norm_8610[] = { | 572 | static const struct ov_i2c_regvals norm_8610[] = { |
573 | { 0x12, 0x80 }, | 573 | { 0x12, 0x80 }, |
574 | { 0x00, 0x00 }, | 574 | { 0x00, 0x00 }, |
575 | { 0x01, 0x80 }, | 575 | { 0x01, 0x80 }, |
@@ -707,7 +707,7 @@ static int ov7xx0_configure(struct sd *sd) | |||
707 | * 0x05 (old driver setting): very overexposed, too much | 707 | * 0x05 (old driver setting): very overexposed, too much |
708 | * contrast | 708 | * contrast |
709 | */ | 709 | */ |
710 | static struct ov_i2c_regvals norm_7610[] = { | 710 | static const struct ov_i2c_regvals norm_7610[] = { |
711 | { 0x10, 0xff }, | 711 | { 0x10, 0xff }, |
712 | { 0x16, 0x06 }, | 712 | { 0x16, 0x06 }, |
713 | { 0x28, 0x24 }, | 713 | { 0x28, 0x24 }, |
@@ -737,7 +737,7 @@ static int ov7xx0_configure(struct sd *sd) | |||
737 | { 0x0d, 0x24 }, | 737 | { 0x0d, 0x24 }, |
738 | }; | 738 | }; |
739 | 739 | ||
740 | static struct ov_i2c_regvals norm_7620[] = { | 740 | static const struct ov_i2c_regvals norm_7620[] = { |
741 | { 0x00, 0x00 }, /* gain */ | 741 | { 0x00, 0x00 }, /* gain */ |
742 | { 0x01, 0x80 }, /* blue gain */ | 742 | { 0x01, 0x80 }, /* blue gain */ |
743 | { 0x02, 0x80 }, /* red gain */ | 743 | { 0x02, 0x80 }, /* red gain */ |
@@ -804,14 +804,14 @@ static int ov7xx0_configure(struct sd *sd) | |||
804 | }; | 804 | }; |
805 | 805 | ||
806 | /* 7640 and 7648. The defaults should be OK for most registers. */ | 806 | /* 7640 and 7648. The defaults should be OK for most registers. */ |
807 | static struct ov_i2c_regvals norm_7640[] = { | 807 | static const struct ov_i2c_regvals norm_7640[] = { |
808 | { 0x12, 0x80 }, | 808 | { 0x12, 0x80 }, |
809 | { 0x12, 0x14 }, | 809 | { 0x12, 0x14 }, |
810 | }; | 810 | }; |
811 | 811 | ||
812 | /* 7670. Defaults taken from OmniVision provided data, | 812 | /* 7670. Defaults taken from OmniVision provided data, |
813 | * as provided by Jonathan Corbet of OLPC */ | 813 | * as provided by Jonathan Corbet of OLPC */ |
814 | static struct ov_i2c_regvals norm_7670[] = { | 814 | static const struct ov_i2c_regvals norm_7670[] = { |
815 | { OV7670_REG_COM7, OV7670_COM7_RESET }, | 815 | { OV7670_REG_COM7, OV7670_COM7_RESET }, |
816 | { OV7670_REG_TSLB, 0x04 }, /* OV */ | 816 | { OV7670_REG_TSLB, 0x04 }, /* OV */ |
817 | { OV7670_REG_COM7, OV7670_COM7_FMT_VGA }, /* VGA */ | 817 | { OV7670_REG_COM7, OV7670_COM7_FMT_VGA }, /* VGA */ |
@@ -1075,7 +1075,7 @@ static int ov7xx0_configure(struct sd *sd) | |||
1075 | static int ov6xx0_configure(struct sd *sd) | 1075 | static int ov6xx0_configure(struct sd *sd) |
1076 | { | 1076 | { |
1077 | int rc; | 1077 | int rc; |
1078 | static struct ov_i2c_regvals norm_6x20[] = { | 1078 | static const struct ov_i2c_regvals norm_6x20[] = { |
1079 | { 0x12, 0x80 }, /* reset */ | 1079 | { 0x12, 0x80 }, /* reset */ |
1080 | { 0x11, 0x01 }, | 1080 | { 0x11, 0x01 }, |
1081 | { 0x03, 0x60 }, | 1081 | { 0x03, 0x60 }, |
@@ -1118,7 +1118,7 @@ static int ov6xx0_configure(struct sd *sd) | |||
1118 | /* Toggle 0x12[2] off and on here? */ | 1118 | /* Toggle 0x12[2] off and on here? */ |
1119 | }; | 1119 | }; |
1120 | 1120 | ||
1121 | static struct ov_i2c_regvals norm_6x30[] = { | 1121 | static const struct ov_i2c_regvals norm_6x30[] = { |
1122 | { 0x12, 0x80 }, /* Reset */ | 1122 | { 0x12, 0x80 }, /* Reset */ |
1123 | { 0x00, 0x1f }, /* Gain */ | 1123 | { 0x00, 0x1f }, /* Gain */ |
1124 | { 0x01, 0x99 }, /* Blue gain */ | 1124 | { 0x01, 0x99 }, /* Blue gain */ |
@@ -1284,7 +1284,7 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
1284 | struct cam *cam; | 1284 | struct cam *cam; |
1285 | 1285 | ||
1286 | /* (from ov519_configure) */ | 1286 | /* (from ov519_configure) */ |
1287 | static struct ov_regvals init_519[] = { | 1287 | static const struct ov_regvals init_519[] = { |
1288 | { 0x5a, 0x6d }, /* EnableSystem */ | 1288 | { 0x5a, 0x6d }, /* EnableSystem */ |
1289 | /* jfm trace usbsnoop3-1.txt */ | 1289 | /* jfm trace usbsnoop3-1.txt */ |
1290 | /* jfm 53 = fb */ | 1290 | /* jfm 53 = fb */ |
@@ -1302,8 +1302,7 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
1302 | /* windows reads 0x55 at this point*/ | 1302 | /* windows reads 0x55 at this point*/ |
1303 | }; | 1303 | }; |
1304 | 1304 | ||
1305 | if (write_regvals(sd, init_519, | 1305 | if (write_regvals(sd, init_519, ARRAY_SIZE(init_519))) |
1306 | sizeof init_519 / sizeof init_519[0])) | ||
1307 | goto error; | 1306 | goto error; |
1308 | /* jfm: not seen in windows trace */ | 1307 | /* jfm: not seen in windows trace */ |
1309 | if (ov519_init_compression(sd)) | 1308 | if (ov519_init_compression(sd)) |
@@ -1389,7 +1388,7 @@ static int sd_open(struct gspca_dev *gspca_dev) | |||
1389 | static int ov519_mode_init_regs(struct sd *sd, | 1388 | static int ov519_mode_init_regs(struct sd *sd, |
1390 | int width, int height) | 1389 | int width, int height) |
1391 | { | 1390 | { |
1392 | static struct ov_regvals mode_init_519_ov7670[] = { | 1391 | static const struct ov_regvals mode_init_519_ov7670[] = { |
1393 | { 0x5d, 0x03 }, /* Turn off suspend mode */ | 1392 | { 0x5d, 0x03 }, /* Turn off suspend mode */ |
1394 | { 0x53, 0x9f }, /* was 9b in 1.65-1.08 */ | 1393 | { 0x53, 0x9f }, /* was 9b in 1.65-1.08 */ |
1395 | { 0x54, 0x0f }, /* bit2 (jpeg enable) */ | 1394 | { 0x54, 0x0f }, /* bit2 (jpeg enable) */ |
@@ -1412,7 +1411,7 @@ static int ov519_mode_init_regs(struct sd *sd, | |||
1412 | /* windows reads 0x55 at this point, why? */ | 1411 | /* windows reads 0x55 at this point, why? */ |
1413 | }; | 1412 | }; |
1414 | 1413 | ||
1415 | static struct ov_regvals mode_init_519[] = { | 1414 | static const struct ov_regvals mode_init_519[] = { |
1416 | { 0x5d, 0x03 }, /* Turn off suspend mode */ | 1415 | { 0x5d, 0x03 }, /* Turn off suspend mode */ |
1417 | { 0x53, 0x9f }, /* was 9b in 1.65-1.08 */ | 1416 | { 0x53, 0x9f }, /* was 9b in 1.65-1.08 */ |
1418 | { 0x54, 0x0f }, /* bit2 (jpeg enable) */ | 1417 | { 0x54, 0x0f }, /* bit2 (jpeg enable) */ |
@@ -1448,12 +1447,11 @@ static int ov519_mode_init_regs(struct sd *sd, | |||
1448 | /******** Set the mode ********/ | 1447 | /******** Set the mode ********/ |
1449 | if (sd->sensor != SEN_OV7670) { | 1448 | if (sd->sensor != SEN_OV7670) { |
1450 | if (write_regvals(sd, mode_init_519, | 1449 | if (write_regvals(sd, mode_init_519, |
1451 | sizeof mode_init_519 / sizeof mode_init_519[0])) | 1450 | ARRAY_SIZE(mode_init_519))) |
1452 | return -EIO; | 1451 | return -EIO; |
1453 | } else { | 1452 | } else { |
1454 | if (write_regvals(sd, mode_init_519_ov7670, | 1453 | if (write_regvals(sd, mode_init_519_ov7670, |
1455 | sizeof mode_init_519_ov7670 | 1454 | ARRAY_SIZE(mode_init_519_ov7670))) |
1456 | / sizeof mode_init_519_ov7670[0])) | ||
1457 | return -EIO; | 1455 | return -EIO; |
1458 | } | 1456 | } |
1459 | 1457 | ||
@@ -1883,7 +1881,7 @@ static void sd_close(struct gspca_dev *gspca_dev) | |||
1883 | 1881 | ||
1884 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 1882 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
1885 | struct gspca_frame *frame, /* target */ | 1883 | struct gspca_frame *frame, /* target */ |
1886 | unsigned char *data, /* isoc packet */ | 1884 | __u8 *data, /* isoc packet */ |
1887 | int len) /* iso packet length */ | 1885 | int len) /* iso packet length */ |
1888 | { | 1886 | { |
1889 | /* Header of ov519 is 16 bytes: | 1887 | /* Header of ov519 is 16 bytes: |
@@ -1982,7 +1980,7 @@ static void setcontrast(struct gspca_dev *gspca_dev) | |||
1982 | case SEN_OV6630: | 1980 | case SEN_OV6630: |
1983 | i2c_w_mask(sd, OV7610_REG_CNT, val >> 4, 0x0f); | 1981 | i2c_w_mask(sd, OV7610_REG_CNT, val >> 4, 0x0f); |
1984 | case SEN_OV8610: { | 1982 | case SEN_OV8610: { |
1985 | static __u8 ctab[] = { | 1983 | static const __u8 ctab[] = { |
1986 | 0x03, 0x09, 0x0b, 0x0f, 0x53, 0x6f, 0x35, 0x7f | 1984 | 0x03, 0x09, 0x0b, 0x0f, 0x53, 0x6f, 0x35, 0x7f |
1987 | }; | 1985 | }; |
1988 | 1986 | ||
@@ -1991,7 +1989,7 @@ static void setcontrast(struct gspca_dev *gspca_dev) | |||
1991 | break; | 1989 | break; |
1992 | } | 1990 | } |
1993 | case SEN_OV7620: { | 1991 | case SEN_OV7620: { |
1994 | static __u8 ctab[] = { | 1992 | static const __u8 ctab[] = { |
1995 | 0x01, 0x05, 0x09, 0x11, 0x15, 0x35, 0x37, 0x57, | 1993 | 0x01, 0x05, 0x09, 0x11, 0x15, 0x35, 0x37, 0x57, |
1996 | 0x5b, 0xa5, 0xa7, 0xc7, 0xc9, 0xcf, 0xef, 0xff | 1994 | 0x5b, 0xa5, 0xa7, 0xc7, 0xc9, 0xcf, 0xef, 0xff |
1997 | }; | 1995 | }; |
@@ -2104,7 +2102,7 @@ static int sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val) | |||
2104 | } | 2102 | } |
2105 | 2103 | ||
2106 | /* sub-driver description */ | 2104 | /* sub-driver description */ |
2107 | static struct sd_desc sd_desc = { | 2105 | static const struct sd_desc sd_desc = { |
2108 | .name = MODULE_NAME, | 2106 | .name = MODULE_NAME, |
2109 | .ctrls = sd_ctrls, | 2107 | .ctrls = sd_ctrls, |
2110 | .nctrls = ARRAY_SIZE(sd_ctrls), | 2108 | .nctrls = ARRAY_SIZE(sd_ctrls), |
@@ -2119,7 +2117,7 @@ static struct sd_desc sd_desc = { | |||
2119 | 2117 | ||
2120 | /* -- module initialisation -- */ | 2118 | /* -- module initialisation -- */ |
2121 | #define DVNM(name) .driver_info = (kernel_ulong_t) name | 2119 | #define DVNM(name) .driver_info = (kernel_ulong_t) name |
2122 | static __devinitdata struct usb_device_id device_table[] = { | 2120 | static const __devinitdata struct usb_device_id device_table[] = { |
2123 | {USB_DEVICE(0x041e, 0x4052), DVNM("Creative Live! VISTA IM")}, | 2121 | {USB_DEVICE(0x041e, 0x4052), DVNM("Creative Live! VISTA IM")}, |
2124 | {USB_DEVICE(0x041e, 0x405f), DVNM("Creative Live! VISTA VF0330")}, | 2122 | {USB_DEVICE(0x041e, 0x405f), DVNM("Creative Live! VISTA VF0330")}, |
2125 | {USB_DEVICE(0x041e, 0x4060), DVNM("Creative Live! VISTA VF0350")}, | 2123 | {USB_DEVICE(0x041e, 0x4060), DVNM("Creative Live! VISTA VF0350")}, |
diff --git a/drivers/media/video/gspca/pac207.c b/drivers/media/video/gspca/pac207.c index 84986684c4db..7e067456e62b 100644 --- a/drivers/media/video/gspca/pac207.c +++ b/drivers/media/video/gspca/pac207.c | |||
@@ -27,8 +27,8 @@ | |||
27 | 27 | ||
28 | #include "gspca.h" | 28 | #include "gspca.h" |
29 | 29 | ||
30 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 0) | 30 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4) |
31 | static const char version[] = "2.1.0"; | 31 | static const char version[] = "2.1.4"; |
32 | 32 | ||
33 | MODULE_AUTHOR("Hans de Goede <j.w.r.degoede@hhs.nl>"); | 33 | MODULE_AUTHOR("Hans de Goede <j.w.r.degoede@hhs.nl>"); |
34 | MODULE_DESCRIPTION("Pixart PAC207"); | 34 | MODULE_DESCRIPTION("Pixart PAC207"); |
@@ -716,7 +716,7 @@ static int pac207_decode_frame_data(struct gspca_dev *gspca_dev, | |||
716 | 716 | ||
717 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 717 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
718 | struct gspca_frame *frame, | 718 | struct gspca_frame *frame, |
719 | unsigned char *data, | 719 | __u8 *data, |
720 | int len) | 720 | int len) |
721 | { | 721 | { |
722 | unsigned char *sof; | 722 | unsigned char *sof; |
@@ -754,8 +754,8 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
754 | 754 | ||
755 | n = pac207_decode_frame_data(gspca_dev, frame, data, len); | 755 | n = pac207_decode_frame_data(gspca_dev, frame, data, len); |
756 | if (n) | 756 | if (n) |
757 | frame = gspca_frame_add(gspca_dev, LAST_PACKET, | 757 | gspca_frame_add(gspca_dev, LAST_PACKET, |
758 | frame, NULL, 0); | 758 | frame, NULL, 0); |
759 | } | 759 | } |
760 | 760 | ||
761 | static void setbrightness(struct gspca_dev *gspca_dev) | 761 | static void setbrightness(struct gspca_dev *gspca_dev) |
@@ -879,7 +879,7 @@ static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val) | |||
879 | } | 879 | } |
880 | 880 | ||
881 | /* sub-driver description */ | 881 | /* sub-driver description */ |
882 | static struct sd_desc sd_desc = { | 882 | static const struct sd_desc sd_desc = { |
883 | .name = MODULE_NAME, | 883 | .name = MODULE_NAME, |
884 | .ctrls = sd_ctrls, | 884 | .ctrls = sd_ctrls, |
885 | .nctrls = ARRAY_SIZE(sd_ctrls), | 885 | .nctrls = ARRAY_SIZE(sd_ctrls), |
@@ -895,7 +895,7 @@ static struct sd_desc sd_desc = { | |||
895 | 895 | ||
896 | /* -- module initialisation -- */ | 896 | /* -- module initialisation -- */ |
897 | #define DVNM(name) .driver_info = (kernel_ulong_t) name | 897 | #define DVNM(name) .driver_info = (kernel_ulong_t) name |
898 | static __devinitdata struct usb_device_id device_table[] = { | 898 | static const __devinitdata struct usb_device_id device_table[] = { |
899 | {USB_DEVICE(0x041e, 0x4028), DVNM("Creative Webcam Vista Plus")}, | 899 | {USB_DEVICE(0x041e, 0x4028), DVNM("Creative Webcam Vista Plus")}, |
900 | {USB_DEVICE(0x093a, 0x2460), DVNM("Q-Tec Webcam 100")}, | 900 | {USB_DEVICE(0x093a, 0x2460), DVNM("Q-Tec Webcam 100")}, |
901 | {USB_DEVICE(0x093a, 0x2463), DVNM("Philips spc200nc pac207")}, | 901 | {USB_DEVICE(0x093a, 0x2463), DVNM("Philips spc200nc pac207")}, |
diff --git a/drivers/media/video/gspca/pac7311.c b/drivers/media/video/gspca/pac7311.c index 14cc49a4c2cc..c2d4b6a4dcf4 100644 --- a/drivers/media/video/gspca/pac7311.c +++ b/drivers/media/video/gspca/pac7311.c | |||
@@ -23,8 +23,8 @@ | |||
23 | 23 | ||
24 | #include "gspca.h" | 24 | #include "gspca.h" |
25 | 25 | ||
26 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 3) | 26 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4) |
27 | static const char version[] = "2.1.3"; | 27 | static const char version[] = "2.1.4"; |
28 | 28 | ||
29 | MODULE_AUTHOR("Thomas Kaiser thomas@kaiser-linux.li"); | 29 | MODULE_AUTHOR("Thomas Kaiser thomas@kaiser-linux.li"); |
30 | MODULE_DESCRIPTION("Pixart PAC7311"); | 30 | MODULE_DESCRIPTION("Pixart PAC7311"); |
@@ -37,7 +37,6 @@ struct sd { | |||
37 | int avg_lum; | 37 | int avg_lum; |
38 | 38 | ||
39 | unsigned char brightness; | 39 | unsigned char brightness; |
40 | #define BRIGHTNESS_MAX 0x20 | ||
41 | unsigned char contrast; | 40 | unsigned char contrast; |
42 | unsigned char colors; | 41 | unsigned char colors; |
43 | unsigned char autogain; | 42 | unsigned char autogain; |
@@ -58,21 +57,21 @@ static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val); | |||
58 | static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val); | 57 | static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val); |
59 | 58 | ||
60 | static struct ctrl sd_ctrls[] = { | 59 | static struct ctrl sd_ctrls[] = { |
61 | #define SD_BRIGHTNESS 0 | ||
62 | { | 60 | { |
63 | { | 61 | { |
64 | .id = V4L2_CID_BRIGHTNESS, | 62 | .id = V4L2_CID_BRIGHTNESS, |
65 | .type = V4L2_CTRL_TYPE_INTEGER, | 63 | .type = V4L2_CTRL_TYPE_INTEGER, |
66 | .name = "Brightness", | 64 | .name = "Brightness", |
67 | .minimum = 0, | 65 | .minimum = 0, |
66 | #define BRIGHTNESS_MAX 0x20 | ||
68 | .maximum = BRIGHTNESS_MAX, | 67 | .maximum = BRIGHTNESS_MAX, |
69 | .step = 1, | 68 | .step = 1, |
70 | .default_value = 0x10, | 69 | #define BRIGHTNESS_DEF 0x10 |
70 | .default_value = BRIGHTNESS_DEF, | ||
71 | }, | 71 | }, |
72 | .set = sd_setbrightness, | 72 | .set = sd_setbrightness, |
73 | .get = sd_getbrightness, | 73 | .get = sd_getbrightness, |
74 | }, | 74 | }, |
75 | #define SD_CONTRAST 1 | ||
76 | { | 75 | { |
77 | { | 76 | { |
78 | .id = V4L2_CID_CONTRAST, | 77 | .id = V4L2_CID_CONTRAST, |
@@ -81,12 +80,12 @@ static struct ctrl sd_ctrls[] = { | |||
81 | .minimum = 0, | 80 | .minimum = 0, |
82 | .maximum = 255, | 81 | .maximum = 255, |
83 | .step = 1, | 82 | .step = 1, |
84 | .default_value = 127, | 83 | #define CONTRAST_DEF 127 |
84 | .default_value = CONTRAST_DEF, | ||
85 | }, | 85 | }, |
86 | .set = sd_setcontrast, | 86 | .set = sd_setcontrast, |
87 | .get = sd_getcontrast, | 87 | .get = sd_getcontrast, |
88 | }, | 88 | }, |
89 | #define SD_COLOR 2 | ||
90 | { | 89 | { |
91 | { | 90 | { |
92 | .id = V4L2_CID_SATURATION, | 91 | .id = V4L2_CID_SATURATION, |
@@ -95,12 +94,12 @@ static struct ctrl sd_ctrls[] = { | |||
95 | .minimum = 0, | 94 | .minimum = 0, |
96 | .maximum = 255, | 95 | .maximum = 255, |
97 | .step = 1, | 96 | .step = 1, |
98 | .default_value = 127, | 97 | #define COLOR_DEF 127 |
98 | .default_value = COLOR_DEF, | ||
99 | }, | 99 | }, |
100 | .set = sd_setcolors, | 100 | .set = sd_setcolors, |
101 | .get = sd_getcolors, | 101 | .get = sd_getcolors, |
102 | }, | 102 | }, |
103 | #define SD_AUTOGAIN 3 | ||
104 | { | 103 | { |
105 | { | 104 | { |
106 | .id = V4L2_CID_AUTOGAIN, | 105 | .id = V4L2_CID_AUTOGAIN, |
@@ -109,7 +108,8 @@ static struct ctrl sd_ctrls[] = { | |||
109 | .minimum = 0, | 108 | .minimum = 0, |
110 | .maximum = 1, | 109 | .maximum = 1, |
111 | .step = 1, | 110 | .step = 1, |
112 | .default_value = 1, | 111 | #define AUTOGAIN_DEF 1 |
112 | .default_value = AUTOGAIN_DEF, | ||
113 | }, | 113 | }, |
114 | .set = sd_setautogain, | 114 | .set = sd_setautogain, |
115 | .get = sd_getautogain, | 115 | .get = sd_getautogain, |
@@ -124,7 +124,7 @@ static struct cam_mode vga_mode[] = { | |||
124 | 124 | ||
125 | #define PAC7311_JPEG_HEADER_SIZE (sizeof pac7311_jpeg_header) /* (594) */ | 125 | #define PAC7311_JPEG_HEADER_SIZE (sizeof pac7311_jpeg_header) /* (594) */ |
126 | 126 | ||
127 | const unsigned char pac7311_jpeg_header[] = { | 127 | static const __u8 pac7311_jpeg_header[] = { |
128 | 0xff, 0xd8, | 128 | 0xff, 0xd8, |
129 | 0xff, 0xe0, 0x00, 0x03, 0x20, | 129 | 0xff, 0xe0, 0x00, 0x03, 0x20, |
130 | 0xff, 0xc0, 0x00, 0x11, 0x08, | 130 | 0xff, 0xc0, 0x00, 0x11, 0x08, |
@@ -195,8 +195,8 @@ const unsigned char pac7311_jpeg_header[] = { | |||
195 | }; | 195 | }; |
196 | 196 | ||
197 | static void reg_w(struct usb_device *dev, | 197 | static void reg_w(struct usb_device *dev, |
198 | __u16 index, | 198 | __u16 index, |
199 | char *buffer, __u16 len) | 199 | const char *buffer, __u16 len) |
200 | { | 200 | { |
201 | __u8 tmpbuf[8]; | 201 | __u8 tmpbuf[8]; |
202 | 202 | ||
@@ -263,10 +263,10 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
263 | cam->cam_mode = vga_mode; | 263 | cam->cam_mode = vga_mode; |
264 | cam->nmodes = ARRAY_SIZE(vga_mode); | 264 | cam->nmodes = ARRAY_SIZE(vga_mode); |
265 | 265 | ||
266 | sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value; | 266 | sd->brightness = BRIGHTNESS_DEF; |
267 | sd->contrast = sd_ctrls[SD_CONTRAST].qctrl.default_value; | 267 | sd->contrast = CONTRAST_DEF; |
268 | sd->colors = sd_ctrls[SD_COLOR].qctrl.default_value; | 268 | sd->colors = COLOR_DEF; |
269 | sd->autogain = sd_ctrls[SD_AUTOGAIN].qctrl.default_value; | 269 | sd->autogain = AUTOGAIN_DEF; |
270 | return 0; | 270 | return 0; |
271 | } | 271 | } |
272 | 272 | ||
@@ -278,7 +278,7 @@ static void setbrightness(struct gspca_dev *gspca_dev) | |||
278 | /*jfm: inverted?*/ | 278 | /*jfm: inverted?*/ |
279 | brightness = BRIGHTNESS_MAX - sd->brightness; | 279 | brightness = BRIGHTNESS_MAX - sd->brightness; |
280 | pac7311_reg_write(gspca_dev->dev, 0xff, 0x04); | 280 | pac7311_reg_write(gspca_dev->dev, 0xff, 0x04); |
281 | /* pac7311_reg_write(gspca_dev->dev, 0x0e, 0x00); */ | 281 | /* pac7311_reg_write(gspca_dev->dev, 0x0e, 0x00); */ |
282 | pac7311_reg_write(gspca_dev->dev, 0x0f, brightness); | 282 | pac7311_reg_write(gspca_dev->dev, 0x0f, brightness); |
283 | /* load registers to sensor (Bit 0, auto clear) */ | 283 | /* load registers to sensor (Bit 0, auto clear) */ |
284 | pac7311_reg_write(gspca_dev->dev, 0x11, 0x01); | 284 | pac7311_reg_write(gspca_dev->dev, 0x11, 0x01); |
@@ -502,7 +502,7 @@ static void setautogain(struct gspca_dev *gspca_dev, int luma) | |||
502 | 502 | ||
503 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 503 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
504 | struct gspca_frame *frame, /* target */ | 504 | struct gspca_frame *frame, /* target */ |
505 | unsigned char *data, /* isoc packet */ | 505 | __u8 *data, /* isoc packet */ |
506 | int len) /* iso packet length */ | 506 | int len) /* iso packet length */ |
507 | { | 507 | { |
508 | struct sd *sd = (struct sd *) gspca_dev; | 508 | struct sd *sd = (struct sd *) gspca_dev; |
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c index 4f23b16c89a8..eb5e1bfd7911 100644 --- a/drivers/media/video/gspca/sonixj.c +++ b/drivers/media/video/gspca/sonixj.c | |||
@@ -24,8 +24,8 @@ | |||
24 | #include "gspca.h" | 24 | #include "gspca.h" |
25 | #include "jpeg.h" | 25 | #include "jpeg.h" |
26 | 26 | ||
27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 3) | 27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4) |
28 | static const char version[] = "2.1.3"; | 28 | static const char version[] = "2.1.4"; |
29 | 29 | ||
30 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); | 30 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); |
31 | MODULE_DESCRIPTION("GSPCA/SONIX JPEG USB Camera Driver"); | 31 | MODULE_DESCRIPTION("GSPCA/SONIX JPEG USB Camera Driver"); |
@@ -74,7 +74,6 @@ static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val); | |||
74 | static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val); | 74 | static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val); |
75 | 75 | ||
76 | static struct ctrl sd_ctrls[] = { | 76 | static struct ctrl sd_ctrls[] = { |
77 | #define SD_BRIGHTNESS 0 | ||
78 | { | 77 | { |
79 | { | 78 | { |
80 | .id = V4L2_CID_BRIGHTNESS, | 79 | .id = V4L2_CID_BRIGHTNESS, |
@@ -83,12 +82,12 @@ static struct ctrl sd_ctrls[] = { | |||
83 | .minimum = 0, | 82 | .minimum = 0, |
84 | .maximum = 0xffff, | 83 | .maximum = 0xffff, |
85 | .step = 1, | 84 | .step = 1, |
86 | .default_value = 0x7fff, | 85 | #define BRIGHTNESS_DEF 0x7fff |
86 | .default_value = BRIGHTNESS_DEF, | ||
87 | }, | 87 | }, |
88 | .set = sd_setbrightness, | 88 | .set = sd_setbrightness, |
89 | .get = sd_getbrightness, | 89 | .get = sd_getbrightness, |
90 | }, | 90 | }, |
91 | #define SD_CONTRAST 1 | ||
92 | { | 91 | { |
93 | { | 92 | { |
94 | .id = V4L2_CID_CONTRAST, | 93 | .id = V4L2_CID_CONTRAST, |
@@ -97,12 +96,12 @@ static struct ctrl sd_ctrls[] = { | |||
97 | .minimum = 0, | 96 | .minimum = 0, |
98 | .maximum = 127, | 97 | .maximum = 127, |
99 | .step = 1, | 98 | .step = 1, |
100 | .default_value = 63, | 99 | #define CONTRAST_DEF 63 |
100 | .default_value = CONTRAST_DEF, | ||
101 | }, | 101 | }, |
102 | .set = sd_setcontrast, | 102 | .set = sd_setcontrast, |
103 | .get = sd_getcontrast, | 103 | .get = sd_getcontrast, |
104 | }, | 104 | }, |
105 | #define SD_COLOR 2 | ||
106 | { | 105 | { |
107 | { | 106 | { |
108 | .id = V4L2_CID_SATURATION, | 107 | .id = V4L2_CID_SATURATION, |
@@ -111,12 +110,12 @@ static struct ctrl sd_ctrls[] = { | |||
111 | .minimum = 0, | 110 | .minimum = 0, |
112 | .maximum = 255, | 111 | .maximum = 255, |
113 | .step = 1, | 112 | .step = 1, |
114 | .default_value = 127, | 113 | #define COLOR_DEF 127 |
114 | .default_value = COLOR_DEF, | ||
115 | }, | 115 | }, |
116 | .set = sd_setcolors, | 116 | .set = sd_setcolors, |
117 | .get = sd_getcolors, | 117 | .get = sd_getcolors, |
118 | }, | 118 | }, |
119 | #define SD_AUTOGAIN 3 | ||
120 | { | 119 | { |
121 | { | 120 | { |
122 | .id = V4L2_CID_AUTOGAIN, | 121 | .id = V4L2_CID_AUTOGAIN, |
@@ -125,7 +124,8 @@ static struct ctrl sd_ctrls[] = { | |||
125 | .minimum = 0, | 124 | .minimum = 0, |
126 | .maximum = 1, | 125 | .maximum = 1, |
127 | .step = 1, | 126 | .step = 1, |
128 | .default_value = 1, | 127 | #define AUTOGAIN_DEF 1 |
128 | .default_value = AUTOGAIN_DEF, | ||
129 | }, | 129 | }, |
130 | .set = sd_setautogain, | 130 | .set = sd_setautogain, |
131 | .get = sd_getautogain, | 131 | .get = sd_getautogain, |
@@ -139,7 +139,7 @@ static struct cam_mode vga_mode[] = { | |||
139 | }; | 139 | }; |
140 | 140 | ||
141 | /*Data from sn9c102p+hv71331r */ | 141 | /*Data from sn9c102p+hv71331r */ |
142 | static __u8 sn_hv7131[] = { | 142 | static const __u8 sn_hv7131[] = { |
143 | 0x00, 0x03, 0x64, 0x00, 0x1A, 0x20, 0x20, 0x20, 0xA1, 0x11, | 143 | 0x00, 0x03, 0x64, 0x00, 0x1A, 0x20, 0x20, 0x20, 0xA1, 0x11, |
144 | /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 reg9 */ | 144 | /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 reg9 */ |
145 | 0x02, 0x09, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, /* 00 */ | 145 | 0x02, 0x09, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, /* 00 */ |
@@ -150,7 +150,7 @@ static __u8 sn_hv7131[] = { | |||
150 | /* reg1c reg1d reg1e reg1f reg20 reg21 reg22 reg23 */ | 150 | /* reg1c reg1d reg1e reg1f reg20 reg21 reg22 reg23 */ |
151 | }; | 151 | }; |
152 | 152 | ||
153 | static __u8 sn_mi0360[] = { | 153 | static const __u8 sn_mi0360[] = { |
154 | 0x00, 0x61, 0x44, 0x00, 0x1a, 0x20, 0x20, 0x20, 0xb1, 0x5d, | 154 | 0x00, 0x61, 0x44, 0x00, 0x1a, 0x20, 0x20, 0x20, 0xb1, 0x5d, |
155 | /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 reg9 */ | 155 | /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 reg9 */ |
156 | 0x07, 0x00, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, | 156 | 0x07, 0x00, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, |
@@ -161,7 +161,7 @@ static __u8 sn_mi0360[] = { | |||
161 | /* reg1c reg1d reg1e reg1f reg20 reg21 reg22 reg23 */ | 161 | /* reg1c reg1d reg1e reg1f reg20 reg21 reg22 reg23 */ |
162 | }; | 162 | }; |
163 | 163 | ||
164 | static __u8 sn_mo4000[] = { | 164 | static const __u8 sn_mo4000[] = { |
165 | 0x12, 0x23, 0x60, 0x00, 0x1A, 0x00, 0x20, 0x18, 0x81, | 165 | 0x12, 0x23, 0x60, 0x00, 0x1A, 0x00, 0x20, 0x18, 0x81, |
166 | /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 */ | 166 | /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 */ |
167 | 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, | 167 | 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, |
@@ -174,13 +174,13 @@ static __u8 sn_mo4000[] = { | |||
174 | 0xd3, 0xdf, 0xea, 0xf5 | 174 | 0xd3, 0xdf, 0xea, 0xf5 |
175 | }; | 175 | }; |
176 | 176 | ||
177 | static __u8 sn_ov7648[] = { | 177 | static const __u8 sn_ov7648[] = { |
178 | 0x00, 0x21, 0x62, 0x00, 0x1a, 0x20, 0x20, 0x20, 0xA1, 0x6E, 0x18, 0x65, | 178 | 0x00, 0x21, 0x62, 0x00, 0x1a, 0x20, 0x20, 0x20, 0xA1, 0x6E, 0x18, 0x65, |
179 | 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00, 0x06, 0x06, 0x28, 0x1E, 0x82, | 179 | 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00, 0x06, 0x06, 0x28, 0x1E, 0x82, |
180 | 0x07, 0x00, 0x00, 0x00, 0x00, 0x00 | 180 | 0x07, 0x00, 0x00, 0x00, 0x00, 0x00 |
181 | }; | 181 | }; |
182 | 182 | ||
183 | static __u8 sn_ov7660[] = { | 183 | static const __u8 sn_ov7660[] = { |
184 | /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 */ | 184 | /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 */ |
185 | 0x00, 0x61, 0x40, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x81, | 185 | 0x00, 0x61, 0x40, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x81, |
186 | /* reg9 rega regb regc regd rege regf reg10 reg11*/ | 186 | /* reg9 rega regb regc regd rege regf reg10 reg11*/ |
@@ -192,7 +192,7 @@ static __u8 sn_ov7660[] = { | |||
192 | }; | 192 | }; |
193 | 193 | ||
194 | /* sequence specific to the sensors - !! index = SENSOR_xxx */ | 194 | /* sequence specific to the sensors - !! index = SENSOR_xxx */ |
195 | static __u8 *sn_tb[] = { | 195 | static const __u8 *sn_tb[] = { |
196 | sn_hv7131, | 196 | sn_hv7131, |
197 | sn_mi0360, | 197 | sn_mi0360, |
198 | sn_mo4000, | 198 | sn_mo4000, |
@@ -200,28 +200,28 @@ static __u8 *sn_tb[] = { | |||
200 | sn_ov7660 | 200 | sn_ov7660 |
201 | }; | 201 | }; |
202 | 202 | ||
203 | static __u8 regsn20[] = { | 203 | static const __u8 regsn20[] = { |
204 | 0x00, 0x2d, 0x46, 0x5a, 0x6c, 0x7c, 0x8b, 0x99, | 204 | 0x00, 0x2d, 0x46, 0x5a, 0x6c, 0x7c, 0x8b, 0x99, |
205 | 0xa6, 0xb2, 0xbf, 0xca, 0xd5, 0xe0, 0xeb, 0xf5, 0xff | 205 | 0xa6, 0xb2, 0xbf, 0xca, 0xd5, 0xe0, 0xeb, 0xf5, 0xff |
206 | }; | 206 | }; |
207 | static __u8 regsn20_sn9c325[] = { | 207 | static const __u8 regsn20_sn9c325[] = { |
208 | 0x0a, 0x3a, 0x56, 0x6c, 0x7e, 0x8d, 0x9a, 0xa4, | 208 | 0x0a, 0x3a, 0x56, 0x6c, 0x7e, 0x8d, 0x9a, 0xa4, |
209 | 0xaf, 0xbb, 0xc5, 0xcd, 0xd5, 0xde, 0xe8, 0xed, 0xf5 | 209 | 0xaf, 0xbb, 0xc5, 0xcd, 0xd5, 0xde, 0xe8, 0xed, 0xf5 |
210 | }; | 210 | }; |
211 | 211 | ||
212 | static __u8 reg84[] = { | 212 | static const __u8 reg84[] = { |
213 | 0x14, 0x00, 0x27, 0x00, 0x07, 0x00, 0xe5, 0x0f, | 213 | 0x14, 0x00, 0x27, 0x00, 0x07, 0x00, 0xe5, 0x0f, |
214 | 0xe4, 0x0f, 0x38, 0x00, 0x3e, 0x00, 0xc3, 0x0f, | 214 | 0xe4, 0x0f, 0x38, 0x00, 0x3e, 0x00, 0xc3, 0x0f, |
215 | /* 0x00, 0x00, 0x00, 0x00, 0x00 */ | 215 | /* 0x00, 0x00, 0x00, 0x00, 0x00 */ |
216 | 0xf7, 0x0f, 0x0a, 0x00, 0x00 | 216 | 0xf7, 0x0f, 0x0a, 0x00, 0x00 |
217 | }; | 217 | }; |
218 | static __u8 reg84_sn9c325[] = { | 218 | static const __u8 reg84_sn9c325[] = { |
219 | 0x14, 0x00, 0x27, 0x00, 0x07, 0x00, 0xe4, 0x0f, | 219 | 0x14, 0x00, 0x27, 0x00, 0x07, 0x00, 0xe4, 0x0f, |
220 | 0xd3, 0x0f, 0x4b, 0x00, 0x48, 0x00, 0xc0, 0x0f, | 220 | 0xd3, 0x0f, 0x4b, 0x00, 0x48, 0x00, 0xc0, 0x0f, |
221 | 0xf8, 0x0f, 0x00, 0x00, 0x00 | 221 | 0xf8, 0x0f, 0x00, 0x00, 0x00 |
222 | }; | 222 | }; |
223 | 223 | ||
224 | static __u8 hv7131r_sensor_init[][8] = { | 224 | static const __u8 hv7131r_sensor_init[][8] = { |
225 | {0xC1, 0x11, 0x01, 0x08, 0x01, 0x00, 0x00, 0x10}, | 225 | {0xC1, 0x11, 0x01, 0x08, 0x01, 0x00, 0x00, 0x10}, |
226 | {0xB1, 0x11, 0x34, 0x17, 0x7F, 0x00, 0x00, 0x10}, | 226 | {0xB1, 0x11, 0x34, 0x17, 0x7F, 0x00, 0x00, 0x10}, |
227 | {0xD1, 0x11, 0x40, 0xFF, 0x7F, 0x7F, 0x7F, 0x10}, | 227 | {0xD1, 0x11, 0x40, 0xFF, 0x7F, 0x7F, 0x7F, 0x10}, |
@@ -250,9 +250,9 @@ static __u8 hv7131r_sensor_init[][8] = { | |||
250 | {0xA1, 0x11, 0x21, 0xD0, 0x00, 0x00, 0x00, 0x10}, | 250 | {0xA1, 0x11, 0x21, 0xD0, 0x00, 0x00, 0x00, 0x10}, |
251 | {0xA1, 0x11, 0x22, 0x00, 0x00, 0x00, 0x00, 0x10}, | 251 | {0xA1, 0x11, 0x22, 0x00, 0x00, 0x00, 0x00, 0x10}, |
252 | {0xA1, 0x11, 0x23, 0x10, 0x00, 0x00, 0x00, 0x10}, | 252 | {0xA1, 0x11, 0x23, 0x10, 0x00, 0x00, 0x00, 0x10}, |
253 | {0, 0, 0, 0, 0, 0, 0, 0} | 253 | {} |
254 | }; | 254 | }; |
255 | static __u8 mi0360_sensor_init[][8] = { | 255 | static const __u8 mi0360_sensor_init[][8] = { |
256 | {0xB1, 0x5D, 0x07, 0x00, 0x02, 0x00, 0x00, 0x10}, | 256 | {0xB1, 0x5D, 0x07, 0x00, 0x02, 0x00, 0x00, 0x10}, |
257 | {0xB1, 0x5D, 0x0D, 0x00, 0x01, 0x00, 0x00, 0x10}, | 257 | {0xB1, 0x5D, 0x0D, 0x00, 0x01, 0x00, 0x00, 0x10}, |
258 | {0xB1, 0x5D, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x10}, | 258 | {0xB1, 0x5D, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x10}, |
@@ -304,9 +304,9 @@ static __u8 mi0360_sensor_init[][8] = { | |||
304 | /* {0xB1, 0x5D, 0x35, 0x00, 0x20, 0x00, 0x00, 0x10}, * gain */ | 304 | /* {0xB1, 0x5D, 0x35, 0x00, 0x20, 0x00, 0x00, 0x10}, * gain */ |
305 | {0xB1, 0x5D, 0x07, 0x00, 0x03, 0x00, 0x00, 0x10}, /* update */ | 305 | {0xB1, 0x5D, 0x07, 0x00, 0x03, 0x00, 0x00, 0x10}, /* update */ |
306 | {0xB1, 0x5D, 0x07, 0x00, 0x02, 0x00, 0x00, 0x10}, /* sensor on */ | 306 | {0xB1, 0x5D, 0x07, 0x00, 0x02, 0x00, 0x00, 0x10}, /* sensor on */ |
307 | {0, 0, 0, 0, 0, 0, 0, 0} | 307 | {} |
308 | }; | 308 | }; |
309 | static __u8 mo4000_sensor_init[][8] = { | 309 | static const __u8 mo4000_sensor_init[][8] = { |
310 | {0xa1, 0x21, 0x01, 0x02, 0x00, 0x00, 0x00, 0x10}, | 310 | {0xa1, 0x21, 0x01, 0x02, 0x00, 0x00, 0x00, 0x10}, |
311 | {0xa1, 0x21, 0x02, 0x00, 0x00, 0x00, 0x00, 0x10}, | 311 | {0xa1, 0x21, 0x02, 0x00, 0x00, 0x00, 0x00, 0x10}, |
312 | {0xa1, 0x21, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10}, | 312 | {0xa1, 0x21, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10}, |
@@ -327,9 +327,9 @@ static __u8 mo4000_sensor_init[][8] = { | |||
327 | {0xa1, 0x21, 0x10, 0x20, 0x00, 0x00, 0x00, 0x10}, | 327 | {0xa1, 0x21, 0x10, 0x20, 0x00, 0x00, 0x00, 0x10}, |
328 | {0xa1, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10}, | 328 | {0xa1, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10}, |
329 | {0xa1, 0x21, 0x11, 0x38, 0x00, 0x00, 0x00, 0x10}, | 329 | {0xa1, 0x21, 0x11, 0x38, 0x00, 0x00, 0x00, 0x10}, |
330 | {0, 0, 0, 0, 0, 0, 0, 0} | 330 | {} |
331 | }; | 331 | }; |
332 | static __u8 ov7660_sensor_init[][8] = { | 332 | static const __u8 ov7660_sensor_init[][8] = { |
333 | {0xa1, 0x21, 0x12, 0x80, 0x00, 0x00, 0x00, 0x10}, /* reset SCCB */ | 333 | {0xa1, 0x21, 0x12, 0x80, 0x00, 0x00, 0x00, 0x10}, /* reset SCCB */ |
334 | {0xa1, 0x21, 0x12, 0x05, 0x00, 0x00, 0x00, 0x10}, | 334 | {0xa1, 0x21, 0x12, 0x05, 0x00, 0x00, 0x00, 0x10}, |
335 | /* Outformat ?? rawRGB */ | 335 | /* Outformat ?? rawRGB */ |
@@ -420,12 +420,12 @@ static __u8 ov7660_sensor_init[][8] = { | |||
420 | {0xa1, 0x21, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x10}, | 420 | {0xa1, 0x21, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x10}, |
421 | {0xa1, 0x21, 0x2b, 0xc3, 0x00, 0x00, 0x00, 0x10}, | 421 | {0xa1, 0x21, 0x2b, 0xc3, 0x00, 0x00, 0x00, 0x10}, |
422 | /* here may start the isoc exchanges */ | 422 | /* here may start the isoc exchanges */ |
423 | {0, 0, 0, 0, 0, 0, 0, 0} | 423 | {} |
424 | }; | 424 | }; |
425 | /* reg0x04 reg0x07 reg 0x10 */ | 425 | /* reg0x04 reg0x07 reg 0x10 */ |
426 | /* expo = (COM1 & 0x02) | (AECHH & 0x2f <<10) [ (AECh << 2) */ | 426 | /* expo = (COM1 & 0x02) | (AECHH & 0x2f <<10) [ (AECh << 2) */ |
427 | 427 | ||
428 | static __u8 ov7648_sensor_init[][8] = { | 428 | static const __u8 ov7648_sensor_init[][8] = { |
429 | {0xC1, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00}, | 429 | {0xC1, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00}, |
430 | {0xC1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00}, | 430 | {0xC1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00}, |
431 | {0xC1, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00}, | 431 | {0xC1, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00}, |
@@ -478,10 +478,10 @@ static __u8 ov7648_sensor_init[][8] = { | |||
478 | {0xA1, 0x6E, 0x07, 0x66, 0x00, 0x00, 0x00, 0x10}, /* B.. */ | 478 | {0xA1, 0x6E, 0x07, 0x66, 0x00, 0x00, 0x00, 0x10}, /* B.. */ |
479 | {0xC1, 0x6E, 0x1A, 0x03, 0x65, 0x90, 0x00, 0x10}, /* Bright/Witen....*/ | 479 | {0xC1, 0x6E, 0x1A, 0x03, 0x65, 0x90, 0x00, 0x10}, /* Bright/Witen....*/ |
480 | /* {0xC1, 0x6E, 0x16, 0x45, 0x40, 0x60, 0x00, 0x10}, * Bright/Witene */ | 480 | /* {0xC1, 0x6E, 0x16, 0x45, 0x40, 0x60, 0x00, 0x10}, * Bright/Witene */ |
481 | {0, 0, 0, 0, 0, 0, 0, 0} | 481 | {} |
482 | }; | 482 | }; |
483 | 483 | ||
484 | static __u8 qtable4[] = { | 484 | static const __u8 qtable4[] = { |
485 | 0x06, 0x04, 0x04, 0x06, 0x04, 0x04, 0x06, 0x06, 0x06, 0x06, 0x08, 0x06, | 485 | 0x06, 0x04, 0x04, 0x06, 0x04, 0x04, 0x06, 0x06, 0x06, 0x06, 0x08, 0x06, |
486 | 0x06, 0x08, 0x0A, 0x11, | 486 | 0x06, 0x08, 0x0A, 0x11, |
487 | 0x0A, 0x0A, 0x08, 0x08, 0x0A, 0x15, 0x0F, 0x0F, 0x0C, 0x11, 0x19, 0x15, | 487 | 0x0A, 0x0A, 0x08, 0x08, 0x0A, 0x15, 0x0F, 0x0F, 0x0C, 0x11, 0x19, 0x15, |
@@ -518,27 +518,36 @@ static void reg_w(struct usb_device *dev, | |||
518 | const __u8 *buffer, | 518 | const __u8 *buffer, |
519 | int len) | 519 | int len) |
520 | { | 520 | { |
521 | __u8 tmpbuf[64]; | 521 | if (len < 16) { |
522 | 522 | __u8 tmpbuf[16]; | |
523 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 523 | |
524 | if (len > sizeof tmpbuf) { | 524 | memcpy(tmpbuf, buffer, len); |
525 | PDEBUG(D_ERR|D_PACK, "reg_w: buffer overflow"); | 525 | usb_control_msg(dev, |
526 | return; | 526 | usb_sndctrlpipe(dev, 0), |
527 | 0x08, | ||
528 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, | ||
529 | value, 0, | ||
530 | tmpbuf, len, | ||
531 | 500); | ||
532 | } else { | ||
533 | __u8 *tmpbuf; | ||
534 | |||
535 | tmpbuf = kmalloc(len, GFP_KERNEL); | ||
536 | memcpy(tmpbuf, buffer, len); | ||
537 | usb_control_msg(dev, | ||
538 | usb_sndctrlpipe(dev, 0), | ||
539 | 0x08, | ||
540 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, | ||
541 | value, 0, | ||
542 | tmpbuf, len, | ||
543 | 500); | ||
544 | kfree(tmpbuf); | ||
527 | } | 545 | } |
528 | #endif | ||
529 | memcpy(tmpbuf, buffer, len); | ||
530 | usb_control_msg(dev, | ||
531 | usb_sndctrlpipe(dev, 0), | ||
532 | 0x08, | ||
533 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, | ||
534 | value, 0, | ||
535 | tmpbuf, len, | ||
536 | 500); | ||
537 | } | 546 | } |
538 | 547 | ||
539 | /* write 2 bytes */ | 548 | /* write 2 bytes */ |
540 | static void i2c_w2(struct gspca_dev *gspca_dev, | 549 | static void i2c_w2(struct gspca_dev *gspca_dev, |
541 | __u8 *buffer) | 550 | const __u8 *buffer) |
542 | { | 551 | { |
543 | struct sd *sd = (struct sd *) gspca_dev; | 552 | struct sd *sd = (struct sd *) gspca_dev; |
544 | struct usb_device *dev = gspca_dev->dev; | 553 | struct usb_device *dev = gspca_dev->dev; |
@@ -557,7 +566,7 @@ static void i2c_w2(struct gspca_dev *gspca_dev, | |||
557 | } | 566 | } |
558 | 567 | ||
559 | /* write 8 bytes */ | 568 | /* write 8 bytes */ |
560 | static void i2c_w8(struct usb_device *dev, __u8 *buffer) | 569 | static void i2c_w8(struct usb_device *dev, const __u8 *buffer) |
561 | { | 570 | { |
562 | reg_w(dev, 0x08, buffer, 8); | 571 | reg_w(dev, 0x08, buffer, 8); |
563 | msleep(1); | 572 | msleep(1); |
@@ -565,7 +574,7 @@ static void i2c_w8(struct usb_device *dev, __u8 *buffer) | |||
565 | 574 | ||
566 | /* read 5 bytes */ | 575 | /* read 5 bytes */ |
567 | static void i2c_r5(struct gspca_dev *gspca_dev, __u8 reg, | 576 | static void i2c_r5(struct gspca_dev *gspca_dev, __u8 reg, |
568 | __u8 *buffer) | 577 | __u8 *buffer) |
569 | { | 578 | { |
570 | struct sd *sd = (struct sd *) gspca_dev; | 579 | struct sd *sd = (struct sd *) gspca_dev; |
571 | struct usb_device *dev = gspca_dev->dev; | 580 | struct usb_device *dev = gspca_dev->dev; |
@@ -591,7 +600,7 @@ static int probesensor(struct gspca_dev *gspca_dev) | |||
591 | struct sd *sd = (struct sd *) gspca_dev; | 600 | struct sd *sd = (struct sd *) gspca_dev; |
592 | struct usb_device *dev = gspca_dev->dev; | 601 | struct usb_device *dev = gspca_dev->dev; |
593 | __u8 reg02; | 602 | __u8 reg02; |
594 | static __u8 datasend[] = { 2, 0 }; | 603 | static const __u8 datasend[] = { 2, 0 }; |
595 | /* reg val1 val2 val3 val4 */ | 604 | /* reg val1 val2 val3 val4 */ |
596 | __u8 datarecd[6]; | 605 | __u8 datarecd[6]; |
597 | 606 | ||
@@ -618,18 +627,18 @@ static int probesensor(struct gspca_dev *gspca_dev) | |||
618 | } | 627 | } |
619 | 628 | ||
620 | static int configure_gpio(struct gspca_dev *gspca_dev, | 629 | static int configure_gpio(struct gspca_dev *gspca_dev, |
621 | __u8 *sn9c1xx) | 630 | const __u8 *sn9c1xx) |
622 | { | 631 | { |
623 | struct sd *sd = (struct sd *) gspca_dev; | 632 | struct sd *sd = (struct sd *) gspca_dev; |
624 | struct usb_device *dev = gspca_dev->dev; | 633 | struct usb_device *dev = gspca_dev->dev; |
625 | __u8 data; | 634 | __u8 data; |
626 | __u8 regF1; | 635 | __u8 regF1; |
627 | __u8 *reg9a; | 636 | const __u8 *reg9a; |
628 | static __u8 reg9a_def[] = | 637 | static const __u8 reg9a_def[] = |
629 | {0x08, 0x40, 0x20, 0x10, 0x00, 0x04}; | 638 | {0x08, 0x40, 0x20, 0x10, 0x00, 0x04}; |
630 | static __u8 reg9a_sn9c120[] = /* from win trace */ | 639 | static const __u8 reg9a_sn9c120[] = /* from win trace */ |
631 | {0x00, 0x40, 0x38, 0x30, 0x00, 0x20}; | 640 | {0x00, 0x40, 0x38, 0x30, 0x00, 0x20}; |
632 | static __u8 reg9a_sn9c325[] = | 641 | static const __u8 reg9a_sn9c325[] = |
633 | {0x0a, 0x40, 0x38, 0x30, 0x00, 0x20}; | 642 | {0x0a, 0x40, 0x38, 0x30, 0x00, 0x20}; |
634 | 643 | ||
635 | 644 | ||
@@ -697,7 +706,7 @@ static void hv7131R_InitSensor(struct gspca_dev *gspca_dev) | |||
697 | { | 706 | { |
698 | int i = 0; | 707 | int i = 0; |
699 | struct usb_device *dev = gspca_dev->dev; | 708 | struct usb_device *dev = gspca_dev->dev; |
700 | static __u8 SetSensorClk[] = /* 0x08 Mclk */ | 709 | static const __u8 SetSensorClk[] = /* 0x08 Mclk */ |
701 | { 0xa1, 0x11, 0x01, 0x18, 0x00, 0x00, 0x00, 0x10 }; | 710 | { 0xa1, 0x11, 0x01, 0x18, 0x00, 0x00, 0x00, 0x10 }; |
702 | 711 | ||
703 | while (hv7131r_sensor_init[i][0]) { | 712 | while (hv7131r_sensor_init[i][0]) { |
@@ -971,11 +980,12 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
971 | cam->epaddr = 0x01; | 980 | cam->epaddr = 0x01; |
972 | cam->cam_mode = vga_mode; | 981 | cam->cam_mode = vga_mode; |
973 | cam->nmodes = ARRAY_SIZE(vga_mode); | 982 | cam->nmodes = ARRAY_SIZE(vga_mode); |
983 | |||
974 | sd->qindex = 4; /* set the quantization table */ | 984 | sd->qindex = 4; /* set the quantization table */ |
975 | sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value; | 985 | sd->brightness = BRIGHTNESS_DEF; |
976 | sd->contrast = sd_ctrls[SD_CONTRAST].qctrl.default_value; | 986 | sd->contrast = CONTRAST_DEF; |
977 | sd->colors = sd_ctrls[SD_COLOR].qctrl.default_value; | 987 | sd->colors = COLOR_DEF; |
978 | sd->autogain = sd_ctrls[SD_AUTOGAIN].qctrl.default_value; | 988 | sd->autogain = AUTOGAIN_DEF; |
979 | return 0; | 989 | return 0; |
980 | } | 990 | } |
981 | 991 | ||
@@ -984,7 +994,7 @@ static int sd_open(struct gspca_dev *gspca_dev) | |||
984 | { | 994 | { |
985 | struct sd *sd = (struct sd *) gspca_dev; | 995 | struct sd *sd = (struct sd *) gspca_dev; |
986 | struct usb_device *dev = gspca_dev->dev; | 996 | struct usb_device *dev = gspca_dev->dev; |
987 | /* __u8 *sn9c1xx; */ | 997 | /* const __u8 *sn9c1xx; */ |
988 | __u8 regF1; | 998 | __u8 regF1; |
989 | __u8 regGpio[] = { 0x29, 0x74 }; | 999 | __u8 regGpio[] = { 0x29, 0x74 }; |
990 | 1000 | ||
@@ -1036,11 +1046,11 @@ static unsigned int setexposure(struct gspca_dev *gspca_dev, | |||
1036 | unsigned int expo) | 1046 | unsigned int expo) |
1037 | { | 1047 | { |
1038 | struct sd *sd = (struct sd *) gspca_dev; | 1048 | struct sd *sd = (struct sd *) gspca_dev; |
1039 | static __u8 doit[] = /* update sensor */ | 1049 | static const __u8 doit[] = /* update sensor */ |
1040 | { 0xb1, 0x5d, 0x07, 0x00, 0x03, 0x00, 0x00, 0x10 }; | 1050 | { 0xb1, 0x5d, 0x07, 0x00, 0x03, 0x00, 0x00, 0x10 }; |
1041 | static __u8 sensorgo[] = /* sensor on */ | 1051 | static const __u8 sensorgo[] = /* sensor on */ |
1042 | { 0xb1, 0x5d, 0x07, 0x00, 0x02, 0x00, 0x00, 0x10 }; | 1052 | { 0xb1, 0x5d, 0x07, 0x00, 0x02, 0x00, 0x00, 0x10 }; |
1043 | static __u8 gainMo[] = | 1053 | static const __u8 gainMo[] = |
1044 | { 0xa1, 0x21, 0x00, 0x10, 0x00, 0x00, 0x00, 0x1d }; | 1054 | { 0xa1, 0x21, 0x00, 0x10, 0x00, 0x00, 0x00, 0x1d }; |
1045 | 1055 | ||
1046 | switch (sd->sensor) { | 1056 | switch (sd->sensor) { |
@@ -1164,14 +1174,15 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
1164 | __u8 data; | 1174 | __u8 data; |
1165 | __u8 reg1; | 1175 | __u8 reg1; |
1166 | __u8 reg17; | 1176 | __u8 reg17; |
1167 | __u8 *sn9c1xx; | 1177 | const __u8 *sn9c1xx; |
1168 | int mode; | 1178 | int mode; |
1169 | static __u8 DC29[] = { 0x6a, 0x50, 0x00, 0x00, 0x50, 0x3c }; | 1179 | static const __u8 DC29[] = { 0x6a, 0x50, 0x00, 0x00, 0x50, 0x3c }; |
1170 | static __u8 C0[] = { 0x2d, 0x2d, 0x3a, 0x05, 0x04, 0x3f }; | 1180 | static const __u8 C0[] = { 0x2d, 0x2d, 0x3a, 0x05, 0x04, 0x3f }; |
1171 | static __u8 CA[] = { 0x28, 0xd8, 0x14, 0xec }; | 1181 | static const __u8 CA[] = { 0x28, 0xd8, 0x14, 0xec }; |
1172 | static __u8 CA_sn9c120[] = { 0x14, 0xec, 0x0a, 0xf6 }; /* SN9C120 */ | 1182 | static const __u8 CA_sn9c120[] = |
1173 | static __u8 CE[] = { 0x32, 0xdd, 0x2d, 0xdd }; /* MI0360 */ | 1183 | { 0x14, 0xec, 0x0a, 0xf6 }; /* SN9C120 */ |
1174 | static __u8 CE_sn9c325[] = | 1184 | static const __u8 CE[] = { 0x32, 0xdd, 0x2d, 0xdd }; /* MI0360 */ |
1185 | static const __u8 CE_sn9c325[] = | ||
1175 | { 0x32, 0xdd, 0x32, 0xdd }; /* OV7648 - SN9C325 */ | 1186 | { 0x32, 0xdd, 0x32, 0xdd }; /* OV7648 - SN9C325 */ |
1176 | 1187 | ||
1177 | sn9c1xx = sn_tb[(int) sd->sensor]; | 1188 | sn9c1xx = sn_tb[(int) sd->sensor]; |
@@ -1311,13 +1322,13 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
1311 | { | 1322 | { |
1312 | struct sd *sd = (struct sd *) gspca_dev; | 1323 | struct sd *sd = (struct sd *) gspca_dev; |
1313 | struct usb_device *dev = gspca_dev->dev; | 1324 | struct usb_device *dev = gspca_dev->dev; |
1314 | static __u8 stophv7131[] = | 1325 | static const __u8 stophv7131[] = |
1315 | { 0xa1, 0x11, 0x02, 0x09, 0x00, 0x00, 0x00, 0x10 }; | 1326 | { 0xa1, 0x11, 0x02, 0x09, 0x00, 0x00, 0x00, 0x10 }; |
1316 | static __u8 stopmi0360[] = | 1327 | static const __u8 stopmi0360[] = |
1317 | { 0xb1, 0x5d, 0x07, 0x00, 0x00, 0x00, 0x00, 0x10 }; | 1328 | { 0xb1, 0x5d, 0x07, 0x00, 0x00, 0x00, 0x00, 0x10 }; |
1318 | __u8 regF1; | 1329 | __u8 regF1; |
1319 | __u8 data; | 1330 | __u8 data; |
1320 | __u8 *sn9c1xx; | 1331 | const __u8 *sn9c1xx; |
1321 | 1332 | ||
1322 | data = 0x0b; | 1333 | data = 0x0b; |
1323 | switch (sd->sensor) { | 1334 | switch (sd->sensor) { |
@@ -1392,7 +1403,7 @@ static void setautogain(struct gspca_dev *gspca_dev) | |||
1392 | 1403 | ||
1393 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 1404 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
1394 | struct gspca_frame *frame, /* target */ | 1405 | struct gspca_frame *frame, /* target */ |
1395 | unsigned char *data, /* isoc packet */ | 1406 | __u8 *data, /* isoc packet */ |
1396 | int len) /* iso packet length */ | 1407 | int len) /* iso packet length */ |
1397 | { | 1408 | { |
1398 | struct sd *sd = (struct sd *) gspca_dev; | 1409 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -1567,7 +1578,7 @@ static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val) | |||
1567 | } | 1578 | } |
1568 | 1579 | ||
1569 | /* sub-driver description */ | 1580 | /* sub-driver description */ |
1570 | static struct sd_desc sd_desc = { | 1581 | static const struct sd_desc sd_desc = { |
1571 | .name = MODULE_NAME, | 1582 | .name = MODULE_NAME, |
1572 | .ctrls = sd_ctrls, | 1583 | .ctrls = sd_ctrls, |
1573 | .nctrls = ARRAY_SIZE(sd_ctrls), | 1584 | .nctrls = ARRAY_SIZE(sd_ctrls), |
@@ -1582,7 +1593,7 @@ static struct sd_desc sd_desc = { | |||
1582 | 1593 | ||
1583 | /* -- module initialisation -- */ | 1594 | /* -- module initialisation -- */ |
1584 | #define DVNM(name) .driver_info = (kernel_ulong_t) name | 1595 | #define DVNM(name) .driver_info = (kernel_ulong_t) name |
1585 | static __devinitdata struct usb_device_id device_table[] = { | 1596 | static const __devinitdata struct usb_device_id device_table[] = { |
1586 | {USB_DEVICE(0x0458, 0x7025), DVNM("Genius Eye 311Q")}, | 1597 | {USB_DEVICE(0x0458, 0x7025), DVNM("Genius Eye 311Q")}, |
1587 | {USB_DEVICE(0x045e, 0x00f5), DVNM("MicroSoft VX3000")}, | 1598 | {USB_DEVICE(0x045e, 0x00f5), DVNM("MicroSoft VX3000")}, |
1588 | {USB_DEVICE(0x045e, 0x00f7), DVNM("MicroSoft VX1000")}, | 1599 | {USB_DEVICE(0x045e, 0x00f7), DVNM("MicroSoft VX1000")}, |
diff --git a/drivers/media/video/gspca/spca500.c b/drivers/media/video/gspca/spca500.c index 1db5b33ad85e..3a42506830f8 100644 --- a/drivers/media/video/gspca/spca500.c +++ b/drivers/media/video/gspca/spca500.c | |||
@@ -24,8 +24,8 @@ | |||
24 | #include "gspca.h" | 24 | #include "gspca.h" |
25 | #include "jpeg.h" | 25 | #include "jpeg.h" |
26 | 26 | ||
27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 0) | 27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4) |
28 | static const char version[] = "2.1.0"; | 28 | static const char version[] = "2.1.4"; |
29 | 29 | ||
30 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); | 30 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); |
31 | MODULE_DESCRIPTION("GSPCA/SPCA500 USB Camera Driver"); | 31 | MODULE_DESCRIPTION("GSPCA/SPCA500 USB Camera Driver"); |
@@ -35,7 +35,7 @@ MODULE_LICENSE("GPL"); | |||
35 | struct sd { | 35 | struct sd { |
36 | struct gspca_dev gspca_dev; /* !! must be the first item */ | 36 | struct gspca_dev gspca_dev; /* !! must be the first item */ |
37 | 37 | ||
38 | unsigned char packet[ISO_MAX_SIZE + 128]; | 38 | __u8 packet[ISO_MAX_SIZE + 128]; |
39 | /* !! no more than 128 ff in an ISO packet */ | 39 | /* !! no more than 128 ff in an ISO packet */ |
40 | 40 | ||
41 | unsigned char brightness; | 41 | unsigned char brightness; |
@@ -70,44 +70,44 @@ static int sd_setcolors(struct gspca_dev *gspca_dev, __s32 val); | |||
70 | static int sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val); | 70 | static int sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val); |
71 | 71 | ||
72 | static struct ctrl sd_ctrls[] = { | 72 | static struct ctrl sd_ctrls[] = { |
73 | #define SD_BRIGHTNESS 0 | ||
74 | { | 73 | { |
75 | { | 74 | { |
76 | .id = V4L2_CID_BRIGHTNESS, | 75 | .id = V4L2_CID_BRIGHTNESS, |
77 | .type = V4L2_CTRL_TYPE_INTEGER, | 76 | .type = V4L2_CTRL_TYPE_INTEGER, |
78 | .name = "Brightness", | 77 | .name = "Brightness", |
79 | .minimum = 0, | 78 | .minimum = 0, |
80 | .maximum = 0xff, | 79 | .maximum = 255, |
81 | .step = 1, | 80 | .step = 1, |
82 | .default_value = 0x7f, | 81 | #define BRIGHTNESS_DEF 127 |
82 | .default_value = BRIGHTNESS_DEF, | ||
83 | }, | 83 | }, |
84 | .set = sd_setbrightness, | 84 | .set = sd_setbrightness, |
85 | .get = sd_getbrightness, | 85 | .get = sd_getbrightness, |
86 | }, | 86 | }, |
87 | #define SD_CONTRAST 1 | ||
88 | { | 87 | { |
89 | { | 88 | { |
90 | .id = V4L2_CID_CONTRAST, | 89 | .id = V4L2_CID_CONTRAST, |
91 | .type = V4L2_CTRL_TYPE_INTEGER, | 90 | .type = V4L2_CTRL_TYPE_INTEGER, |
92 | .name = "Contrast", | 91 | .name = "Contrast", |
93 | .minimum = 0, | 92 | .minimum = 0, |
94 | .maximum = 255, | 93 | .maximum = 63, |
95 | .step = 1, | 94 | .step = 1, |
96 | .default_value = 127, | 95 | #define CONTRAST_DEF 31 |
96 | .default_value = CONTRAST_DEF, | ||
97 | }, | 97 | }, |
98 | .set = sd_setcontrast, | 98 | .set = sd_setcontrast, |
99 | .get = sd_getcontrast, | 99 | .get = sd_getcontrast, |
100 | }, | 100 | }, |
101 | #define SD_COLOR 2 | ||
102 | { | 101 | { |
103 | { | 102 | { |
104 | .id = V4L2_CID_SATURATION, | 103 | .id = V4L2_CID_SATURATION, |
105 | .type = V4L2_CTRL_TYPE_INTEGER, | 104 | .type = V4L2_CTRL_TYPE_INTEGER, |
106 | .name = "Color", | 105 | .name = "Color", |
107 | .minimum = 0, | 106 | .minimum = 0, |
108 | .maximum = 255, | 107 | .maximum = 63, |
109 | .step = 1, | 108 | .step = 1, |
110 | .default_value = 127, | 109 | #define COLOR_DEF 31 |
110 | .default_value = COLOR_DEF, | ||
111 | }, | 111 | }, |
112 | .set = sd_setcolors, | 112 | .set = sd_setcolors, |
113 | .get = sd_getcolors, | 113 | .get = sd_getcolors, |
@@ -139,7 +139,7 @@ static struct cam_mode sif_mode[] = { | |||
139 | #define SPCA500_OFFSET_DATA 16 | 139 | #define SPCA500_OFFSET_DATA 16 |
140 | 140 | ||
141 | 141 | ||
142 | static __u16 spca500_visual_defaults[][3] = { | 142 | static const __u16 spca500_visual_defaults[][3] = { |
143 | {0x00, 0x0003, 0x816b}, /* SSI not active sync with vsync, | 143 | {0x00, 0x0003, 0x816b}, /* SSI not active sync with vsync, |
144 | * hue (H byte) = 0, | 144 | * hue (H byte) = 0, |
145 | * saturation/hue enable, | 145 | * saturation/hue enable, |
@@ -161,10 +161,9 @@ static __u16 spca500_visual_defaults[][3] = { | |||
161 | {0x00, 0x0001, 0x8202}, /* clock rate compensation = 1/25 sec/frame */ | 161 | {0x00, 0x0001, 0x8202}, /* clock rate compensation = 1/25 sec/frame */ |
162 | {0x0c, 0x0004, 0x0000}, | 162 | {0x0c, 0x0004, 0x0000}, |
163 | /* set interface */ | 163 | /* set interface */ |
164 | 164 | {} | |
165 | {0, 0, 0} | ||
166 | }; | 165 | }; |
167 | static __u16 Clicksmart510_defaults[][3] = { | 166 | static const __u16 Clicksmart510_defaults[][3] = { |
168 | {0x00, 0x00, 0x8211}, | 167 | {0x00, 0x00, 0x8211}, |
169 | {0x00, 0x01, 0x82c0}, | 168 | {0x00, 0x01, 0x82c0}, |
170 | {0x00, 0x10, 0x82cb}, | 169 | {0x00, 0x10, 0x82cb}, |
@@ -293,7 +292,7 @@ static __u16 Clicksmart510_defaults[][3] = { | |||
293 | {} | 292 | {} |
294 | }; | 293 | }; |
295 | 294 | ||
296 | static unsigned char qtable_creative_pccam[2][64] = { | 295 | static const __u8 qtable_creative_pccam[2][64] = { |
297 | { /* Q-table Y-components */ | 296 | { /* Q-table Y-components */ |
298 | 0x05, 0x03, 0x03, 0x05, 0x07, 0x0c, 0x0f, 0x12, | 297 | 0x05, 0x03, 0x03, 0x05, 0x07, 0x0c, 0x0f, 0x12, |
299 | 0x04, 0x04, 0x04, 0x06, 0x08, 0x11, 0x12, 0x11, | 298 | 0x04, 0x04, 0x04, 0x06, 0x08, 0x11, 0x12, 0x11, |
@@ -314,7 +313,7 @@ static unsigned char qtable_creative_pccam[2][64] = { | |||
314 | 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e} | 313 | 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e} |
315 | }; | 314 | }; |
316 | 315 | ||
317 | static unsigned char qtable_kodak_ez200[2][64] = { | 316 | static const __u8 qtable_kodak_ez200[2][64] = { |
318 | { /* Q-table Y-components */ | 317 | { /* Q-table Y-components */ |
319 | 0x02, 0x01, 0x01, 0x02, 0x02, 0x04, 0x05, 0x06, | 318 | 0x02, 0x01, 0x01, 0x02, 0x02, 0x04, 0x05, 0x06, |
320 | 0x01, 0x01, 0x01, 0x02, 0x03, 0x06, 0x06, 0x06, | 319 | 0x01, 0x01, 0x01, 0x02, 0x03, 0x06, 0x06, 0x06, |
@@ -335,7 +334,7 @@ static unsigned char qtable_kodak_ez200[2][64] = { | |||
335 | 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a} | 334 | 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a} |
336 | }; | 335 | }; |
337 | 336 | ||
338 | static unsigned char qtable_pocketdv[2][64] = { | 337 | static const __u8 qtable_pocketdv[2][64] = { |
339 | { /* Q-table Y-components start registers 0x8800 */ | 338 | { /* Q-table Y-components start registers 0x8800 */ |
340 | 0x06, 0x04, 0x04, 0x06, 0x0a, 0x10, 0x14, 0x18, | 339 | 0x06, 0x04, 0x04, 0x06, 0x0a, 0x10, 0x14, 0x18, |
341 | 0x05, 0x05, 0x06, 0x08, 0x0a, 0x17, 0x18, 0x16, | 340 | 0x05, 0x05, 0x06, 0x08, 0x0a, 0x17, 0x18, 0x16, |
@@ -357,7 +356,7 @@ static unsigned char qtable_pocketdv[2][64] = { | |||
357 | 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28} | 356 | 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28} |
358 | }; | 357 | }; |
359 | 358 | ||
360 | static void spca5xxRegRead(struct usb_device *dev, | 359 | static void reg_r(struct usb_device *dev, |
361 | __u16 index, | 360 | __u16 index, |
362 | __u8 *buffer, __u16 length) | 361 | __u8 *buffer, __u16 length) |
363 | { | 362 | { |
@@ -369,25 +368,24 @@ static void spca5xxRegRead(struct usb_device *dev, | |||
369 | index, buffer, length, 500); | 368 | index, buffer, length, 500); |
370 | } | 369 | } |
371 | 370 | ||
372 | static int reg_write(struct usb_device *dev, | 371 | static int reg_w(struct usb_device *dev, |
373 | __u16 req, __u16 index, __u16 value) | 372 | __u16 req, __u16 index, __u16 value) |
374 | { | 373 | { |
375 | int ret; | 374 | int ret; |
376 | 375 | ||
376 | PDEBUG(D_USBO, "reg write: [0x%02x] = 0x%02x", index, value); | ||
377 | ret = usb_control_msg(dev, | 377 | ret = usb_control_msg(dev, |
378 | usb_sndctrlpipe(dev, 0), | 378 | usb_sndctrlpipe(dev, 0), |
379 | req, | 379 | req, |
380 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 380 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
381 | value, index, NULL, 0, 500); | 381 | value, index, NULL, 0, 500); |
382 | PDEBUG(D_USBO, "reg write: [0x%02x] = 0x%02x, 0x%x", | ||
383 | index, value, ret); | ||
384 | if (ret < 0) | 382 | if (ret < 0) |
385 | PDEBUG(D_ERR, "reg write: error %d", ret); | 383 | PDEBUG(D_ERR, "reg write: error %d", ret); |
386 | return ret; | 384 | return ret; |
387 | } | 385 | } |
388 | 386 | ||
389 | /* returns: negative is error, pos or zero is data */ | 387 | /* returns: negative is error, pos or zero is data */ |
390 | static int reg_read(struct usb_device *dev, | 388 | static int reg_r_12(struct usb_device *dev, |
391 | __u16 req, /* bRequest */ | 389 | __u16 req, /* bRequest */ |
392 | __u16 index, /* wIndex */ | 390 | __u16 index, /* wIndex */ |
393 | __u16 length) /* wLength (1 or 2 only) */ | 391 | __u16 length) /* wLength (1 or 2 only) */ |
@@ -405,7 +403,7 @@ static int reg_read(struct usb_device *dev, | |||
405 | buf, length, | 403 | buf, length, |
406 | 500); /* timeout */ | 404 | 500); /* timeout */ |
407 | if (ret < 0) { | 405 | if (ret < 0) { |
408 | PDEBUG(D_ERR, "reg_read err %d", ret); | 406 | PDEBUG(D_ERR, "reg_r_12 err %d", ret); |
409 | return -1; | 407 | return -1; |
410 | } | 408 | } |
411 | return (buf[1] << 8) + buf[0]; | 409 | return (buf[1] << 8) + buf[0]; |
@@ -416,13 +414,13 @@ static int reg_read(struct usb_device *dev, | |||
416 | * a reg_read call. | 414 | * a reg_read call. |
417 | * Returns: negative is error or timeout, zero is success. | 415 | * Returns: negative is error or timeout, zero is success. |
418 | */ | 416 | */ |
419 | static int reg_readwait(struct usb_device *dev, | 417 | static int reg_r_wait(struct usb_device *dev, |
420 | __u16 reg, __u16 index, __u16 value) | 418 | __u16 reg, __u16 index, __u16 value) |
421 | { | 419 | { |
422 | int ret, cnt = 20; | 420 | int ret, cnt = 20; |
423 | 421 | ||
424 | while (--cnt > 0) { | 422 | while (--cnt > 0) { |
425 | ret = reg_read(dev, reg, index, 1); | 423 | ret = reg_r_12(dev, reg, index, 1); |
426 | if (ret == value) | 424 | if (ret == value) |
427 | return 0; | 425 | return 0; |
428 | msleep(50); | 426 | msleep(50); |
@@ -431,13 +429,13 @@ static int reg_readwait(struct usb_device *dev, | |||
431 | } | 429 | } |
432 | 430 | ||
433 | static int write_vector(struct gspca_dev *gspca_dev, | 431 | static int write_vector(struct gspca_dev *gspca_dev, |
434 | __u16 data[][3]) | 432 | const __u16 data[][3]) |
435 | { | 433 | { |
436 | struct usb_device *dev = gspca_dev->dev; | 434 | struct usb_device *dev = gspca_dev->dev; |
437 | int ret, i = 0; | 435 | int ret, i = 0; |
438 | 436 | ||
439 | while (data[i][0] != 0 || data[i][1] != 0 || data[i][2] != 0) { | 437 | while (data[i][0] != 0 || data[i][1] != 0 || data[i][2] != 0) { |
440 | ret = reg_write(dev, data[i][0], data[i][2], data[i][1]); | 438 | ret = reg_w(dev, data[i][0], data[i][2], data[i][1]); |
441 | if (ret < 0) | 439 | if (ret < 0) |
442 | return ret; | 440 | return ret; |
443 | i++; | 441 | i++; |
@@ -449,21 +447,21 @@ static int spca50x_setup_qtable(struct gspca_dev *gspca_dev, | |||
449 | unsigned int request, | 447 | unsigned int request, |
450 | unsigned int ybase, | 448 | unsigned int ybase, |
451 | unsigned int cbase, | 449 | unsigned int cbase, |
452 | unsigned char qtable[2][64]) | 450 | const __u8 qtable[2][64]) |
453 | { | 451 | { |
454 | struct usb_device *dev = gspca_dev->dev; | 452 | struct usb_device *dev = gspca_dev->dev; |
455 | int i, err; | 453 | int i, err; |
456 | 454 | ||
457 | /* loop over y components */ | 455 | /* loop over y components */ |
458 | for (i = 0; i < 64; i++) { | 456 | for (i = 0; i < 64; i++) { |
459 | err = reg_write(dev, request, ybase + i, qtable[0][i]); | 457 | err = reg_w(dev, request, ybase + i, qtable[0][i]); |
460 | if (err < 0) | 458 | if (err < 0) |
461 | return err; | 459 | return err; |
462 | } | 460 | } |
463 | 461 | ||
464 | /* loop over c components */ | 462 | /* loop over c components */ |
465 | for (i = 0; i < 64; i++) { | 463 | for (i = 0; i < 64; i++) { |
466 | err = reg_write(dev, request, cbase + i, qtable[1][i]); | 464 | err = reg_w(dev, request, cbase + i, qtable[1][i]); |
467 | if (err < 0) | 465 | if (err < 0) |
468 | return err; | 466 | return err; |
469 | } | 467 | } |
@@ -474,8 +472,8 @@ static void spca500_ping310(struct gspca_dev *gspca_dev) | |||
474 | { | 472 | { |
475 | __u8 Data[2]; | 473 | __u8 Data[2]; |
476 | 474 | ||
477 | spca5xxRegRead(gspca_dev->dev, 0x0d04, Data, 2); | 475 | reg_r(gspca_dev->dev, 0x0d04, Data, 2); |
478 | PDEBUG(D_PACK, "ClickSmart310 ping 0x0d04 0x%02x 0x%02x", | 476 | PDEBUG(D_STREAM, "ClickSmart310 ping 0x0d04 0x%02x 0x%02x", |
479 | Data[0], Data[1]); | 477 | Data[0], Data[1]); |
480 | } | 478 | } |
481 | 479 | ||
@@ -483,26 +481,26 @@ static void spca500_clksmart310_init(struct gspca_dev *gspca_dev) | |||
483 | { | 481 | { |
484 | __u8 Data[2]; | 482 | __u8 Data[2]; |
485 | 483 | ||
486 | spca5xxRegRead(gspca_dev->dev, 0x0d05, Data, 2); | 484 | reg_r(gspca_dev->dev, 0x0d05, Data, 2); |
487 | PDEBUG(D_PACK, "ClickSmart310 init 0x0d05 0x%02x 0x%02x", Data[0], | 485 | PDEBUG(D_STREAM, "ClickSmart310 init 0x0d05 0x%02x 0x%02x", |
488 | Data[1]); | 486 | Data[0], Data[1]); |
489 | reg_write(gspca_dev->dev, 0x00, 0x8167, 0x5a); | 487 | reg_w(gspca_dev->dev, 0x00, 0x8167, 0x5a); |
490 | spca500_ping310(gspca_dev); | 488 | spca500_ping310(gspca_dev); |
491 | 489 | ||
492 | reg_write(gspca_dev->dev, 0x00, 0x8168, 0x22); | 490 | reg_w(gspca_dev->dev, 0x00, 0x8168, 0x22); |
493 | reg_write(gspca_dev->dev, 0x00, 0x816a, 0xc0); | 491 | reg_w(gspca_dev->dev, 0x00, 0x816a, 0xc0); |
494 | reg_write(gspca_dev->dev, 0x00, 0x816b, 0x0b); | 492 | reg_w(gspca_dev->dev, 0x00, 0x816b, 0x0b); |
495 | reg_write(gspca_dev->dev, 0x00, 0x8169, 0x25); | 493 | reg_w(gspca_dev->dev, 0x00, 0x8169, 0x25); |
496 | reg_write(gspca_dev->dev, 0x00, 0x8157, 0x5b); | 494 | reg_w(gspca_dev->dev, 0x00, 0x8157, 0x5b); |
497 | reg_write(gspca_dev->dev, 0x00, 0x8158, 0x5b); | 495 | reg_w(gspca_dev->dev, 0x00, 0x8158, 0x5b); |
498 | reg_write(gspca_dev->dev, 0x00, 0x813f, 0x03); | 496 | reg_w(gspca_dev->dev, 0x00, 0x813f, 0x03); |
499 | reg_write(gspca_dev->dev, 0x00, 0x8151, 0x4a); | 497 | reg_w(gspca_dev->dev, 0x00, 0x8151, 0x4a); |
500 | reg_write(gspca_dev->dev, 0x00, 0x8153, 0x78); | 498 | reg_w(gspca_dev->dev, 0x00, 0x8153, 0x78); |
501 | reg_write(gspca_dev->dev, 0x00, 0x0d01, 0x04); | 499 | reg_w(gspca_dev->dev, 0x00, 0x0d01, 0x04); |
502 | /* 00 for adjust shutter */ | 500 | /* 00 for adjust shutter */ |
503 | reg_write(gspca_dev->dev, 0x00, 0x0d02, 0x01); | 501 | reg_w(gspca_dev->dev, 0x00, 0x0d02, 0x01); |
504 | reg_write(gspca_dev->dev, 0x00, 0x8169, 0x25); | 502 | reg_w(gspca_dev->dev, 0x00, 0x8169, 0x25); |
505 | reg_write(gspca_dev->dev, 0x00, 0x0d01, 0x02); | 503 | reg_w(gspca_dev->dev, 0x00, 0x0d01, 0x02); |
506 | } | 504 | } |
507 | 505 | ||
508 | static void spca500_setmode(struct gspca_dev *gspca_dev, | 506 | static void spca500_setmode(struct gspca_dev *gspca_dev, |
@@ -511,14 +509,14 @@ static void spca500_setmode(struct gspca_dev *gspca_dev, | |||
511 | int mode; | 509 | int mode; |
512 | 510 | ||
513 | /* set x multiplier */ | 511 | /* set x multiplier */ |
514 | reg_write(gspca_dev->dev, 0, 0x8001, xmult); | 512 | reg_w(gspca_dev->dev, 0, 0x8001, xmult); |
515 | 513 | ||
516 | /* set y multiplier */ | 514 | /* set y multiplier */ |
517 | reg_write(gspca_dev->dev, 0, 0x8002, ymult); | 515 | reg_w(gspca_dev->dev, 0, 0x8002, ymult); |
518 | 516 | ||
519 | /* use compressed mode, VGA, with mode specific subsample */ | 517 | /* use compressed mode, VGA, with mode specific subsample */ |
520 | mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode; | 518 | mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode; |
521 | reg_write(gspca_dev->dev, 0, 0x8003, mode << 4); | 519 | reg_w(gspca_dev->dev, 0, 0x8003, mode << 4); |
522 | } | 520 | } |
523 | 521 | ||
524 | static int spca500_full_reset(struct gspca_dev *gspca_dev) | 522 | static int spca500_full_reset(struct gspca_dev *gspca_dev) |
@@ -526,20 +524,20 @@ static int spca500_full_reset(struct gspca_dev *gspca_dev) | |||
526 | int err; | 524 | int err; |
527 | 525 | ||
528 | /* send the reset command */ | 526 | /* send the reset command */ |
529 | err = reg_write(gspca_dev->dev, 0xe0, 0x0001, 0x0000); | 527 | err = reg_w(gspca_dev->dev, 0xe0, 0x0001, 0x0000); |
530 | if (err < 0) | 528 | if (err < 0) |
531 | return err; | 529 | return err; |
532 | 530 | ||
533 | /* wait for the reset to complete */ | 531 | /* wait for the reset to complete */ |
534 | err = reg_readwait(gspca_dev->dev, 0x06, 0x0000, 0x0000); | 532 | err = reg_r_wait(gspca_dev->dev, 0x06, 0x0000, 0x0000); |
535 | if (err < 0) | 533 | if (err < 0) |
536 | return err; | 534 | return err; |
537 | err = reg_write(gspca_dev->dev, 0xe0, 0x0000, 0x0000); | 535 | err = reg_w(gspca_dev->dev, 0xe0, 0x0000, 0x0000); |
538 | if (err < 0) | 536 | if (err < 0) |
539 | return err; | 537 | return err; |
540 | err = reg_readwait(gspca_dev->dev, 0x06, 0, 0); | 538 | err = reg_r_wait(gspca_dev->dev, 0x06, 0, 0); |
541 | if (err < 0) { | 539 | if (err < 0) { |
542 | PDEBUG(D_ERR, "reg_readwait() failed"); | 540 | PDEBUG(D_ERR, "reg_r_wait() failed"); |
543 | return err; | 541 | return err; |
544 | } | 542 | } |
545 | /* all ok */ | 543 | /* all ok */ |
@@ -562,7 +560,7 @@ static int spca500_synch310(struct gspca_dev *gspca_dev) | |||
562 | } | 560 | } |
563 | spca500_ping310(gspca_dev); | 561 | spca500_ping310(gspca_dev); |
564 | 562 | ||
565 | spca5xxRegRead(gspca_dev->dev, 0x0d00, &Data, 1); | 563 | reg_r(gspca_dev->dev, 0x0d00, &Data, 1); |
566 | 564 | ||
567 | /* need alt setting here */ | 565 | /* need alt setting here */ |
568 | PDEBUG(D_PACK, "ClickSmart310 sync alt: %d", gspca_dev->alt); | 566 | PDEBUG(D_PACK, "ClickSmart310 sync alt: %d", gspca_dev->alt); |
@@ -586,12 +584,12 @@ static void spca500_reinit(struct gspca_dev *gspca_dev) | |||
586 | 584 | ||
587 | /* some unknow command from Aiptek pocket dv and family300 */ | 585 | /* some unknow command from Aiptek pocket dv and family300 */ |
588 | 586 | ||
589 | reg_write(gspca_dev->dev, 0x00, 0x0d01, 0x01); | 587 | reg_w(gspca_dev->dev, 0x00, 0x0d01, 0x01); |
590 | reg_write(gspca_dev->dev, 0x00, 0x0d03, 0x00); | 588 | reg_w(gspca_dev->dev, 0x00, 0x0d03, 0x00); |
591 | reg_write(gspca_dev->dev, 0x00, 0x0d02, 0x01); | 589 | reg_w(gspca_dev->dev, 0x00, 0x0d02, 0x01); |
592 | 590 | ||
593 | /* enable drop packet */ | 591 | /* enable drop packet */ |
594 | reg_write(gspca_dev->dev, 0x00, 0x850a, 0x0001); | 592 | reg_w(gspca_dev->dev, 0x00, 0x850a, 0x0001); |
595 | 593 | ||
596 | err = spca50x_setup_qtable(gspca_dev, 0x00, 0x8800, 0x8840, | 594 | err = spca50x_setup_qtable(gspca_dev, 0x00, 0x8800, 0x8840, |
597 | qtable_pocketdv); | 595 | qtable_pocketdv); |
@@ -599,22 +597,22 @@ static void spca500_reinit(struct gspca_dev *gspca_dev) | |||
599 | PDEBUG(D_ERR|D_STREAM, "spca50x_setup_qtable failed on init"); | 597 | PDEBUG(D_ERR|D_STREAM, "spca50x_setup_qtable failed on init"); |
600 | 598 | ||
601 | /* set qtable index */ | 599 | /* set qtable index */ |
602 | reg_write(gspca_dev->dev, 0x00, 0x8880, 2); | 600 | reg_w(gspca_dev->dev, 0x00, 0x8880, 2); |
603 | /* family cam Quicksmart stuff */ | 601 | /* family cam Quicksmart stuff */ |
604 | reg_write(gspca_dev->dev, 0x00, 0x800a, 0x00); | 602 | reg_w(gspca_dev->dev, 0x00, 0x800a, 0x00); |
605 | /* Set agc transfer: synced inbetween frames */ | 603 | /* Set agc transfer: synced inbetween frames */ |
606 | reg_write(gspca_dev->dev, 0x00, 0x820f, 0x01); | 604 | reg_w(gspca_dev->dev, 0x00, 0x820f, 0x01); |
607 | /* Init SDRAM - needed for SDRAM access */ | 605 | /* Init SDRAM - needed for SDRAM access */ |
608 | reg_write(gspca_dev->dev, 0x00, 0x870a, 0x04); | 606 | reg_w(gspca_dev->dev, 0x00, 0x870a, 0x04); |
609 | /*Start init sequence or stream */ | 607 | /*Start init sequence or stream */ |
610 | 608 | ||
611 | reg_write(gspca_dev->dev, 0, 0x8003, 0x00); | 609 | reg_w(gspca_dev->dev, 0, 0x8003, 0x00); |
612 | /* switch to video camera mode */ | 610 | /* switch to video camera mode */ |
613 | reg_write(gspca_dev->dev, 0x00, 0x8000, 0x0004); | 611 | reg_w(gspca_dev->dev, 0x00, 0x8000, 0x0004); |
614 | msleep(2000); | 612 | msleep(2000); |
615 | if (reg_readwait(gspca_dev->dev, 0, 0x8000, 0x44) != 0) | 613 | if (reg_r_wait(gspca_dev->dev, 0, 0x8000, 0x44) != 0) |
616 | spca5xxRegRead(gspca_dev->dev, 0x816b, &Data, 1); | 614 | reg_r(gspca_dev->dev, 0x816b, &Data, 1); |
617 | reg_write(gspca_dev->dev, 0x00, 0x816b, Data); | 615 | reg_w(gspca_dev->dev, 0x00, 0x816b, Data); |
618 | } | 616 | } |
619 | 617 | ||
620 | /* this function is called at probe time */ | 618 | /* this function is called at probe time */ |
@@ -734,9 +732,9 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
734 | cam->nmodes = sizeof sif_mode / sizeof sif_mode[0]; | 732 | cam->nmodes = sizeof sif_mode / sizeof sif_mode[0]; |
735 | } | 733 | } |
736 | sd->qindex = 5; | 734 | sd->qindex = 5; |
737 | sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value; | 735 | sd->brightness = BRIGHTNESS_DEF; |
738 | sd->contrast = sd_ctrls[SD_CONTRAST].qctrl.default_value; | 736 | sd->contrast = CONTRAST_DEF; |
739 | sd->colors = sd_ctrls[SD_COLOR].qctrl.default_value; | 737 | sd->colors = COLOR_DEF; |
740 | return 0; | 738 | return 0; |
741 | } | 739 | } |
742 | 740 | ||
@@ -771,7 +769,7 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
771 | } | 769 | } |
772 | 770 | ||
773 | /* is there a sensor here ? */ | 771 | /* is there a sensor here ? */ |
774 | spca5xxRegRead(gspca_dev->dev, 0x8a04, &Data, 1); | 772 | reg_r(gspca_dev->dev, 0x8a04, &Data, 1); |
775 | PDEBUG(D_STREAM, "Spca500 Sensor Address 0x%02X", Data); | 773 | PDEBUG(D_STREAM, "Spca500 Sensor Address 0x%02X", Data); |
776 | PDEBUG(D_STREAM, "Spca500 curr_mode: %d Xmult: 0x%02X, Ymult: 0x%02X", | 774 | PDEBUG(D_STREAM, "Spca500 curr_mode: %d Xmult: 0x%02X, Ymult: 0x%02X", |
777 | gspca_dev->curr_mode, xmult, ymult); | 775 | gspca_dev->curr_mode, xmult, ymult); |
@@ -782,33 +780,33 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
782 | spca500_setmode(gspca_dev, xmult, ymult); | 780 | spca500_setmode(gspca_dev, xmult, ymult); |
783 | 781 | ||
784 | /* enable drop packet */ | 782 | /* enable drop packet */ |
785 | reg_write(gspca_dev->dev, 0x00, 0x850a, 0x0001); | 783 | reg_w(gspca_dev->dev, 0x00, 0x850a, 0x0001); |
786 | reg_write(gspca_dev->dev, 0x00, 0x8880, 3); | 784 | reg_w(gspca_dev->dev, 0x00, 0x8880, 3); |
787 | err = spca50x_setup_qtable(gspca_dev, | 785 | err = spca50x_setup_qtable(gspca_dev, |
788 | 0x00, 0x8800, 0x8840, | 786 | 0x00, 0x8800, 0x8840, |
789 | qtable_creative_pccam); | 787 | qtable_creative_pccam); |
790 | if (err < 0) | 788 | if (err < 0) |
791 | PDEBUG(D_ERR, "spca50x_setup_qtable failed"); | 789 | PDEBUG(D_ERR, "spca50x_setup_qtable failed"); |
792 | /* Init SDRAM - needed for SDRAM access */ | 790 | /* Init SDRAM - needed for SDRAM access */ |
793 | reg_write(gspca_dev->dev, 0x00, 0x870a, 0x04); | 791 | reg_w(gspca_dev->dev, 0x00, 0x870a, 0x04); |
794 | 792 | ||
795 | /* switch to video camera mode */ | 793 | /* switch to video camera mode */ |
796 | reg_write(gspca_dev->dev, 0x00, 0x8000, 0x0004); | 794 | reg_w(gspca_dev->dev, 0x00, 0x8000, 0x0004); |
797 | msleep(500); | 795 | msleep(500); |
798 | if (reg_readwait(gspca_dev->dev, 0, 0x8000, 0x44) != 0) | 796 | if (reg_r_wait(gspca_dev->dev, 0, 0x8000, 0x44) != 0) |
799 | PDEBUG(D_ERR, "reg_readwait() failed"); | 797 | PDEBUG(D_ERR, "reg_r_wait() failed"); |
800 | 798 | ||
801 | spca5xxRegRead(gspca_dev->dev, 0x816b, &Data, 1); | 799 | reg_r(gspca_dev->dev, 0x816b, &Data, 1); |
802 | reg_write(gspca_dev->dev, 0x00, 0x816b, Data); | 800 | reg_w(gspca_dev->dev, 0x00, 0x816b, Data); |
803 | 801 | ||
804 | spca500_synch310(gspca_dev); | 802 | spca500_synch310(gspca_dev); |
805 | 803 | ||
806 | write_vector(gspca_dev, spca500_visual_defaults); | 804 | write_vector(gspca_dev, spca500_visual_defaults); |
807 | spca500_setmode(gspca_dev, xmult, ymult); | 805 | spca500_setmode(gspca_dev, xmult, ymult); |
808 | /* enable drop packet */ | 806 | /* enable drop packet */ |
809 | reg_write(gspca_dev->dev, 0x00, 0x850a, 0x0001); | 807 | reg_w(gspca_dev->dev, 0x00, 0x850a, 0x0001); |
810 | PDEBUG(D_ERR, "failed to enable drop packet"); | 808 | PDEBUG(D_ERR, "failed to enable drop packet"); |
811 | reg_write(gspca_dev->dev, 0x00, 0x8880, 3); | 809 | reg_w(gspca_dev->dev, 0x00, 0x8880, 3); |
812 | err = spca50x_setup_qtable(gspca_dev, | 810 | err = spca50x_setup_qtable(gspca_dev, |
813 | 0x00, 0x8800, 0x8840, | 811 | 0x00, 0x8800, 0x8840, |
814 | qtable_creative_pccam); | 812 | qtable_creative_pccam); |
@@ -816,16 +814,16 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
816 | PDEBUG(D_ERR, "spca50x_setup_qtable failed"); | 814 | PDEBUG(D_ERR, "spca50x_setup_qtable failed"); |
817 | 815 | ||
818 | /* Init SDRAM - needed for SDRAM access */ | 816 | /* Init SDRAM - needed for SDRAM access */ |
819 | reg_write(gspca_dev->dev, 0x00, 0x870a, 0x04); | 817 | reg_w(gspca_dev->dev, 0x00, 0x870a, 0x04); |
820 | 818 | ||
821 | /* switch to video camera mode */ | 819 | /* switch to video camera mode */ |
822 | reg_write(gspca_dev->dev, 0x00, 0x8000, 0x0004); | 820 | reg_w(gspca_dev->dev, 0x00, 0x8000, 0x0004); |
823 | 821 | ||
824 | if (reg_readwait(gspca_dev->dev, 0, 0x8000, 0x44) != 0) | 822 | if (reg_r_wait(gspca_dev->dev, 0, 0x8000, 0x44) != 0) |
825 | PDEBUG(D_ERR, "reg_readwait() failed"); | 823 | PDEBUG(D_ERR, "reg_r_wait() failed"); |
826 | 824 | ||
827 | spca5xxRegRead(gspca_dev->dev, 0x816b, &Data, 1); | 825 | reg_r(gspca_dev->dev, 0x816b, &Data, 1); |
828 | reg_write(gspca_dev->dev, 0x00, 0x816b, Data); | 826 | reg_w(gspca_dev->dev, 0x00, 0x816b, Data); |
829 | break; | 827 | break; |
830 | case CreativePCCam300: /* Creative PC-CAM 300 640x480 CCD */ | 828 | case CreativePCCam300: /* Creative PC-CAM 300 640x480 CCD */ |
831 | case IntelPocketPCCamera: /* FIXME: Temporary fix for | 829 | case IntelPocketPCCamera: /* FIXME: Temporary fix for |
@@ -838,10 +836,10 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
838 | PDEBUG(D_ERR, "spca500_full_reset failed"); | 836 | PDEBUG(D_ERR, "spca500_full_reset failed"); |
839 | 837 | ||
840 | /* enable drop packet */ | 838 | /* enable drop packet */ |
841 | err = reg_write(gspca_dev->dev, 0x00, 0x850a, 0x0001); | 839 | err = reg_w(gspca_dev->dev, 0x00, 0x850a, 0x0001); |
842 | if (err < 0) | 840 | if (err < 0) |
843 | PDEBUG(D_ERR, "failed to enable drop packet"); | 841 | PDEBUG(D_ERR, "failed to enable drop packet"); |
844 | reg_write(gspca_dev->dev, 0x00, 0x8880, 3); | 842 | reg_w(gspca_dev->dev, 0x00, 0x8880, 3); |
845 | err = spca50x_setup_qtable(gspca_dev, | 843 | err = spca50x_setup_qtable(gspca_dev, |
846 | 0x00, 0x8800, 0x8840, | 844 | 0x00, 0x8800, 0x8840, |
847 | qtable_creative_pccam); | 845 | qtable_creative_pccam); |
@@ -849,18 +847,18 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
849 | PDEBUG(D_ERR, "spca50x_setup_qtable failed"); | 847 | PDEBUG(D_ERR, "spca50x_setup_qtable failed"); |
850 | 848 | ||
851 | spca500_setmode(gspca_dev, xmult, ymult); | 849 | spca500_setmode(gspca_dev, xmult, ymult); |
852 | reg_write(gspca_dev->dev, 0x20, 0x0001, 0x0004); | 850 | reg_w(gspca_dev->dev, 0x20, 0x0001, 0x0004); |
853 | 851 | ||
854 | /* switch to video camera mode */ | 852 | /* switch to video camera mode */ |
855 | reg_write(gspca_dev->dev, 0x00, 0x8000, 0x0004); | 853 | reg_w(gspca_dev->dev, 0x00, 0x8000, 0x0004); |
856 | 854 | ||
857 | if (reg_readwait(gspca_dev->dev, 0, 0x8000, 0x44) != 0) | 855 | if (reg_r_wait(gspca_dev->dev, 0, 0x8000, 0x44) != 0) |
858 | PDEBUG(D_ERR, "reg_readwait() failed"); | 856 | PDEBUG(D_ERR, "reg_r_wait() failed"); |
859 | 857 | ||
860 | spca5xxRegRead(gspca_dev->dev, 0x816b, &Data, 1); | 858 | reg_r(gspca_dev->dev, 0x816b, &Data, 1); |
861 | reg_write(gspca_dev->dev, 0x00, 0x816b, Data); | 859 | reg_w(gspca_dev->dev, 0x00, 0x816b, Data); |
862 | 860 | ||
863 | /* write_vector(gspca_dev, spca500_visual_defaults); */ | 861 | /* write_vector(gspca_dev, spca500_visual_defaults); */ |
864 | break; | 862 | break; |
865 | case KodakEZ200: /* Kodak EZ200 */ | 863 | case KodakEZ200: /* Kodak EZ200 */ |
866 | 864 | ||
@@ -869,8 +867,8 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
869 | if (err < 0) | 867 | if (err < 0) |
870 | PDEBUG(D_ERR, "spca500_full_reset failed"); | 868 | PDEBUG(D_ERR, "spca500_full_reset failed"); |
871 | /* enable drop packet */ | 869 | /* enable drop packet */ |
872 | reg_write(gspca_dev->dev, 0x00, 0x850a, 0x0001); | 870 | reg_w(gspca_dev->dev, 0x00, 0x850a, 0x0001); |
873 | reg_write(gspca_dev->dev, 0x00, 0x8880, 0); | 871 | reg_w(gspca_dev->dev, 0x00, 0x8880, 0); |
874 | err = spca50x_setup_qtable(gspca_dev, | 872 | err = spca50x_setup_qtable(gspca_dev, |
875 | 0x00, 0x8800, 0x8840, | 873 | 0x00, 0x8800, 0x8840, |
876 | qtable_kodak_ez200); | 874 | qtable_kodak_ez200); |
@@ -878,18 +876,18 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
878 | PDEBUG(D_ERR, "spca50x_setup_qtable failed"); | 876 | PDEBUG(D_ERR, "spca50x_setup_qtable failed"); |
879 | spca500_setmode(gspca_dev, xmult, ymult); | 877 | spca500_setmode(gspca_dev, xmult, ymult); |
880 | 878 | ||
881 | reg_write(gspca_dev->dev, 0x20, 0x0001, 0x0004); | 879 | reg_w(gspca_dev->dev, 0x20, 0x0001, 0x0004); |
882 | 880 | ||
883 | /* switch to video camera mode */ | 881 | /* switch to video camera mode */ |
884 | reg_write(gspca_dev->dev, 0x00, 0x8000, 0x0004); | 882 | reg_w(gspca_dev->dev, 0x00, 0x8000, 0x0004); |
885 | 883 | ||
886 | if (reg_readwait(gspca_dev->dev, 0, 0x8000, 0x44) != 0) | 884 | if (reg_r_wait(gspca_dev->dev, 0, 0x8000, 0x44) != 0) |
887 | PDEBUG(D_ERR, "reg_readwait() failed"); | 885 | PDEBUG(D_ERR, "reg_r_wait() failed"); |
888 | 886 | ||
889 | spca5xxRegRead(gspca_dev->dev, 0x816b, &Data, 1); | 887 | reg_r(gspca_dev->dev, 0x816b, &Data, 1); |
890 | reg_write(gspca_dev->dev, 0x00, 0x816b, Data); | 888 | reg_w(gspca_dev->dev, 0x00, 0x816b, Data); |
891 | 889 | ||
892 | /* write_vector(gspca_dev, spca500_visual_defaults); */ | 890 | /* write_vector(gspca_dev, spca500_visual_defaults); */ |
893 | break; | 891 | break; |
894 | 892 | ||
895 | case BenqDC1016: | 893 | case BenqDC1016: |
@@ -902,56 +900,56 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
902 | case ToptroIndus: | 900 | case ToptroIndus: |
903 | case AgfaCl20: | 901 | case AgfaCl20: |
904 | spca500_reinit(gspca_dev); | 902 | spca500_reinit(gspca_dev); |
905 | reg_write(gspca_dev->dev, 0x00, 0x0d01, 0x01); | 903 | reg_w(gspca_dev->dev, 0x00, 0x0d01, 0x01); |
906 | /* enable drop packet */ | 904 | /* enable drop packet */ |
907 | reg_write(gspca_dev->dev, 0x00, 0x850a, 0x0001); | 905 | reg_w(gspca_dev->dev, 0x00, 0x850a, 0x0001); |
908 | 906 | ||
909 | err = spca50x_setup_qtable(gspca_dev, | 907 | err = spca50x_setup_qtable(gspca_dev, |
910 | 0x00, 0x8800, 0x8840, qtable_pocketdv); | 908 | 0x00, 0x8800, 0x8840, qtable_pocketdv); |
911 | if (err < 0) | 909 | if (err < 0) |
912 | PDEBUG(D_ERR, "spca50x_setup_qtable failed"); | 910 | PDEBUG(D_ERR, "spca50x_setup_qtable failed"); |
913 | reg_write(gspca_dev->dev, 0x00, 0x8880, 2); | 911 | reg_w(gspca_dev->dev, 0x00, 0x8880, 2); |
914 | 912 | ||
915 | /* familycam Quicksmart pocketDV stuff */ | 913 | /* familycam Quicksmart pocketDV stuff */ |
916 | reg_write(gspca_dev->dev, 0x00, 0x800a, 0x00); | 914 | reg_w(gspca_dev->dev, 0x00, 0x800a, 0x00); |
917 | /* Set agc transfer: synced inbetween frames */ | 915 | /* Set agc transfer: synced inbetween frames */ |
918 | reg_write(gspca_dev->dev, 0x00, 0x820f, 0x01); | 916 | reg_w(gspca_dev->dev, 0x00, 0x820f, 0x01); |
919 | /* Init SDRAM - needed for SDRAM access */ | 917 | /* Init SDRAM - needed for SDRAM access */ |
920 | reg_write(gspca_dev->dev, 0x00, 0x870a, 0x04); | 918 | reg_w(gspca_dev->dev, 0x00, 0x870a, 0x04); |
921 | 919 | ||
922 | spca500_setmode(gspca_dev, xmult, ymult); | 920 | spca500_setmode(gspca_dev, xmult, ymult); |
923 | /* switch to video camera mode */ | 921 | /* switch to video camera mode */ |
924 | reg_write(gspca_dev->dev, 0x00, 0x8000, 0x0004); | 922 | reg_w(gspca_dev->dev, 0x00, 0x8000, 0x0004); |
925 | 923 | ||
926 | reg_readwait(gspca_dev->dev, 0, 0x8000, 0x44); | 924 | reg_r_wait(gspca_dev->dev, 0, 0x8000, 0x44); |
927 | 925 | ||
928 | spca5xxRegRead(gspca_dev->dev, 0x816b, &Data, 1); | 926 | reg_r(gspca_dev->dev, 0x816b, &Data, 1); |
929 | reg_write(gspca_dev->dev, 0x00, 0x816b, Data); | 927 | reg_w(gspca_dev->dev, 0x00, 0x816b, Data); |
930 | break; | 928 | break; |
931 | case LogitechTraveler: | 929 | case LogitechTraveler: |
932 | case LogitechClickSmart510: | 930 | case LogitechClickSmart510: |
933 | reg_write(gspca_dev->dev, 0x02, 0x00, 0x00); | 931 | reg_w(gspca_dev->dev, 0x02, 0x00, 0x00); |
934 | /* enable drop packet */ | 932 | /* enable drop packet */ |
935 | reg_write(gspca_dev->dev, 0x00, 0x850a, 0x0001); | 933 | reg_w(gspca_dev->dev, 0x00, 0x850a, 0x0001); |
936 | 934 | ||
937 | err = spca50x_setup_qtable(gspca_dev, | 935 | err = spca50x_setup_qtable(gspca_dev, |
938 | 0x00, 0x8800, | 936 | 0x00, 0x8800, |
939 | 0x8840, qtable_creative_pccam); | 937 | 0x8840, qtable_creative_pccam); |
940 | if (err < 0) | 938 | if (err < 0) |
941 | PDEBUG(D_ERR, "spca50x_setup_qtable failed"); | 939 | PDEBUG(D_ERR, "spca50x_setup_qtable failed"); |
942 | reg_write(gspca_dev->dev, 0x00, 0x8880, 3); | 940 | reg_w(gspca_dev->dev, 0x00, 0x8880, 3); |
943 | reg_write(gspca_dev->dev, 0x00, 0x800a, 0x00); | 941 | reg_w(gspca_dev->dev, 0x00, 0x800a, 0x00); |
944 | /* Init SDRAM - needed for SDRAM access */ | 942 | /* Init SDRAM - needed for SDRAM access */ |
945 | reg_write(gspca_dev->dev, 0x00, 0x870a, 0x04); | 943 | reg_w(gspca_dev->dev, 0x00, 0x870a, 0x04); |
946 | 944 | ||
947 | spca500_setmode(gspca_dev, xmult, ymult); | 945 | spca500_setmode(gspca_dev, xmult, ymult); |
948 | 946 | ||
949 | /* switch to video camera mode */ | 947 | /* switch to video camera mode */ |
950 | reg_write(gspca_dev->dev, 0x00, 0x8000, 0x0004); | 948 | reg_w(gspca_dev->dev, 0x00, 0x8000, 0x0004); |
951 | reg_readwait(gspca_dev->dev, 0, 0x8000, 0x44); | 949 | reg_r_wait(gspca_dev->dev, 0, 0x8000, 0x44); |
952 | 950 | ||
953 | spca5xxRegRead(gspca_dev->dev, 0x816b, &Data, 1); | 951 | reg_r(gspca_dev->dev, 0x816b, &Data, 1); |
954 | reg_write(gspca_dev->dev, 0x00, 0x816b, Data); | 952 | reg_w(gspca_dev->dev, 0x00, 0x816b, Data); |
955 | write_vector(gspca_dev, Clicksmart510_defaults); | 953 | write_vector(gspca_dev, Clicksmart510_defaults); |
956 | break; | 954 | break; |
957 | } | 955 | } |
@@ -959,13 +957,13 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
959 | 957 | ||
960 | static void sd_stopN(struct gspca_dev *gspca_dev) | 958 | static void sd_stopN(struct gspca_dev *gspca_dev) |
961 | { | 959 | { |
962 | __u8 data = 0; | 960 | __u8 data; |
963 | 961 | ||
964 | reg_write(gspca_dev->dev, 0, 0x8003, 0x00); | 962 | reg_w(gspca_dev->dev, 0, 0x8003, 0x00); |
965 | 963 | ||
966 | /* switch to video camera mode */ | 964 | /* switch to video camera mode */ |
967 | reg_write(gspca_dev->dev, 0x00, 0x8000, 0x0004); | 965 | reg_w(gspca_dev->dev, 0x00, 0x8000, 0x0004); |
968 | spca5xxRegRead(gspca_dev->dev, 0x8000, &data, 1); | 966 | reg_r(gspca_dev->dev, 0x8000, &data, 1); |
969 | PDEBUG(D_STREAM, "stop SPCA500 done reg8000: 0x%2x", data); | 967 | PDEBUG(D_STREAM, "stop SPCA500 done reg8000: 0x%2x", data); |
970 | } | 968 | } |
971 | 969 | ||
@@ -979,13 +977,13 @@ static void sd_close(struct gspca_dev *gspca_dev) | |||
979 | 977 | ||
980 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 978 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
981 | struct gspca_frame *frame, /* target */ | 979 | struct gspca_frame *frame, /* target */ |
982 | unsigned char *data, /* isoc packet */ | 980 | __u8 *data, /* isoc packet */ |
983 | int len) /* iso packet length */ | 981 | int len) /* iso packet length */ |
984 | { | 982 | { |
985 | struct sd *sd = (struct sd *) gspca_dev; | 983 | struct sd *sd = (struct sd *) gspca_dev; |
986 | int i; | 984 | int i; |
987 | unsigned char *s, *d; | 985 | __u8 *s, *d; |
988 | static unsigned char ffd9[] = {0xff, 0xd9}; | 986 | static __u8 ffd9[] = {0xff, 0xd9}; |
989 | 987 | ||
990 | /* frames are jpeg 4.1.1 without 0xff escape */ | 988 | /* frames are jpeg 4.1.1 without 0xff escape */ |
991 | if (data[0] == 0xff) { | 989 | if (data[0] == 0xff) { |
@@ -997,9 +995,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
997 | ffd9, 2); | 995 | ffd9, 2); |
998 | 996 | ||
999 | /* put the JPEG header in the new frame */ | 997 | /* put the JPEG header in the new frame */ |
1000 | jpeg_put_header(gspca_dev, frame, | 998 | jpeg_put_header(gspca_dev, frame, sd->qindex, 0x22); |
1001 | ((struct sd *) gspca_dev)->qindex, | ||
1002 | 0x22); | ||
1003 | 999 | ||
1004 | data += SPCA500_OFFSET_DATA; | 1000 | data += SPCA500_OFFSET_DATA; |
1005 | len -= SPCA500_OFFSET_DATA; | 1001 | len -= SPCA500_OFFSET_DATA; |
@@ -1031,43 +1027,52 @@ static void setbrightness(struct gspca_dev *gspca_dev) | |||
1031 | { | 1027 | { |
1032 | struct sd *sd = (struct sd *) gspca_dev; | 1028 | struct sd *sd = (struct sd *) gspca_dev; |
1033 | 1029 | ||
1034 | reg_write(gspca_dev->dev, 0x00, 0x8167, | 1030 | reg_w(gspca_dev->dev, 0x00, 0x8167, |
1035 | (__u8) (sd->brightness - 128)); | 1031 | (__u8) (sd->brightness - 128)); |
1036 | } | 1032 | } |
1037 | 1033 | ||
1038 | static void getbrightness(struct gspca_dev *gspca_dev) | 1034 | static void getbrightness(struct gspca_dev *gspca_dev) |
1039 | { | 1035 | { |
1040 | struct sd *sd = (struct sd *) gspca_dev; | 1036 | struct sd *sd = (struct sd *) gspca_dev; |
1037 | int ret; | ||
1041 | 1038 | ||
1042 | sd->brightness = reg_read(gspca_dev->dev, 0x00, 0x8167, 1) + 128; | 1039 | ret = reg_r_12(gspca_dev->dev, 0x00, 0x8167, 1); |
1040 | if (ret >= 0) | ||
1041 | sd->brightness = ret + 128; | ||
1043 | } | 1042 | } |
1044 | 1043 | ||
1045 | static void setcontrast(struct gspca_dev *gspca_dev) | 1044 | static void setcontrast(struct gspca_dev *gspca_dev) |
1046 | { | 1045 | { |
1047 | struct sd *sd = (struct sd *) gspca_dev; | 1046 | struct sd *sd = (struct sd *) gspca_dev; |
1048 | 1047 | ||
1049 | reg_write(gspca_dev->dev, 0x00, 0x8168, sd->contrast >> 2); | 1048 | reg_w(gspca_dev->dev, 0x00, 0x8168, sd->contrast); |
1050 | } | 1049 | } |
1051 | 1050 | ||
1052 | static void getcontrast(struct gspca_dev *gspca_dev) | 1051 | static void getcontrast(struct gspca_dev *gspca_dev) |
1053 | { | 1052 | { |
1054 | struct sd *sd = (struct sd *) gspca_dev; | 1053 | struct sd *sd = (struct sd *) gspca_dev; |
1054 | int ret; | ||
1055 | 1055 | ||
1056 | sd->contrast = reg_read(gspca_dev->dev, 0x0, 0x8168, 1) << 2; | 1056 | ret = reg_r_12(gspca_dev->dev, 0x0, 0x8168, 1); |
1057 | if (ret >= 0) | ||
1058 | sd->contrast = ret; | ||
1057 | } | 1059 | } |
1058 | 1060 | ||
1059 | static void setcolors(struct gspca_dev *gspca_dev) | 1061 | static void setcolors(struct gspca_dev *gspca_dev) |
1060 | { | 1062 | { |
1061 | struct sd *sd = (struct sd *) gspca_dev; | 1063 | struct sd *sd = (struct sd *) gspca_dev; |
1062 | 1064 | ||
1063 | reg_write(gspca_dev->dev, 0x00, 0x8169, sd->colors >> 2); | 1065 | reg_w(gspca_dev->dev, 0x00, 0x8169, sd->colors); |
1064 | } | 1066 | } |
1065 | 1067 | ||
1066 | static void getcolors(struct gspca_dev *gspca_dev) | 1068 | static void getcolors(struct gspca_dev *gspca_dev) |
1067 | { | 1069 | { |
1068 | struct sd *sd = (struct sd *) gspca_dev; | 1070 | struct sd *sd = (struct sd *) gspca_dev; |
1071 | int ret; | ||
1069 | 1072 | ||
1070 | sd->colors = reg_read(gspca_dev->dev, 0x0, 0x8169, 1) << 2; | 1073 | ret = reg_r_12(gspca_dev->dev, 0x0, 0x8169, 1); |
1074 | if (ret >= 0) | ||
1075 | sd->colors = ret; | ||
1071 | } | 1076 | } |
1072 | 1077 | ||
1073 | static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val) | 1078 | static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val) |
@@ -1131,7 +1136,7 @@ static int sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val) | |||
1131 | static struct sd_desc sd_desc = { | 1136 | static struct sd_desc sd_desc = { |
1132 | .name = MODULE_NAME, | 1137 | .name = MODULE_NAME, |
1133 | .ctrls = sd_ctrls, | 1138 | .ctrls = sd_ctrls, |
1134 | .nctrls = sizeof sd_ctrls / sizeof sd_ctrls[0], | 1139 | .nctrls = ARRAY_SIZE(sd_ctrls), |
1135 | .config = sd_config, | 1140 | .config = sd_config, |
1136 | .open = sd_open, | 1141 | .open = sd_open, |
1137 | .start = sd_start, | 1142 | .start = sd_start, |
@@ -1143,7 +1148,7 @@ static struct sd_desc sd_desc = { | |||
1143 | 1148 | ||
1144 | /* -- module initialisation -- */ | 1149 | /* -- module initialisation -- */ |
1145 | #define DVNM(name) .driver_info = (kernel_ulong_t) name | 1150 | #define DVNM(name) .driver_info = (kernel_ulong_t) name |
1146 | static __devinitdata struct usb_device_id device_table[] = { | 1151 | static const __devinitdata struct usb_device_id device_table[] = { |
1147 | {USB_DEVICE(0x040a, 0x0300), DVNM("Kodak EZ200")}, | 1152 | {USB_DEVICE(0x040a, 0x0300), DVNM("Kodak EZ200")}, |
1148 | {USB_DEVICE(0x041e, 0x400a), DVNM("Creative PC-CAM 300")}, | 1153 | {USB_DEVICE(0x041e, 0x400a), DVNM("Creative PC-CAM 300")}, |
1149 | {USB_DEVICE(0x046d, 0x0890), DVNM("Logitech QuickCam traveler")}, | 1154 | {USB_DEVICE(0x046d, 0x0890), DVNM("Logitech QuickCam traveler")}, |
diff --git a/drivers/media/video/gspca/spca501.c b/drivers/media/video/gspca/spca501.c index c6468cf3506a..417fbe2214be 100644 --- a/drivers/media/video/gspca/spca501.c +++ b/drivers/media/video/gspca/spca501.c | |||
@@ -23,8 +23,8 @@ | |||
23 | 23 | ||
24 | #include "gspca.h" | 24 | #include "gspca.h" |
25 | 25 | ||
26 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 0) | 26 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4) |
27 | static const char version[] = "2.1.0"; | 27 | static const char version[] = "2.1.4"; |
28 | 28 | ||
29 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); | 29 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); |
30 | MODULE_DESCRIPTION("GSPCA/SPCA501 USB Camera Driver"); | 30 | MODULE_DESCRIPTION("GSPCA/SPCA501 USB Camera Driver"); |
@@ -151,7 +151,7 @@ static struct cam_mode vga_mode[] = { | |||
151 | #define SPCA501_A33 0x10 | 151 | #define SPCA501_A33 0x10 |
152 | 152 | ||
153 | /* Data for video camera initialization before capturing */ | 153 | /* Data for video camera initialization before capturing */ |
154 | static __u16 spca501_open_data[][3] = { | 154 | static const __u16 spca501_open_data[][3] = { |
155 | /* bmRequest,value,index */ | 155 | /* bmRequest,value,index */ |
156 | 156 | ||
157 | {0x2, 0x50, 0x00}, /* C/S enable soft reset */ | 157 | {0x2, 0x50, 0x00}, /* C/S enable soft reset */ |
@@ -257,7 +257,7 @@ static __u16 spca501_open_data[][3] = { | |||
257 | */ | 257 | */ |
258 | 258 | ||
259 | /* Data for chip initialization (set default values) */ | 259 | /* Data for chip initialization (set default values) */ |
260 | static __u16 spca501_init_data[][3] = { | 260 | static const __u16 spca501_init_data[][3] = { |
261 | /* Set all the values to powerup defaults */ | 261 | /* Set all the values to powerup defaults */ |
262 | /* bmRequest,value,index */ | 262 | /* bmRequest,value,index */ |
263 | {0x0, 0xAA, 0x00}, | 263 | {0x0, 0xAA, 0x00}, |
@@ -544,7 +544,7 @@ static __u16 spca501_init_data[][3] = { | |||
544 | * Capture and decoding by Colin Peart. | 544 | * Capture and decoding by Colin Peart. |
545 | * This is is for the 3com HomeConnect Lite which is spca501a based. | 545 | * This is is for the 3com HomeConnect Lite which is spca501a based. |
546 | */ | 546 | */ |
547 | static __u16 spca501_3com_open_data[][3] = { | 547 | static const __u16 spca501_3com_open_data[][3] = { |
548 | /* bmRequest,value,index */ | 548 | /* bmRequest,value,index */ |
549 | {0x2, 0x0050, 0x0000}, /* C/S Enable TG soft reset, timing mode=010 */ | 549 | {0x2, 0x0050, 0x0000}, /* C/S Enable TG soft reset, timing mode=010 */ |
550 | {0x2, 0x0043, 0x0000}, /* C/S Disable TG soft reset, timing mode=010 */ | 550 | {0x2, 0x0043, 0x0000}, /* C/S Disable TG soft reset, timing mode=010 */ |
@@ -639,7 +639,7 @@ static __u16 spca501_3com_open_data[][3] = { | |||
639 | * 2) Understand why some values seem to appear more than once | 639 | * 2) Understand why some values seem to appear more than once |
640 | * 3) Write a small comment for each line of the following arrays. | 640 | * 3) Write a small comment for each line of the following arrays. |
641 | */ | 641 | */ |
642 | static __u16 spca501c_arowana_open_data[][3] = { | 642 | static const __u16 spca501c_arowana_open_data[][3] = { |
643 | /* bmRequest,value,index */ | 643 | /* bmRequest,value,index */ |
644 | {0x02, 0x0007, 0x0005}, | 644 | {0x02, 0x0007, 0x0005}, |
645 | {0x02, 0xa048, 0x0000}, | 645 | {0x02, 0xa048, 0x0000}, |
@@ -661,7 +661,7 @@ static __u16 spca501c_arowana_open_data[][3] = { | |||
661 | {} | 661 | {} |
662 | }; | 662 | }; |
663 | 663 | ||
664 | static __u16 spca501c_arowana_init_data[][3] = { | 664 | static const __u16 spca501c_arowana_init_data[][3] = { |
665 | /* bmRequest,value,index */ | 665 | /* bmRequest,value,index */ |
666 | {0x02, 0x0007, 0x0005}, | 666 | {0x02, 0x0007, 0x0005}, |
667 | {0x02, 0xa048, 0x0000}, | 667 | {0x02, 0xa048, 0x0000}, |
@@ -1595,7 +1595,7 @@ static __u16 spca501c_arowana_init_data[][3] = { | |||
1595 | 1595 | ||
1596 | /* Unknow camera from Ori Usbid 0x0000:0x0000 */ | 1596 | /* Unknow camera from Ori Usbid 0x0000:0x0000 */ |
1597 | /* Based on snoops from Ori Cohen */ | 1597 | /* Based on snoops from Ori Cohen */ |
1598 | static __u16 spca501c_mysterious_open_data[][3] = { | 1598 | static const __u16 spca501c_mysterious_open_data[][3] = { |
1599 | {0x02, 0x000f, 0x0005}, | 1599 | {0x02, 0x000f, 0x0005}, |
1600 | {0x02, 0xa048, 0x0000}, | 1600 | {0x02, 0xa048, 0x0000}, |
1601 | {0x05, 0x0022, 0x0004}, | 1601 | {0x05, 0x0022, 0x0004}, |
@@ -1646,7 +1646,7 @@ static __u16 spca501c_mysterious_open_data[][3] = { | |||
1646 | }; | 1646 | }; |
1647 | 1647 | ||
1648 | /* Based on snoops from Ori Cohen */ | 1648 | /* Based on snoops from Ori Cohen */ |
1649 | static __u16 spca501c_mysterious_init_data[][3] = { | 1649 | static const __u16 spca501c_mysterious_init_data[][3] = { |
1650 | /* Part 3 */ | 1650 | /* Part 3 */ |
1651 | /* TG registers */ | 1651 | /* TG registers */ |
1652 | /* {0x00, 0x0000, 0x0000}, */ | 1652 | /* {0x00, 0x0000, 0x0000}, */ |
@@ -1839,7 +1839,7 @@ static int reg_read(struct usb_device *dev, | |||
1839 | } | 1839 | } |
1840 | 1840 | ||
1841 | static int write_vector(struct gspca_dev *gspca_dev, | 1841 | static int write_vector(struct gspca_dev *gspca_dev, |
1842 | __u16 data[][3]) | 1842 | const __u16 data[][3]) |
1843 | { | 1843 | { |
1844 | struct usb_device *dev = gspca_dev->dev; | 1844 | struct usb_device *dev = gspca_dev->dev; |
1845 | int ret, i = 0; | 1845 | int ret, i = 0; |
@@ -2001,7 +2001,6 @@ static int sd_open(struct gspca_dev *gspca_dev) | |||
2001 | { | 2001 | { |
2002 | struct sd *sd = (struct sd *) gspca_dev; | 2002 | struct sd *sd = (struct sd *) gspca_dev; |
2003 | 2003 | ||
2004 | PDEBUG(D_STREAM, "SPCA501 init"); | ||
2005 | switch (sd->subtype) { | 2004 | switch (sd->subtype) { |
2006 | case ThreeComHomeConnectLite: | 2005 | case ThreeComHomeConnectLite: |
2007 | /* Special handling for 3com data */ | 2006 | /* Special handling for 3com data */ |
@@ -2050,7 +2049,7 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
2050 | reg_write(dev, SPCA501_REG_CTLRL, 0x01, 0x02); | 2049 | reg_write(dev, SPCA501_REG_CTLRL, 0x01, 0x02); |
2051 | 2050 | ||
2052 | /* HDG atleast the Intel CreateAndShare needs to have one of its | 2051 | /* HDG atleast the Intel CreateAndShare needs to have one of its |
2053 | * brightness / contrast / color set otherwise it assumes wath seems | 2052 | * brightness / contrast / color set otherwise it assumes what seems |
2054 | * max contrast. Note that strange enough setting any of these is | 2053 | * max contrast. Note that strange enough setting any of these is |
2055 | * enough to fix the max contrast problem, to be sure we set all 3 */ | 2054 | * enough to fix the max contrast problem, to be sure we set all 3 */ |
2056 | setbrightness(gspca_dev); | 2055 | setbrightness(gspca_dev); |
@@ -2159,7 +2158,7 @@ static int sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val) | |||
2159 | } | 2158 | } |
2160 | 2159 | ||
2161 | /* sub-driver description */ | 2160 | /* sub-driver description */ |
2162 | static struct sd_desc sd_desc = { | 2161 | static const struct sd_desc sd_desc = { |
2163 | .name = MODULE_NAME, | 2162 | .name = MODULE_NAME, |
2164 | .ctrls = sd_ctrls, | 2163 | .ctrls = sd_ctrls, |
2165 | .nctrls = ARRAY_SIZE(sd_ctrls), | 2164 | .nctrls = ARRAY_SIZE(sd_ctrls), |
@@ -2174,7 +2173,7 @@ static struct sd_desc sd_desc = { | |||
2174 | 2173 | ||
2175 | /* -- module initialisation -- */ | 2174 | /* -- module initialisation -- */ |
2176 | #define DVNM(name) .driver_info = (kernel_ulong_t) name | 2175 | #define DVNM(name) .driver_info = (kernel_ulong_t) name |
2177 | static __devinitdata struct usb_device_id device_table[] = { | 2176 | static const __devinitdata struct usb_device_id device_table[] = { |
2178 | {USB_DEVICE(0x040a, 0x0002), DVNM("Kodak DVC-325")}, | 2177 | {USB_DEVICE(0x040a, 0x0002), DVNM("Kodak DVC-325")}, |
2179 | {USB_DEVICE(0x0497, 0xc001), DVNM("Smile International")}, | 2178 | {USB_DEVICE(0x0497, 0xc001), DVNM("Smile International")}, |
2180 | {USB_DEVICE(0x0506, 0x00df), DVNM("3Com HomeConnect Lite")}, | 2179 | {USB_DEVICE(0x0506, 0x00df), DVNM("3Com HomeConnect Lite")}, |
diff --git a/drivers/media/video/gspca/spca505.c b/drivers/media/video/gspca/spca505.c index d8ff121c2c5a..30d174fc4b9c 100644 --- a/drivers/media/video/gspca/spca505.c +++ b/drivers/media/video/gspca/spca505.c | |||
@@ -23,8 +23,8 @@ | |||
23 | 23 | ||
24 | #include "gspca.h" | 24 | #include "gspca.h" |
25 | 25 | ||
26 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 0) | 26 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4) |
27 | static const char version[] = "2.1.0"; | 27 | static const char version[] = "2.1.4"; |
28 | 28 | ||
29 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); | 29 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); |
30 | MODULE_DESCRIPTION("GSPCA/SPCA505 USB Camera Driver"); | 30 | MODULE_DESCRIPTION("GSPCA/SPCA505 USB Camera Driver"); |
@@ -91,7 +91,7 @@ static struct cam_mode vga_mode[] = { | |||
91 | /* | 91 | /* |
92 | * Data to initialize a SPCA505. Common to the CCD and external modes | 92 | * Data to initialize a SPCA505. Common to the CCD and external modes |
93 | */ | 93 | */ |
94 | static __u16 spca505_init_data[][3] = { | 94 | static const __u16 spca505_init_data[][3] = { |
95 | /* line bmRequest,value,index */ | 95 | /* line bmRequest,value,index */ |
96 | /* 1819 */ | 96 | /* 1819 */ |
97 | {SPCA50X_REG_GLOBAL, SPCA50X_GMISC3_SAA7113RST, SPCA50X_GLOBAL_MISC3}, | 97 | {SPCA50X_REG_GLOBAL, SPCA50X_GMISC3_SAA7113RST, SPCA50X_GLOBAL_MISC3}, |
@@ -130,7 +130,7 @@ static __u16 spca505_init_data[][3] = { | |||
130 | /* | 130 | /* |
131 | * Data to initialize the camera using the internal CCD | 131 | * Data to initialize the camera using the internal CCD |
132 | */ | 132 | */ |
133 | static __u16 spca505_open_data_ccd[][3] = { | 133 | static const __u16 spca505_open_data_ccd[][3] = { |
134 | /* line bmRequest,value,index */ | 134 | /* line bmRequest,value,index */ |
135 | /* Internal CCD data set */ | 135 | /* Internal CCD data set */ |
136 | /* 1891 */ {0x3, 0x04, 0x01}, | 136 | /* 1891 */ {0x3, 0x04, 0x01}, |
@@ -319,7 +319,7 @@ static __u16 spca505_open_data_ccd[][3] = { | |||
319 | /* | 319 | /* |
320 | * Data to initialize a SPCA505. Common to the CCD and external modes | 320 | * Data to initialize a SPCA505. Common to the CCD and external modes |
321 | */ | 321 | */ |
322 | static __u16 spca505b_init_data[][3] = { | 322 | static const __u16 spca505b_init_data[][3] = { |
323 | /* start */ | 323 | /* start */ |
324 | {0x02, 0x00, 0x00}, /* init */ | 324 | {0x02, 0x00, 0x00}, /* init */ |
325 | {0x02, 0x00, 0x01}, | 325 | {0x02, 0x00, 0x01}, |
@@ -383,7 +383,7 @@ static __u16 spca505b_init_data[][3] = { | |||
383 | /* | 383 | /* |
384 | * Data to initialize the camera using the internal CCD | 384 | * Data to initialize the camera using the internal CCD |
385 | */ | 385 | */ |
386 | static __u16 spca505b_open_data_ccd[][3] = { | 386 | static const __u16 spca505b_open_data_ccd[][3] = { |
387 | 387 | ||
388 | /* {0x02,0x00,0x00}, */ | 388 | /* {0x02,0x00,0x00}, */ |
389 | {0x03, 0x04, 0x01}, /* rst */ | 389 | {0x03, 0x04, 0x01}, /* rst */ |
@@ -579,7 +579,7 @@ static int reg_read(struct usb_device *dev, | |||
579 | __u16 length) /* wLength (1 or 2 only) */ | 579 | __u16 length) /* wLength (1 or 2 only) */ |
580 | { | 580 | { |
581 | int ret; | 581 | int ret; |
582 | unsigned char buf[4]; | 582 | __u8 buf[4]; |
583 | 583 | ||
584 | buf[1] = 0; | 584 | buf[1] = 0; |
585 | ret = usb_control_msg(dev, | 585 | ret = usb_control_msg(dev, |
@@ -599,7 +599,7 @@ static int reg_read(struct usb_device *dev, | |||
599 | } | 599 | } |
600 | 600 | ||
601 | static int write_vector(struct gspca_dev *gspca_dev, | 601 | static int write_vector(struct gspca_dev *gspca_dev, |
602 | __u16 data[][3]) | 602 | const __u16 data[][3]) |
603 | { | 603 | { |
604 | struct usb_device *dev = gspca_dev->dev; | 604 | struct usb_device *dev = gspca_dev->dev; |
605 | int ret, i = 0; | 605 | int ret, i = 0; |
@@ -801,7 +801,7 @@ static void yyuv_decode(unsigned char *out, | |||
801 | 801 | ||
802 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 802 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
803 | struct gspca_frame *frame, /* target */ | 803 | struct gspca_frame *frame, /* target */ |
804 | unsigned char *data, /* isoc packet */ | 804 | __u8 *data, /* isoc packet */ |
805 | int len) /* iso packet length */ | 805 | int len) /* iso packet length */ |
806 | { | 806 | { |
807 | struct sd *sd = (struct sd *) gspca_dev; | 807 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -878,7 +878,7 @@ static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val) | |||
878 | } | 878 | } |
879 | 879 | ||
880 | /* sub-driver description */ | 880 | /* sub-driver description */ |
881 | static struct sd_desc sd_desc = { | 881 | static const struct sd_desc sd_desc = { |
882 | .name = MODULE_NAME, | 882 | .name = MODULE_NAME, |
883 | .ctrls = sd_ctrls, | 883 | .ctrls = sd_ctrls, |
884 | .nctrls = ARRAY_SIZE(sd_ctrls), | 884 | .nctrls = ARRAY_SIZE(sd_ctrls), |
@@ -893,7 +893,7 @@ static struct sd_desc sd_desc = { | |||
893 | 893 | ||
894 | /* -- module initialisation -- */ | 894 | /* -- module initialisation -- */ |
895 | #define DVNM(name) .driver_info = (kernel_ulong_t) name | 895 | #define DVNM(name) .driver_info = (kernel_ulong_t) name |
896 | static __devinitdata struct usb_device_id device_table[] = { | 896 | static const __devinitdata struct usb_device_id device_table[] = { |
897 | {USB_DEVICE(0x041e, 0x401d), DVNM("Creative Webcam NX ULTRA")}, | 897 | {USB_DEVICE(0x041e, 0x401d), DVNM("Creative Webcam NX ULTRA")}, |
898 | {USB_DEVICE(0x0733, 0x0430), DVNM("Intel PC Camera Pro")}, | 898 | {USB_DEVICE(0x0733, 0x0430), DVNM("Intel PC Camera Pro")}, |
899 | {} | 899 | {} |
diff --git a/drivers/media/video/gspca/spca508.c b/drivers/media/video/gspca/spca508.c index 2ccd877b998d..3b54f41d21c1 100644 --- a/drivers/media/video/gspca/spca508.c +++ b/drivers/media/video/gspca/spca508.c | |||
@@ -22,8 +22,8 @@ | |||
22 | 22 | ||
23 | #include "gspca.h" | 23 | #include "gspca.h" |
24 | 24 | ||
25 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 0) | 25 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4) |
26 | static const char version[] = "2.1.0"; | 26 | static const char version[] = "2.1.4"; |
27 | 27 | ||
28 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); | 28 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); |
29 | MODULE_DESCRIPTION("GSPCA/SPCA508 USB Camera Driver"); | 29 | MODULE_DESCRIPTION("GSPCA/SPCA508 USB Camera Driver"); |
@@ -92,7 +92,7 @@ static struct cam_mode sif_mode[] = { | |||
92 | * Initialization data: this is the first set-up data written to the | 92 | * Initialization data: this is the first set-up data written to the |
93 | * device (before the open data). | 93 | * device (before the open data). |
94 | */ | 94 | */ |
95 | static __u16 spca508_init_data[][3] = | 95 | static const __u16 spca508_init_data[][3] = |
96 | #define IGN(x) /* nothing */ | 96 | #define IGN(x) /* nothing */ |
97 | { | 97 | { |
98 | /* line URB value, index */ | 98 | /* line URB value, index */ |
@@ -584,7 +584,7 @@ static __u16 spca508_init_data[][3] = | |||
584 | /* | 584 | /* |
585 | * Initialization data for Intel EasyPC Camera CS110 | 585 | * Initialization data for Intel EasyPC Camera CS110 |
586 | */ | 586 | */ |
587 | static __u16 spca508cs110_init_data[][3] = { | 587 | static const __u16 spca508cs110_init_data[][3] = { |
588 | {0x0000, 0x870b}, /* Reset CTL3 */ | 588 | {0x0000, 0x870b}, /* Reset CTL3 */ |
589 | {0x0003, 0x8111}, /* Soft Reset compression, memory, TG & CDSP */ | 589 | {0x0003, 0x8111}, /* Soft Reset compression, memory, TG & CDSP */ |
590 | {0x0000, 0x8111}, /* Normal operation on reset */ | 590 | {0x0000, 0x8111}, /* Normal operation on reset */ |
@@ -668,7 +668,7 @@ static __u16 spca508cs110_init_data[][3] = { | |||
668 | {} | 668 | {} |
669 | }; | 669 | }; |
670 | 670 | ||
671 | static __u16 spca508_sightcam_init_data[][3] = { | 671 | static const __u16 spca508_sightcam_init_data[][3] = { |
672 | /* This line seems to setup the frame/canvas */ | 672 | /* This line seems to setup the frame/canvas */ |
673 | /*368 */ {0x000f, 0x8402}, | 673 | /*368 */ {0x000f, 0x8402}, |
674 | 674 | ||
@@ -752,7 +752,7 @@ static __u16 spca508_sightcam_init_data[][3] = { | |||
752 | {0, 0} | 752 | {0, 0} |
753 | }; | 753 | }; |
754 | 754 | ||
755 | static __u16 spca508_sightcam2_init_data[][3] = { | 755 | static const __u16 spca508_sightcam2_init_data[][3] = { |
756 | /* 35 */ {0x0020, 0x8112}, | 756 | /* 35 */ {0x0020, 0x8112}, |
757 | 757 | ||
758 | /* 36 */ {0x000f, 0x8402}, | 758 | /* 36 */ {0x000f, 0x8402}, |
@@ -1099,7 +1099,7 @@ static __u16 spca508_sightcam2_init_data[][3] = { | |||
1099 | /* | 1099 | /* |
1100 | * Initialization data for Creative Webcam Vista | 1100 | * Initialization data for Creative Webcam Vista |
1101 | */ | 1101 | */ |
1102 | static __u16 spca508_vista_init_data[][3] = { | 1102 | static const __u16 spca508_vista_init_data[][3] = { |
1103 | {0x0008, 0x8200}, /* Clear register */ | 1103 | {0x0008, 0x8200}, /* Clear register */ |
1104 | {0x0000, 0x870b}, /* Reset CTL3 */ | 1104 | {0x0000, 0x870b}, /* Reset CTL3 */ |
1105 | {0x0020, 0x8112}, /* Video Drop packet enable */ | 1105 | {0x0020, 0x8112}, /* Video Drop packet enable */ |
@@ -1441,7 +1441,7 @@ static int reg_read(struct usb_device *dev, | |||
1441 | } | 1441 | } |
1442 | 1442 | ||
1443 | static int write_vector(struct gspca_dev *gspca_dev, | 1443 | static int write_vector(struct gspca_dev *gspca_dev, |
1444 | __u16 data[][3]) | 1444 | const __u16 data[][3]) |
1445 | { | 1445 | { |
1446 | struct usb_device *dev = gspca_dev->dev; | 1446 | struct usb_device *dev = gspca_dev->dev; |
1447 | int ret, i = 0; | 1447 | int ret, i = 0; |
@@ -1639,7 +1639,7 @@ static void yuvy_decode(unsigned char *out, | |||
1639 | 1639 | ||
1640 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 1640 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
1641 | struct gspca_frame *frame, /* target */ | 1641 | struct gspca_frame *frame, /* target */ |
1642 | unsigned char *data, /* isoc packet */ | 1642 | __u8 *data, /* isoc packet */ |
1643 | int len) /* iso packet length */ | 1643 | int len) /* iso packet length */ |
1644 | { | 1644 | { |
1645 | struct sd *sd = (struct sd *) gspca_dev; | 1645 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -1717,7 +1717,7 @@ static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val) | |||
1717 | } | 1717 | } |
1718 | 1718 | ||
1719 | /* sub-driver description */ | 1719 | /* sub-driver description */ |
1720 | static struct sd_desc sd_desc = { | 1720 | static const struct sd_desc sd_desc = { |
1721 | .name = MODULE_NAME, | 1721 | .name = MODULE_NAME, |
1722 | .ctrls = sd_ctrls, | 1722 | .ctrls = sd_ctrls, |
1723 | .nctrls = ARRAY_SIZE(sd_ctrls), | 1723 | .nctrls = ARRAY_SIZE(sd_ctrls), |
@@ -1732,7 +1732,7 @@ static struct sd_desc sd_desc = { | |||
1732 | 1732 | ||
1733 | /* -- module initialisation -- */ | 1733 | /* -- module initialisation -- */ |
1734 | #define DVNM(name) .driver_info = (kernel_ulong_t) name | 1734 | #define DVNM(name) .driver_info = (kernel_ulong_t) name |
1735 | static __devinitdata struct usb_device_id device_table[] = { | 1735 | static const __devinitdata struct usb_device_id device_table[] = { |
1736 | {USB_DEVICE(0x041e, 0x4018), DVNM("Creative Webcam Vista (PD1100)")}, | 1736 | {USB_DEVICE(0x041e, 0x4018), DVNM("Creative Webcam Vista (PD1100)")}, |
1737 | {USB_DEVICE(0x0461, 0x0815), DVNM("Micro Innovation IC200")}, | 1737 | {USB_DEVICE(0x0461, 0x0815), DVNM("Micro Innovation IC200")}, |
1738 | {USB_DEVICE(0x0733, 0x0110), DVNM("ViewQuest VQ110")}, | 1738 | {USB_DEVICE(0x0733, 0x0110), DVNM("ViewQuest VQ110")}, |
diff --git a/drivers/media/video/gspca/spca561.c b/drivers/media/video/gspca/spca561.c index dbd1648a655f..8e39cbdda2a5 100644 --- a/drivers/media/video/gspca/spca561.c +++ b/drivers/media/video/gspca/spca561.c | |||
@@ -24,8 +24,8 @@ | |||
24 | 24 | ||
25 | #include "gspca.h" | 25 | #include "gspca.h" |
26 | 26 | ||
27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 0) | 27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4) |
28 | static const char version[] = "2.1.0"; | 28 | static const char version[] = "2.1.4"; |
29 | 29 | ||
30 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); | 30 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); |
31 | MODULE_DESCRIPTION("GSPCA/SPCA561 USB Camera Driver"); | 31 | MODULE_DESCRIPTION("GSPCA/SPCA561 USB Camera Driver"); |
@@ -148,7 +148,8 @@ static void reg_w_val(struct usb_device *dev, __u16 index, __u16 value) | |||
148 | PDEBUG(D_ERR, "reg write: error %d", ret); | 148 | PDEBUG(D_ERR, "reg write: error %d", ret); |
149 | } | 149 | } |
150 | 150 | ||
151 | static void write_vector(struct gspca_dev *gspca_dev, __u16 data[][2]) | 151 | static void write_vector(struct gspca_dev *gspca_dev, |
152 | const __u16 data[][2]) | ||
152 | { | 153 | { |
153 | struct usb_device *dev = gspca_dev->dev; | 154 | struct usb_device *dev = gspca_dev->dev; |
154 | int i; | 155 | int i; |
@@ -171,13 +172,16 @@ static void reg_r(struct usb_device *dev, | |||
171 | } | 172 | } |
172 | 173 | ||
173 | static void reg_w_buf(struct usb_device *dev, | 174 | static void reg_w_buf(struct usb_device *dev, |
174 | __u16 index, __u8 *buffer, __u16 length) | 175 | __u16 index, const __u8 *buffer, __u16 len) |
175 | { | 176 | { |
177 | __u8 tmpbuf[8]; | ||
178 | |||
179 | memcpy(tmpbuf, buffer, len); | ||
176 | usb_control_msg(dev, usb_sndctrlpipe(dev, 0), | 180 | usb_control_msg(dev, usb_sndctrlpipe(dev, 0), |
177 | 0, /* request */ | 181 | 0, /* request */ |
178 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 182 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
179 | 0, /* value */ | 183 | 0, /* value */ |
180 | index, buffer, length, 500); | 184 | index, tmpbuf, len, 500); |
181 | } | 185 | } |
182 | 186 | ||
183 | static void i2c_init(struct gspca_dev *gspca_dev, __u8 mode) | 187 | static void i2c_init(struct gspca_dev *gspca_dev, __u8 mode) |
@@ -227,7 +231,7 @@ static int i2c_read(struct gspca_dev *gspca_dev, __u16 reg, __u8 mode) | |||
227 | return ((int) value << 8) | vallsb; | 231 | return ((int) value << 8) | vallsb; |
228 | } | 232 | } |
229 | 233 | ||
230 | static __u16 spca561_init_data[][2] = { | 234 | static const __u16 spca561_init_data[][2] = { |
231 | {0x0000, 0x8114}, /* Software GPIO output data */ | 235 | {0x0000, 0x8114}, /* Software GPIO output data */ |
232 | {0x0001, 0x8114}, /* Software GPIO output data */ | 236 | {0x0001, 0x8114}, /* Software GPIO output data */ |
233 | {0x0000, 0x8112}, /* Some kind of reset */ | 237 | {0x0000, 0x8112}, /* Some kind of reset */ |
@@ -437,7 +441,7 @@ static void sensor_reset(struct gspca_dev *gspca_dev) | |||
437 | } | 441 | } |
438 | 442 | ||
439 | /******************** QC Express etch2 stuff ********************/ | 443 | /******************** QC Express etch2 stuff ********************/ |
440 | static __u16 Pb100_1map8300[][2] = { | 444 | static const __u16 Pb100_1map8300[][2] = { |
441 | /* reg, value */ | 445 | /* reg, value */ |
442 | {0x8320, 0x3304}, | 446 | {0x8320, 0x3304}, |
443 | 447 | ||
@@ -452,14 +456,14 @@ static __u16 Pb100_1map8300[][2] = { | |||
452 | {0x8302, 0x000e}, | 456 | {0x8302, 0x000e}, |
453 | {} | 457 | {} |
454 | }; | 458 | }; |
455 | static __u16 Pb100_2map8300[][2] = { | 459 | static const __u16 Pb100_2map8300[][2] = { |
456 | /* reg, value */ | 460 | /* reg, value */ |
457 | {0x8339, 0x0000}, | 461 | {0x8339, 0x0000}, |
458 | {0x8307, 0x00aa}, | 462 | {0x8307, 0x00aa}, |
459 | {} | 463 | {} |
460 | }; | 464 | }; |
461 | 465 | ||
462 | static __u16 spca561_161rev12A_data1[][2] = { | 466 | static const __u16 spca561_161rev12A_data1[][2] = { |
463 | {0x21, 0x8118}, | 467 | {0x21, 0x8118}, |
464 | {0x01, 0x8114}, | 468 | {0x01, 0x8114}, |
465 | {0x00, 0x8112}, | 469 | {0x00, 0x8112}, |
@@ -467,7 +471,7 @@ static __u16 spca561_161rev12A_data1[][2] = { | |||
467 | {0x04, 0x8802}, /* windows uses 08 */ | 471 | {0x04, 0x8802}, /* windows uses 08 */ |
468 | {} | 472 | {} |
469 | }; | 473 | }; |
470 | static __u16 spca561_161rev12A_data2[][2] = { | 474 | static const __u16 spca561_161rev12A_data2[][2] = { |
471 | {0x21, 0x8118}, | 475 | {0x21, 0x8118}, |
472 | {0x10, 0x8500}, | 476 | {0x10, 0x8500}, |
473 | {0x07, 0x8601}, | 477 | {0x07, 0x8601}, |
@@ -513,7 +517,7 @@ static __u16 spca561_161rev12A_data2[][2] = { | |||
513 | }; | 517 | }; |
514 | 518 | ||
515 | static void sensor_mapwrite(struct gspca_dev *gspca_dev, | 519 | static void sensor_mapwrite(struct gspca_dev *gspca_dev, |
516 | __u16 sensormap[][2]) | 520 | const __u16 sensormap[][2]) |
517 | { | 521 | { |
518 | int i = 0; | 522 | int i = 0; |
519 | __u8 usbval[2]; | 523 | __u8 usbval[2]; |
@@ -956,7 +960,7 @@ static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val) | |||
956 | } | 960 | } |
957 | 961 | ||
958 | /* sub-driver description */ | 962 | /* sub-driver description */ |
959 | static struct sd_desc sd_desc = { | 963 | static const struct sd_desc sd_desc = { |
960 | .name = MODULE_NAME, | 964 | .name = MODULE_NAME, |
961 | .ctrls = sd_ctrls, | 965 | .ctrls = sd_ctrls, |
962 | .nctrls = ARRAY_SIZE(sd_ctrls), | 966 | .nctrls = ARRAY_SIZE(sd_ctrls), |
@@ -971,7 +975,7 @@ static struct sd_desc sd_desc = { | |||
971 | 975 | ||
972 | /* -- module initialisation -- */ | 976 | /* -- module initialisation -- */ |
973 | #define DVNM(name) .driver_info = (kernel_ulong_t) name | 977 | #define DVNM(name) .driver_info = (kernel_ulong_t) name |
974 | static __devinitdata struct usb_device_id device_table[] = { | 978 | static const __devinitdata struct usb_device_id device_table[] = { |
975 | {USB_DEVICE(0x041e, 0x401a), DVNM("Creative Webcam Vista (PD1100)")}, | 979 | {USB_DEVICE(0x041e, 0x401a), DVNM("Creative Webcam Vista (PD1100)")}, |
976 | {USB_DEVICE(0x041e, 0x403b), DVNM("Creative Webcam Vista (VF0010)")}, | 980 | {USB_DEVICE(0x041e, 0x403b), DVNM("Creative Webcam Vista (VF0010)")}, |
977 | {USB_DEVICE(0x0458, 0x7004), DVNM("Genius VideoCAM Express V2")}, | 981 | {USB_DEVICE(0x0458, 0x7004), DVNM("Genius VideoCAM Express V2")}, |
diff --git a/drivers/media/video/gspca/stk014.c b/drivers/media/video/gspca/stk014.c index 6832fe0f3403..ad59c5ab5d90 100644 --- a/drivers/media/video/gspca/stk014.c +++ b/drivers/media/video/gspca/stk014.c | |||
@@ -23,8 +23,8 @@ | |||
23 | #include "gspca.h" | 23 | #include "gspca.h" |
24 | #include "jpeg.h" | 24 | #include "jpeg.h" |
25 | 25 | ||
26 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 0) | 26 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4) |
27 | static const char version[] = "2.1.0"; | 27 | static const char version[] = "2.1.4"; |
28 | 28 | ||
29 | MODULE_AUTHOR("Jean-Francois Moine <http://moinejf.free.fr>"); | 29 | MODULE_AUTHOR("Jean-Francois Moine <http://moinejf.free.fr>"); |
30 | MODULE_DESCRIPTION("Syntek DV4000 (STK014) USB Camera Driver"); | 30 | MODULE_DESCRIPTION("Syntek DV4000 (STK014) USB Camera Driver"); |
@@ -54,7 +54,6 @@ static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val); | |||
54 | static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val); | 54 | static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val); |
55 | 55 | ||
56 | static struct ctrl sd_ctrls[] = { | 56 | static struct ctrl sd_ctrls[] = { |
57 | #define SD_BRIGHTNESS 0 | ||
58 | { | 57 | { |
59 | { | 58 | { |
60 | .id = V4L2_CID_BRIGHTNESS, | 59 | .id = V4L2_CID_BRIGHTNESS, |
@@ -63,12 +62,12 @@ static struct ctrl sd_ctrls[] = { | |||
63 | .minimum = 0, | 62 | .minimum = 0, |
64 | .maximum = 255, | 63 | .maximum = 255, |
65 | .step = 1, | 64 | .step = 1, |
66 | .default_value = 127, | 65 | #define BRIGHTNESS_DEF 127 |
66 | .default_value = BRIGHTNESS_DEF, | ||
67 | }, | 67 | }, |
68 | .set = sd_setbrightness, | 68 | .set = sd_setbrightness, |
69 | .get = sd_getbrightness, | 69 | .get = sd_getbrightness, |
70 | }, | 70 | }, |
71 | #define SD_CONTRAST 1 | ||
72 | { | 71 | { |
73 | { | 72 | { |
74 | .id = V4L2_CID_CONTRAST, | 73 | .id = V4L2_CID_CONTRAST, |
@@ -77,26 +76,26 @@ static struct ctrl sd_ctrls[] = { | |||
77 | .minimum = 0, | 76 | .minimum = 0, |
78 | .maximum = 255, | 77 | .maximum = 255, |
79 | .step = 1, | 78 | .step = 1, |
80 | .default_value = 127, | 79 | #define CONTRAST_DEF 127 |
80 | .default_value = CONTRAST_DEF, | ||
81 | }, | 81 | }, |
82 | .set = sd_setcontrast, | 82 | .set = sd_setcontrast, |
83 | .get = sd_getcontrast, | 83 | .get = sd_getcontrast, |
84 | }, | 84 | }, |
85 | #define SD_COLOR 2 | ||
86 | { | 85 | { |
87 | { | 86 | { |
88 | .id = V4L2_CID_SATURATION, | 87 | .id = V4L2_CID_SATURATION, |
89 | .type = V4L2_CTRL_TYPE_INTEGER, | 88 | .type = V4L2_CTRL_TYPE_INTEGER, |
90 | .name = "Saturation", | 89 | .name = "Color", |
91 | .minimum = 0, | 90 | .minimum = 0, |
92 | .maximum = 255, | 91 | .maximum = 255, |
93 | .step = 1, | 92 | .step = 1, |
94 | .default_value = 127, | 93 | #define COLOR_DEF 127 |
94 | .default_value = COLOR_DEF, | ||
95 | }, | 95 | }, |
96 | .set = sd_setcolors, | 96 | .set = sd_setcolors, |
97 | .get = sd_getcolors, | 97 | .get = sd_getcolors, |
98 | }, | 98 | }, |
99 | #define SD_FREQ 3 | ||
100 | { | 99 | { |
101 | { | 100 | { |
102 | .id = V4L2_CID_POWER_LINE_FREQUENCY, | 101 | .id = V4L2_CID_POWER_LINE_FREQUENCY, |
@@ -105,7 +104,8 @@ static struct ctrl sd_ctrls[] = { | |||
105 | .minimum = 1, | 104 | .minimum = 1, |
106 | .maximum = 2, /* 0: 0, 1: 50Hz, 2:60Hz */ | 105 | .maximum = 2, /* 0: 0, 1: 50Hz, 2:60Hz */ |
107 | .step = 1, | 106 | .step = 1, |
108 | .default_value = 1, | 107 | #define FREQ_DEF 1 |
108 | .default_value = FREQ_DEF, | ||
109 | }, | 109 | }, |
110 | .set = sd_setfreq, | 110 | .set = sd_setfreq, |
111 | .get = sd_getfreq, | 111 | .get = sd_getfreq, |
@@ -296,10 +296,10 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
296 | cam->epaddr = 0x02; | 296 | cam->epaddr = 0x02; |
297 | gspca_dev->cam.cam_mode = vga_mode; | 297 | gspca_dev->cam.cam_mode = vga_mode; |
298 | gspca_dev->cam.nmodes = sizeof vga_mode / sizeof vga_mode[0]; | 298 | gspca_dev->cam.nmodes = sizeof vga_mode / sizeof vga_mode[0]; |
299 | sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value; | 299 | sd->brightness = BRIGHTNESS_DEF; |
300 | sd->contrast = sd_ctrls[SD_CONTRAST].qctrl.default_value; | 300 | sd->contrast = CONTRAST_DEF; |
301 | sd->colors = sd_ctrls[SD_COLOR].qctrl.default_value; | 301 | sd->colors = COLOR_DEF; |
302 | sd->lightfreq = sd_ctrls[SD_FREQ].qctrl.default_value; | 302 | sd->lightfreq = FREQ_DEF; |
303 | return 0; | 303 | return 0; |
304 | } | 304 | } |
305 | 305 | ||
@@ -408,7 +408,7 @@ static void sd_close(struct gspca_dev *gspca_dev) | |||
408 | 408 | ||
409 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 409 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
410 | struct gspca_frame *frame, /* target */ | 410 | struct gspca_frame *frame, /* target */ |
411 | unsigned char *data, /* isoc packet */ | 411 | __u8 *data, /* isoc packet */ |
412 | int len) /* iso packet length */ | 412 | int len) /* iso packet length */ |
413 | { | 413 | { |
414 | static unsigned char ffd9[] = {0xff, 0xd9}; | 414 | static unsigned char ffd9[] = {0xff, 0xd9}; |
@@ -518,10 +518,10 @@ static int sd_querymenu(struct gspca_dev *gspca_dev, | |||
518 | case V4L2_CID_POWER_LINE_FREQUENCY: | 518 | case V4L2_CID_POWER_LINE_FREQUENCY: |
519 | switch (menu->index) { | 519 | switch (menu->index) { |
520 | case 1: /* V4L2_CID_POWER_LINE_FREQUENCY_50HZ */ | 520 | case 1: /* V4L2_CID_POWER_LINE_FREQUENCY_50HZ */ |
521 | strcpy(menu->name, "50 Hz"); | 521 | strcpy((char *) menu->name, "50 Hz"); |
522 | return 0; | 522 | return 0; |
523 | case 2: /* V4L2_CID_POWER_LINE_FREQUENCY_60HZ */ | 523 | case 2: /* V4L2_CID_POWER_LINE_FREQUENCY_60HZ */ |
524 | strcpy(menu->name, "60 Hz"); | 524 | strcpy((char *) menu->name, "60 Hz"); |
525 | return 0; | 525 | return 0; |
526 | } | 526 | } |
527 | break; | 527 | break; |
diff --git a/drivers/media/video/gspca/sunplus.c b/drivers/media/video/gspca/sunplus.c index 113c07106924..f2d033508581 100644 --- a/drivers/media/video/gspca/sunplus.c +++ b/drivers/media/video/gspca/sunplus.c | |||
@@ -24,8 +24,8 @@ | |||
24 | #include "gspca.h" | 24 | #include "gspca.h" |
25 | #include "jpeg.h" | 25 | #include "jpeg.h" |
26 | 26 | ||
27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 1) | 27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4) |
28 | static const char version[] = "2.1.1"; | 28 | static const char version[] = "2.1.4"; |
29 | 29 | ||
30 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); | 30 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); |
31 | MODULE_DESCRIPTION("GSPCA/SPCA5xx USB Camera Driver"); | 31 | MODULE_DESCRIPTION("GSPCA/SPCA5xx USB Camera Driver"); |
@@ -35,7 +35,7 @@ MODULE_LICENSE("GPL"); | |||
35 | struct sd { | 35 | struct sd { |
36 | struct gspca_dev gspca_dev; /* !! must be the first item */ | 36 | struct gspca_dev gspca_dev; /* !! must be the first item */ |
37 | 37 | ||
38 | unsigned char packet[ISO_MAX_SIZE + 128]; | 38 | __u8 packet[ISO_MAX_SIZE + 128]; |
39 | /* !! no more than 128 ff in an ISO packet */ | 39 | /* !! no more than 128 ff in an ISO packet */ |
40 | 40 | ||
41 | unsigned char brightness; | 41 | unsigned char brightness; |
@@ -156,7 +156,7 @@ static struct cam_mode vga_mode2[] = { | |||
156 | #define SPCA536_OFFSET_FRAMSEQ 1 | 156 | #define SPCA536_OFFSET_FRAMSEQ 1 |
157 | 157 | ||
158 | /* Initialisation data for the Creative PC-CAM 600 */ | 158 | /* Initialisation data for the Creative PC-CAM 600 */ |
159 | static __u16 spca504_pccam600_init_data[][3] = { | 159 | static const __u16 spca504_pccam600_init_data[][3] = { |
160 | /* {0xa0, 0x0000, 0x0503}, * capture mode */ | 160 | /* {0xa0, 0x0000, 0x0503}, * capture mode */ |
161 | {0x00, 0x0000, 0x2000}, | 161 | {0x00, 0x0000, 0x2000}, |
162 | {0x00, 0x0013, 0x2301}, | 162 | {0x00, 0x0013, 0x2301}, |
@@ -186,7 +186,7 @@ static __u16 spca504_pccam600_init_data[][3] = { | |||
186 | /* Creative PC-CAM 600 specific open data, sent before using the | 186 | /* Creative PC-CAM 600 specific open data, sent before using the |
187 | * generic initialisation data from spca504_open_data. | 187 | * generic initialisation data from spca504_open_data. |
188 | */ | 188 | */ |
189 | static __u16 spca504_pccam600_open_data[][3] = { | 189 | static const __u16 spca504_pccam600_open_data[][3] = { |
190 | {0x00, 0x0001, 0x2501}, | 190 | {0x00, 0x0001, 0x2501}, |
191 | {0x20, 0x0500, 0x0001}, /* snapshot mode */ | 191 | {0x20, 0x0500, 0x0001}, /* snapshot mode */ |
192 | {0x00, 0x0003, 0x2880}, | 192 | {0x00, 0x0003, 0x2880}, |
@@ -195,7 +195,7 @@ static __u16 spca504_pccam600_open_data[][3] = { | |||
195 | }; | 195 | }; |
196 | 196 | ||
197 | /* Initialisation data for the logitech clicksmart 420 */ | 197 | /* Initialisation data for the logitech clicksmart 420 */ |
198 | static __u16 spca504A_clicksmart420_init_data[][3] = { | 198 | static const __u16 spca504A_clicksmart420_init_data[][3] = { |
199 | /* {0xa0, 0x0000, 0x0503}, * capture mode */ | 199 | /* {0xa0, 0x0000, 0x0503}, * capture mode */ |
200 | {0x00, 0x0000, 0x2000}, | 200 | {0x00, 0x0000, 0x2000}, |
201 | {0x00, 0x0013, 0x2301}, | 201 | {0x00, 0x0013, 0x2301}, |
@@ -226,7 +226,7 @@ static __u16 spca504A_clicksmart420_init_data[][3] = { | |||
226 | }; | 226 | }; |
227 | 227 | ||
228 | /* clicksmart 420 open data ? */ | 228 | /* clicksmart 420 open data ? */ |
229 | static __u16 spca504A_clicksmart420_open_data[][3] = { | 229 | static const __u16 spca504A_clicksmart420_open_data[][3] = { |
230 | {0x00, 0x0001, 0x2501}, | 230 | {0x00, 0x0001, 0x2501}, |
231 | {0x20, 0x0502, 0x0000}, | 231 | {0x20, 0x0502, 0x0000}, |
232 | {0x06, 0x0000, 0x0000}, | 232 | {0x06, 0x0000, 0x0000}, |
@@ -373,7 +373,7 @@ static __u16 spca504A_clicksmart420_open_data[][3] = { | |||
373 | {} | 373 | {} |
374 | }; | 374 | }; |
375 | 375 | ||
376 | static unsigned char qtable_creative_pccam[2][64] = { | 376 | static const __u8 qtable_creative_pccam[2][64] = { |
377 | { /* Q-table Y-components */ | 377 | { /* Q-table Y-components */ |
378 | 0x05, 0x03, 0x03, 0x05, 0x07, 0x0c, 0x0f, 0x12, | 378 | 0x05, 0x03, 0x03, 0x05, 0x07, 0x0c, 0x0f, 0x12, |
379 | 0x04, 0x04, 0x04, 0x06, 0x08, 0x11, 0x12, 0x11, | 379 | 0x04, 0x04, 0x04, 0x06, 0x08, 0x11, 0x12, 0x11, |
@@ -398,7 +398,7 @@ static unsigned char qtable_creative_pccam[2][64] = { | |||
398 | * except for one byte. Possibly a typo? | 398 | * except for one byte. Possibly a typo? |
399 | * NWG: 18/05/2003. | 399 | * NWG: 18/05/2003. |
400 | */ | 400 | */ |
401 | static unsigned char qtable_spca504_default[2][64] = { | 401 | static const __u8 qtable_spca504_default[2][64] = { |
402 | { /* Q-table Y-components */ | 402 | { /* Q-table Y-components */ |
403 | 0x05, 0x03, 0x03, 0x05, 0x07, 0x0c, 0x0f, 0x12, | 403 | 0x05, 0x03, 0x03, 0x05, 0x07, 0x0c, 0x0f, 0x12, |
404 | 0x04, 0x04, 0x04, 0x06, 0x08, 0x11, 0x12, 0x11, | 404 | 0x04, 0x04, 0x04, 0x06, 0x08, 0x11, 0x12, 0x11, |
@@ -512,7 +512,7 @@ static int reg_read(struct usb_device *dev, | |||
512 | } | 512 | } |
513 | 513 | ||
514 | static int write_vector(struct gspca_dev *gspca_dev, | 514 | static int write_vector(struct gspca_dev *gspca_dev, |
515 | __u16 data[][3]) | 515 | const __u16 data[][3]) |
516 | { | 516 | { |
517 | struct usb_device *dev = gspca_dev->dev; | 517 | struct usb_device *dev = gspca_dev->dev; |
518 | int ret, i = 0; | 518 | int ret, i = 0; |
@@ -534,7 +534,7 @@ static int spca50x_setup_qtable(struct gspca_dev *gspca_dev, | |||
534 | unsigned int request, | 534 | unsigned int request, |
535 | unsigned int ybase, | 535 | unsigned int ybase, |
536 | unsigned int cbase, | 536 | unsigned int cbase, |
537 | unsigned char qtable[2][64]) | 537 | const __u8 qtable[2][64]) |
538 | { | 538 | { |
539 | struct usb_device *dev = gspca_dev->dev; | 539 | struct usb_device *dev = gspca_dev->dev; |
540 | int i, err; | 540 | int i, err; |
@@ -1242,7 +1242,7 @@ static void sd_close(struct gspca_dev *gspca_dev) | |||
1242 | 1242 | ||
1243 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 1243 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
1244 | struct gspca_frame *frame, /* target */ | 1244 | struct gspca_frame *frame, /* target */ |
1245 | unsigned char *data, /* isoc packet */ | 1245 | __u8 *data, /* isoc packet */ |
1246 | int len) /* iso packet length */ | 1246 | int len) /* iso packet length */ |
1247 | { | 1247 | { |
1248 | struct sd *sd = (struct sd *) gspca_dev; | 1248 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -1530,7 +1530,7 @@ static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val) | |||
1530 | } | 1530 | } |
1531 | 1531 | ||
1532 | /* sub-driver description */ | 1532 | /* sub-driver description */ |
1533 | static struct sd_desc sd_desc = { | 1533 | static const struct sd_desc sd_desc = { |
1534 | .name = MODULE_NAME, | 1534 | .name = MODULE_NAME, |
1535 | .ctrls = sd_ctrls, | 1535 | .ctrls = sd_ctrls, |
1536 | .nctrls = ARRAY_SIZE(sd_ctrls), | 1536 | .nctrls = ARRAY_SIZE(sd_ctrls), |
@@ -1545,7 +1545,7 @@ static struct sd_desc sd_desc = { | |||
1545 | 1545 | ||
1546 | /* -- module initialisation -- */ | 1546 | /* -- module initialisation -- */ |
1547 | #define DVNM(name) .driver_info = (kernel_ulong_t) name | 1547 | #define DVNM(name) .driver_info = (kernel_ulong_t) name |
1548 | static __devinitdata struct usb_device_id device_table[] = { | 1548 | static const __devinitdata struct usb_device_id device_table[] = { |
1549 | {USB_DEVICE(0x041e, 0x400b), DVNM("Creative PC-CAM 600")}, | 1549 | {USB_DEVICE(0x041e, 0x400b), DVNM("Creative PC-CAM 600")}, |
1550 | {USB_DEVICE(0x041e, 0x4012), DVNM("PC-Cam350")}, | 1550 | {USB_DEVICE(0x041e, 0x4012), DVNM("PC-Cam350")}, |
1551 | {USB_DEVICE(0x041e, 0x4013), DVNM("Creative Pccam750")}, | 1551 | {USB_DEVICE(0x041e, 0x4013), DVNM("Creative Pccam750")}, |
diff --git a/drivers/media/video/gspca/t613.c b/drivers/media/video/gspca/t613.c index de43118dec7a..4e69a8e16357 100644 --- a/drivers/media/video/gspca/t613.c +++ b/drivers/media/video/gspca/t613.c | |||
@@ -26,13 +26,8 @@ | |||
26 | 26 | ||
27 | #define MODULE_NAME "t613" | 27 | #define MODULE_NAME "t613" |
28 | #include "gspca.h" | 28 | #include "gspca.h" |
29 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 3) | 29 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4) |
30 | static const char version[] = "2.1.3"; | 30 | static const char version[] = "2.1.4"; |
31 | |||
32 | struct control_menu_info { | ||
33 | int value; | ||
34 | char name[32]; | ||
35 | }; | ||
36 | 31 | ||
37 | #define MAX_GAMMA 0x10 /* 0 to 15 */ | 32 | #define MAX_GAMMA 0x10 /* 0 to 15 */ |
38 | 33 | ||
@@ -227,19 +222,16 @@ static struct ctrl sd_ctrls[] = { | |||
227 | }, | 222 | }, |
228 | }; | 223 | }; |
229 | 224 | ||
230 | static struct control_menu_info effects_control[] = { | 225 | static char *effects_control[] = { |
231 | {0, "Normal"}, | 226 | "Normal", |
232 | {1, "Emboss"}, /* disabled */ | 227 | "Emboss", /* disabled */ |
233 | {2, "Monochrome"}, | 228 | "Monochrome", |
234 | {3, "Sepia"}, | 229 | "Sepia", |
235 | {4, "Sketch"}, | 230 | "Sketch", |
236 | {5, "Sun Effect"}, /* disabled */ | 231 | "Sun Effect", /* disabled */ |
237 | {6, "Negative"}, | 232 | "Negative", |
238 | }; | 233 | }; |
239 | 234 | ||
240 | #define NUM_EFFECTS_CONTROL \ | ||
241 | (sizeof(effects_control)/sizeof(effects_control[0])) | ||
242 | |||
243 | static struct cam_mode vga_mode_t16[] = { | 235 | static struct cam_mode vga_mode_t16[] = { |
244 | {V4L2_PIX_FMT_JPEG, 160, 120, 4}, | 236 | {V4L2_PIX_FMT_JPEG, 160, 120, 4}, |
245 | {V4L2_PIX_FMT_JPEG, 176, 144, 3}, | 237 | {V4L2_PIX_FMT_JPEG, 176, 144, 3}, |
@@ -252,7 +244,7 @@ static struct cam_mode vga_mode_t16[] = { | |||
252 | #define MAX_EFFECTS 7 | 244 | #define MAX_EFFECTS 7 |
253 | /* easily done by soft, this table could be removed, | 245 | /* easily done by soft, this table could be removed, |
254 | * i keep it here just in case */ | 246 | * i keep it here just in case */ |
255 | unsigned char effects_table[MAX_EFFECTS][6] = { | 247 | static const __u8 effects_table[MAX_EFFECTS][6] = { |
256 | {0xa8, 0xe8, 0xc6, 0xd2, 0xc0, 0x00}, /* Normal */ | 248 | {0xa8, 0xe8, 0xc6, 0xd2, 0xc0, 0x00}, /* Normal */ |
257 | {0xa8, 0xc8, 0xc6, 0x52, 0xc0, 0x04}, /* Repujar */ | 249 | {0xa8, 0xc8, 0xc6, 0x52, 0xc0, 0x04}, /* Repujar */ |
258 | {0xa8, 0xe8, 0xc6, 0xd2, 0xc0, 0x20}, /* Monochrome */ | 250 | {0xa8, 0xe8, 0xc6, 0xd2, 0xc0, 0x20}, /* Monochrome */ |
@@ -262,7 +254,7 @@ unsigned char effects_table[MAX_EFFECTS][6] = { | |||
262 | {0xa8, 0xc8, 0xc6, 0xd2, 0xc0, 0x40}, /* Negative */ | 254 | {0xa8, 0xc8, 0xc6, 0xd2, 0xc0, 0x40}, /* Negative */ |
263 | }; | 255 | }; |
264 | 256 | ||
265 | unsigned char gamma_table[MAX_GAMMA][34] = { | 257 | static const __u8 gamma_table[MAX_GAMMA][34] = { |
266 | {0x90, 0x00, 0x91, 0x3e, 0x92, 0x69, 0x93, 0x85, | 258 | {0x90, 0x00, 0x91, 0x3e, 0x92, 0x69, 0x93, 0x85, |
267 | 0x94, 0x95, 0x95, 0xa1, 0x96, 0xae, 0x97, 0xb9, | 259 | 0x94, 0x95, 0x95, 0xa1, 0x96, 0xae, 0x97, 0xb9, |
268 | 0x98, 0xc2, 0x99, 0xcb, 0x9a, 0xd4, 0x9b, 0xdb, | 260 | 0x98, 0xc2, 0x99, 0xcb, 0x9a, 0xd4, 0x9b, 0xdb, |
@@ -345,7 +337,7 @@ unsigned char gamma_table[MAX_GAMMA][34] = { | |||
345 | 0xA0, 0xFF} | 337 | 0xA0, 0xFF} |
346 | }; | 338 | }; |
347 | 339 | ||
348 | static __u8 tas5130a_sensor_init[][8] = { | 340 | static const __u8 tas5130a_sensor_init[][8] = { |
349 | {0x62, 0x08, 0x63, 0x70, 0x64, 0x1d, 0x60, 0x09}, | 341 | {0x62, 0x08, 0x63, 0x70, 0x64, 0x1d, 0x60, 0x09}, |
350 | {0x62, 0x20, 0x63, 0x01, 0x64, 0x02, 0x60, 0x09}, | 342 | {0x62, 0x20, 0x63, 0x01, 0x64, 0x02, 0x60, 0x09}, |
351 | {0x62, 0x07, 0x63, 0x03, 0x64, 0x00, 0x60, 0x09}, | 343 | {0x62, 0x07, 0x63, 0x03, 0x64, 0x00, 0x60, 0x09}, |
@@ -366,22 +358,41 @@ static void t16RegRead(struct usb_device *dev, | |||
366 | 358 | ||
367 | static void t16RegWrite(struct usb_device *dev, | 359 | static void t16RegWrite(struct usb_device *dev, |
368 | __u16 value, | 360 | __u16 value, |
369 | __u16 index, __u8 *buffer, __u16 len) | 361 | __u16 index, |
362 | const __u8 *buffer, __u16 len) | ||
370 | { | 363 | { |
371 | __u8 tmpbuf[70]; | 364 | if (buffer == NULL) { |
372 | 365 | usb_control_msg(dev, | |
373 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 366 | usb_sndctrlpipe(dev, 0), |
374 | if (len > sizeof tmpbuf) { | 367 | 0, |
375 | PDEBUG(D_ERR|D_PACK, "reg_w: buffer overflow"); | 368 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, |
369 | value, index, | ||
370 | NULL, 0, 500); | ||
376 | return; | 371 | return; |
377 | } | 372 | } |
378 | #endif | 373 | if (len < 16) { |
379 | memcpy(tmpbuf, buffer, len); | 374 | __u8 tmpbuf[16]; |
380 | usb_control_msg(dev, | 375 | |
381 | usb_sndctrlpipe(dev, 0), | 376 | memcpy(tmpbuf, buffer, len); |
382 | 0, /* request */ | 377 | usb_control_msg(dev, |
383 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 378 | usb_sndctrlpipe(dev, 0), |
384 | value, index, tmpbuf, len, 500); | 379 | 0, |
380 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, | ||
381 | value, index, | ||
382 | tmpbuf, len, 500); | ||
383 | } else { | ||
384 | __u8 *tmpbuf; | ||
385 | |||
386 | tmpbuf = kmalloc(len, GFP_KERNEL); | ||
387 | memcpy(tmpbuf, buffer, len); | ||
388 | usb_control_msg(dev, | ||
389 | usb_sndctrlpipe(dev, 0), | ||
390 | 0, | ||
391 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, | ||
392 | value, index, | ||
393 | tmpbuf, len, 500); | ||
394 | kfree(tmpbuf); | ||
395 | } | ||
385 | } | 396 | } |
386 | 397 | ||
387 | /* this function is called at probe time */ | 398 | /* this function is called at probe time */ |
@@ -421,18 +432,18 @@ static int init_default_parameters(struct gspca_dev *gspca_dev) | |||
421 | int i = 0; | 432 | int i = 0; |
422 | __u8 test_byte; | 433 | __u8 test_byte; |
423 | 434 | ||
424 | static unsigned char read_indexs[] = | 435 | static const __u8 read_indexs[] = |
425 | { 0x06, 0x07, 0x0a, 0x0b, 0x66, 0x80, 0x81, 0x8e, 0x8f, 0xa5, | 436 | { 0x06, 0x07, 0x0a, 0x0b, 0x66, 0x80, 0x81, 0x8e, 0x8f, 0xa5, |
426 | 0xa6, 0xa8, 0xbb, 0xbc, 0xc6, 0x00, 0x00 }; | 437 | 0xa6, 0xa8, 0xbb, 0xbc, 0xc6, 0x00, 0x00 }; |
427 | static unsigned char n1[6] = | 438 | static const __u8 n1[6] = |
428 | {0x08, 0x03, 0x09, 0x03, 0x12, 0x04}; | 439 | {0x08, 0x03, 0x09, 0x03, 0x12, 0x04}; |
429 | static unsigned char n2[2] = | 440 | static const __u8 n2[2] = |
430 | {0x08, 0x00}; | 441 | {0x08, 0x00}; |
431 | static unsigned char nset[6] = | 442 | static const __u8 nset[6] = |
432 | { 0x61, 0x68, 0x62, 0xff, 0x60, 0x07 }; | 443 | { 0x61, 0x68, 0x62, 0xff, 0x60, 0x07 }; |
433 | static unsigned char n3[6] = | 444 | static const __u8 n3[6] = |
434 | {0x61, 0x68, 0x65, 0x0a, 0x60, 0x04}; | 445 | {0x61, 0x68, 0x65, 0x0a, 0x60, 0x04}; |
435 | static unsigned char n4[0x46] = | 446 | static const __u8 n4[0x46] = |
436 | {0x09, 0x01, 0x12, 0x04, 0x66, 0x8a, 0x80, 0x3c, | 447 | {0x09, 0x01, 0x12, 0x04, 0x66, 0x8a, 0x80, 0x3c, |
437 | 0x81, 0x22, 0x84, 0x50, 0x8a, 0x78, 0x8b, 0x68, | 448 | 0x81, 0x22, 0x84, 0x50, 0x8a, 0x78, 0x8b, 0x68, |
438 | 0x8c, 0x88, 0x8e, 0x33, 0x8f, 0x24, 0xaa, 0xb1, | 449 | 0x8c, 0x88, 0x8e, 0x33, 0x8f, 0x24, 0xaa, 0xb1, |
@@ -442,40 +453,40 @@ static int init_default_parameters(struct gspca_dev *gspca_dev) | |||
442 | 0x65, 0x0a, 0xbb, 0x86, 0xaf, 0x58, 0xb0, 0x68, | 453 | 0x65, 0x0a, 0xbb, 0x86, 0xaf, 0x58, 0xb0, 0x68, |
443 | 0x87, 0x40, 0x89, 0x2b, 0x8d, 0xff, 0x83, 0x40, | 454 | 0x87, 0x40, 0x89, 0x2b, 0x8d, 0xff, 0x83, 0x40, |
444 | 0xac, 0x84, 0xad, 0x86, 0xaf, 0x46}; | 455 | 0xac, 0x84, 0xad, 0x86, 0xaf, 0x46}; |
445 | static unsigned char nset4[18] = { | 456 | static const __u8 nset4[18] = { |
446 | 0xe0, 0x60, 0xe1, 0xa8, 0xe2, 0xe0, 0xe3, 0x60, 0xe4, 0xa8, | 457 | 0xe0, 0x60, 0xe1, 0xa8, 0xe2, 0xe0, 0xe3, 0x60, 0xe4, 0xa8, |
447 | 0xe5, 0xe0, 0xe6, 0x60, 0xe7, 0xa8, | 458 | 0xe5, 0xe0, 0xe6, 0x60, 0xe7, 0xa8, |
448 | 0xe8, 0xe0 | 459 | 0xe8, 0xe0 |
449 | }; | 460 | }; |
450 | /* ojo puede ser 0xe6 en vez de 0xe9 */ | 461 | /* ojo puede ser 0xe6 en vez de 0xe9 */ |
451 | static unsigned char nset2[20] = { | 462 | static const __u8 nset2[20] = { |
452 | 0xd0, 0xbb, 0xd1, 0x28, 0xd2, 0x10, 0xd3, 0x10, 0xd4, 0xbb, | 463 | 0xd0, 0xbb, 0xd1, 0x28, 0xd2, 0x10, 0xd3, 0x10, 0xd4, 0xbb, |
453 | 0xd5, 0x28, 0xd6, 0x1e, 0xd7, 0x27, | 464 | 0xd5, 0x28, 0xd6, 0x1e, 0xd7, 0x27, |
454 | 0xd8, 0xc8, 0xd9, 0xfc | 465 | 0xd8, 0xc8, 0xd9, 0xfc |
455 | }; | 466 | }; |
456 | static unsigned char missing[8] = | 467 | static const __u8 missing[8] = |
457 | { 0x87, 0x20, 0x88, 0x20, 0x89, 0x20, 0x80, 0x38 }; | 468 | { 0x87, 0x20, 0x88, 0x20, 0x89, 0x20, 0x80, 0x38 }; |
458 | static unsigned char nset3[18] = { | 469 | static const __u8 nset3[18] = { |
459 | 0xc7, 0x60, 0xc8, 0xa8, 0xc9, 0xe0, 0xca, 0x60, 0xcb, 0xa8, | 470 | 0xc7, 0x60, 0xc8, 0xa8, 0xc9, 0xe0, 0xca, 0x60, 0xcb, 0xa8, |
460 | 0xcc, 0xe0, 0xcd, 0x60, 0xce, 0xa8, | 471 | 0xcc, 0xe0, 0xcd, 0x60, 0xce, 0xa8, |
461 | 0xcf, 0xe0 | 472 | 0xcf, 0xe0 |
462 | }; | 473 | }; |
463 | static unsigned char nset5[4] = | 474 | static const __u8 nset5[4] = |
464 | { 0x8f, 0x24, 0xc3, 0x00 }; /* bright */ | 475 | { 0x8f, 0x24, 0xc3, 0x00 }; /* bright */ |
465 | static unsigned char nset6[34] = { | 476 | static const __u8 nset6[34] = { |
466 | 0x90, 0x00, 0x91, 0x1c, 0x92, 0x30, 0x93, 0x43, 0x94, 0x54, | 477 | 0x90, 0x00, 0x91, 0x1c, 0x92, 0x30, 0x93, 0x43, 0x94, 0x54, |
467 | 0x95, 0x65, 0x96, 0x75, 0x97, 0x84, | 478 | 0x95, 0x65, 0x96, 0x75, 0x97, 0x84, |
468 | 0x98, 0x93, 0x99, 0xa1, 0x9a, 0xb0, 0x9b, 0xbd, 0x9c, 0xca, | 479 | 0x98, 0x93, 0x99, 0xa1, 0x9a, 0xb0, 0x9b, 0xbd, 0x9c, 0xca, |
469 | 0x9d, 0xd8, 0x9e, 0xe5, 0x9f, 0xf2, | 480 | 0x9d, 0xd8, 0x9e, 0xe5, 0x9f, 0xf2, |
470 | 0xa0, 0xff | 481 | 0xa0, 0xff |
471 | }; /* Gamma */ | 482 | }; /* Gamma */ |
472 | static unsigned char nset7[4] = | 483 | static const __u8 nset7[4] = |
473 | { 0x66, 0xca, 0xa8, 0xf8 }; /* 50/60 Hz */ | 484 | { 0x66, 0xca, 0xa8, 0xf8 }; /* 50/60 Hz */ |
474 | static unsigned char nset9[4] = | 485 | static const __u8 nset9[4] = |
475 | { 0x0b, 0x04, 0x0a, 0x78 }; | 486 | { 0x0b, 0x04, 0x0a, 0x78 }; |
476 | static unsigned char nset8[6] = | 487 | static const __u8 nset8[6] = |
477 | { 0xa8, 0xf0, 0xc6, 0x88, 0xc0, 0x00 }; | 488 | { 0xa8, 0xf0, 0xc6, 0x88, 0xc0, 0x00 }; |
478 | static unsigned char nset10[6] = | 489 | static const __u8 nset10[6] = |
479 | { 0x0c, 0x03, 0xab, 0x10, 0x81, 0x20 }; | 490 | { 0x0c, 0x03, 0xab, 0x10, 0x81, 0x20 }; |
480 | 491 | ||
481 | t16RegWrite(dev, 0x01, 0x0000, n1, 0x06); | 492 | t16RegWrite(dev, 0x01, 0x0000, n1, 0x06); |
@@ -493,31 +504,31 @@ static int init_default_parameters(struct gspca_dev *gspca_dev) | |||
493 | t16RegWrite(dev, 0x01, 0x0000, n3, 0x06); | 504 | t16RegWrite(dev, 0x01, 0x0000, n3, 0x06); |
494 | t16RegWrite(dev, 0x01, 0x0000, n4, 0x46); | 505 | t16RegWrite(dev, 0x01, 0x0000, n4, 0x46); |
495 | t16RegRead(dev, 0x0080, &test_byte, 1); | 506 | t16RegRead(dev, 0x0080, &test_byte, 1); |
496 | t16RegWrite(dev, 0x00, 0x2c80, 0x00, 0x0); | 507 | t16RegWrite(dev, 0x00, 0x2c80, NULL, 0x0); |
497 | t16RegWrite(dev, 0x01, 0x0000, nset2, 0x14); | 508 | t16RegWrite(dev, 0x01, 0x0000, nset2, 0x14); |
498 | t16RegWrite(dev, 0x01, 0x0000, nset3, 0x12); | 509 | t16RegWrite(dev, 0x01, 0x0000, nset3, 0x12); |
499 | t16RegWrite(dev, 0x01, 0x0000, nset4, 0x12); | 510 | t16RegWrite(dev, 0x01, 0x0000, nset4, 0x12); |
500 | t16RegWrite(dev, 0x00, 0x3880, 0x00, 0x0); | 511 | t16RegWrite(dev, 0x00, 0x3880, NULL, 0x0); |
501 | t16RegWrite(dev, 0x00, 0x3880, 0x00, 0x0); | 512 | t16RegWrite(dev, 0x00, 0x3880, NULL, 0x0); |
502 | t16RegWrite(dev, 0x00, 0x338e, 0x00, 0x0); | 513 | t16RegWrite(dev, 0x00, 0x338e, NULL, 0x0); |
503 | t16RegWrite(dev, 0x01, 0x0000, nset5, 0x04); | 514 | t16RegWrite(dev, 0x01, 0x0000, nset5, 0x04); |
504 | t16RegWrite(dev, 0x00, 0x00a9, 0x00, 0x0); | 515 | t16RegWrite(dev, 0x00, 0x00a9, NULL, 0x0); |
505 | t16RegWrite(dev, 0x01, 0x0000, nset6, 0x22); | 516 | t16RegWrite(dev, 0x01, 0x0000, nset6, 0x22); |
506 | t16RegWrite(dev, 0x00, 0x86bb, 0x00, 0x0); | 517 | t16RegWrite(dev, 0x00, 0x86bb, NULL, 0x0); |
507 | t16RegWrite(dev, 0x00, 0x4aa6, 0x00, 0x0); | 518 | t16RegWrite(dev, 0x00, 0x4aa6, NULL, 0x0); |
508 | 519 | ||
509 | t16RegWrite(dev, 0x01, 0x0000, missing, 0x08); | 520 | t16RegWrite(dev, 0x01, 0x0000, missing, 0x08); |
510 | 521 | ||
511 | t16RegWrite(dev, 0x00, 0x2087, 0x00, 0x0); | 522 | t16RegWrite(dev, 0x00, 0x2087, NULL, 0x0); |
512 | t16RegWrite(dev, 0x00, 0x2088, 0x00, 0x0); | 523 | t16RegWrite(dev, 0x00, 0x2088, NULL, 0x0); |
513 | t16RegWrite(dev, 0x00, 0x2089, 0x00, 0x0); | 524 | t16RegWrite(dev, 0x00, 0x2089, NULL, 0x0); |
514 | 525 | ||
515 | t16RegWrite(dev, 0x01, 0x0000, nset7, 0x04); | 526 | t16RegWrite(dev, 0x01, 0x0000, nset7, 0x04); |
516 | t16RegWrite(dev, 0x01, 0x0000, nset10, 0x06); | 527 | t16RegWrite(dev, 0x01, 0x0000, nset10, 0x06); |
517 | t16RegWrite(dev, 0x01, 0x0000, nset8, 0x06); | 528 | t16RegWrite(dev, 0x01, 0x0000, nset8, 0x06); |
518 | t16RegWrite(dev, 0x01, 0x0000, nset9, 0x04); | 529 | t16RegWrite(dev, 0x01, 0x0000, nset9, 0x04); |
519 | 530 | ||
520 | t16RegWrite(dev, 0x00, 0x2880, 0x00, 0x00); | 531 | t16RegWrite(dev, 0x00, 0x2880, NULL, 0x00); |
521 | t16RegWrite(dev, 0x01, 0x0000, nset2, 0x14); | 532 | t16RegWrite(dev, 0x01, 0x0000, nset2, 0x14); |
522 | t16RegWrite(dev, 0x01, 0x0000, nset3, 0x12); | 533 | t16RegWrite(dev, 0x01, 0x0000, nset3, 0x12); |
523 | t16RegWrite(dev, 0x01, 0x0000, nset4, 0x12); | 534 | t16RegWrite(dev, 0x01, 0x0000, nset4, 0x12); |
@@ -530,7 +541,7 @@ static void setbrightness(struct gspca_dev *gspca_dev) | |||
530 | struct sd *sd = (struct sd *) gspca_dev; | 541 | struct sd *sd = (struct sd *) gspca_dev; |
531 | struct usb_device *dev = gspca_dev->dev; | 542 | struct usb_device *dev = gspca_dev->dev; |
532 | unsigned int brightness; | 543 | unsigned int brightness; |
533 | unsigned char set6[4] = { 0x8f, 0x26, 0xc3, 0x80 }; | 544 | __u8 set6[4] = { 0x8f, 0x26, 0xc3, 0x80 }; |
534 | brightness = sd->brightness; | 545 | brightness = sd->brightness; |
535 | 546 | ||
536 | if (brightness < 7) { | 547 | if (brightness < 7) { |
@@ -548,7 +559,7 @@ static void setflip(struct gspca_dev *gspca_dev) | |||
548 | struct sd *sd = (struct sd *) gspca_dev; | 559 | struct sd *sd = (struct sd *) gspca_dev; |
549 | struct usb_device *dev = gspca_dev->dev; | 560 | struct usb_device *dev = gspca_dev->dev; |
550 | 561 | ||
551 | unsigned char flipcmd[8] = | 562 | __u8 flipcmd[8] = |
552 | { 0x62, 0x07, 0x63, 0x03, 0x64, 0x00, 0x60, 0x09 }; | 563 | { 0x62, 0x07, 0x63, 0x03, 0x64, 0x00, 0x60, 0x09 }; |
553 | 564 | ||
554 | if (sd->mirror == 1) | 565 | if (sd->mirror == 1) |
@@ -570,9 +581,9 @@ static void seteffect(struct gspca_dev *gspca_dev) | |||
570 | } | 581 | } |
571 | 582 | ||
572 | if (sd->effect == 1 || sd->effect == 4) | 583 | if (sd->effect == 1 || sd->effect == 4) |
573 | t16RegWrite(dev, 0x00, 0x4aa6, 0x00, 0x00); | 584 | t16RegWrite(dev, 0x00, 0x4aa6, NULL, 0x00); |
574 | else | 585 | else |
575 | t16RegWrite(dev, 0x00, 0xfaa6, 0x00, 0x00); | 586 | t16RegWrite(dev, 0x00, 0xfaa6, NULL, 0x00); |
576 | } | 587 | } |
577 | 588 | ||
578 | static void setwhitebalance(struct gspca_dev *gspca_dev) | 589 | static void setwhitebalance(struct gspca_dev *gspca_dev) |
@@ -580,7 +591,7 @@ static void setwhitebalance(struct gspca_dev *gspca_dev) | |||
580 | struct sd *sd = (struct sd *) gspca_dev; | 591 | struct sd *sd = (struct sd *) gspca_dev; |
581 | struct usb_device *dev = gspca_dev->dev; | 592 | struct usb_device *dev = gspca_dev->dev; |
582 | 593 | ||
583 | unsigned char white_balance[8] = | 594 | __u8 white_balance[8] = |
584 | { 0x87, 0x20, 0x88, 0x20, 0x89, 0x20, 0x80, 0x38 }; | 595 | { 0x87, 0x20, 0x88, 0x20, 0x89, 0x20, 0x80, 0x38 }; |
585 | 596 | ||
586 | if (sd->whitebalance == 1) | 597 | if (sd->whitebalance == 1) |
@@ -613,18 +624,17 @@ static void setcontrast(struct gspca_dev *gspca_dev) | |||
613 | else | 624 | else |
614 | reg_to_write = (0x00a9 + ((contrast - 7) * 0x200)); | 625 | reg_to_write = (0x00a9 + ((contrast - 7) * 0x200)); |
615 | 626 | ||
616 | t16RegWrite(dev, 0x00, reg_to_write, 0x00, 0); | 627 | t16RegWrite(dev, 0x00, reg_to_write, NULL, 0); |
617 | |||
618 | } | 628 | } |
619 | 629 | ||
620 | static void setcolors(struct gspca_dev *gspca_dev) | 630 | static void setcolors(struct gspca_dev *gspca_dev) |
621 | { | 631 | { |
622 | struct sd *sd = (struct sd *) gspca_dev; | 632 | struct sd *sd = (struct sd *) gspca_dev; |
623 | struct usb_device *dev = gspca_dev->dev; | 633 | struct usb_device *dev = gspca_dev->dev; |
624 | __u16 reg_to_write = 0x00; | 634 | __u16 reg_to_write; |
625 | 635 | ||
626 | reg_to_write = 0xc0bb + sd->colors * 0x100; | 636 | reg_to_write = 0xc0bb + sd->colors * 0x100; |
627 | t16RegWrite(dev, 0x00, reg_to_write, 0x00, 0); | 637 | t16RegWrite(dev, 0x00, reg_to_write, NULL, 0); |
628 | } | 638 | } |
629 | 639 | ||
630 | static void setgamma(struct gspca_dev *gspca_dev) | 640 | static void setgamma(struct gspca_dev *gspca_dev) |
@@ -635,11 +645,11 @@ static void setsharpness(struct gspca_dev *gspca_dev) | |||
635 | { | 645 | { |
636 | struct sd *sd = (struct sd *) gspca_dev; | 646 | struct sd *sd = (struct sd *) gspca_dev; |
637 | struct usb_device *dev = gspca_dev->dev; | 647 | struct usb_device *dev = gspca_dev->dev; |
638 | __u16 reg_to_write = 0x00; | 648 | __u16 reg_to_write; |
639 | 649 | ||
640 | reg_to_write = 0x0aa6 + 0x1000 * sd->sharpness; | 650 | reg_to_write = 0x0aa6 + 0x1000 * sd->sharpness; |
641 | 651 | ||
642 | t16RegWrite(dev, 0x00, reg_to_write, 0x00, 0x00); | 652 | t16RegWrite(dev, 0x00, reg_to_write, NULL, 0x00); |
643 | } | 653 | } |
644 | 654 | ||
645 | static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val) | 655 | static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val) |
@@ -655,6 +665,7 @@ static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val) | |||
655 | static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val) | 665 | static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val) |
656 | { | 666 | { |
657 | struct sd *sd = (struct sd *) gspca_dev; | 667 | struct sd *sd = (struct sd *) gspca_dev; |
668 | |||
658 | *val = sd->brightness; | 669 | *val = sd->brightness; |
659 | return *val; | 670 | return *val; |
660 | } | 671 | } |
@@ -677,7 +688,6 @@ static int sd_getwhitebalance(struct gspca_dev *gspca_dev, __s32 *val) | |||
677 | return *val; | 688 | return *val; |
678 | } | 689 | } |
679 | 690 | ||
680 | |||
681 | static int sd_setflip(struct gspca_dev *gspca_dev, __s32 val) | 691 | static int sd_setflip(struct gspca_dev *gspca_dev, __s32 val) |
682 | { | 692 | { |
683 | struct sd *sd = (struct sd *) gspca_dev; | 693 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -811,9 +821,9 @@ static int sd_setlowlight(struct gspca_dev *gspca_dev, __s32 val) | |||
811 | 821 | ||
812 | sd->autogain = val; | 822 | sd->autogain = val; |
813 | if (val != 0) | 823 | if (val != 0) |
814 | t16RegWrite(dev, 0x00, 0xf48e, 0x00, 0); | 824 | t16RegWrite(dev, 0x00, 0xf48e, NULL, 0); |
815 | else | 825 | else |
816 | t16RegWrite(dev, 0x00, 0xb48e, 0x00, 0); | 826 | t16RegWrite(dev, 0x00, 0xb48e, NULL, 0); |
817 | return 0; | 827 | return 0; |
818 | } | 828 | } |
819 | 829 | ||
@@ -831,12 +841,12 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
831 | int mode; | 841 | int mode; |
832 | __u8 test_byte; | 842 | __u8 test_byte; |
833 | 843 | ||
834 | static __u8 t1[] = { 0x66, 0x00, 0xa8, 0xe8 }; | 844 | static const __u8 t1[] = { 0x66, 0x00, 0xa8, 0xe8 }; |
835 | __u8 t2[] = { 0x07, 0x00, 0x0d, 0x60, 0x0e, 0x80 }; | 845 | __u8 t2[] = { 0x07, 0x00, 0x0d, 0x60, 0x0e, 0x80 }; |
836 | static __u8 t3[] = | 846 | static const __u8 t3[] = |
837 | { 0xb3, 0x07, 0xb4, 0x00, 0xb5, 0x88, 0xb6, 0x02, 0xb7, 0x06, | 847 | { 0xb3, 0x07, 0xb4, 0x00, 0xb5, 0x88, 0xb6, 0x02, 0xb7, 0x06, |
838 | 0xb8, 0x00, 0xb9, 0xe7, 0xba, 0x01 }; | 848 | 0xb8, 0x00, 0xb9, 0xe7, 0xba, 0x01 }; |
839 | static __u8 t4[] = { 0x0b, 0x04, 0x0a, 0x40 }; | 849 | static const __u8 t4[] = { 0x0b, 0x04, 0x0a, 0x40 }; |
840 | 850 | ||
841 | mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode]. mode; | 851 | mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode]. mode; |
842 | switch (mode) { | 852 | switch (mode) { |
@@ -860,16 +870,16 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
860 | t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[1], 0x8); | 870 | t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[1], 0x8); |
861 | t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[2], 0x8); | 871 | t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[2], 0x8); |
862 | t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[3], 0x8); | 872 | t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[3], 0x8); |
863 | t16RegWrite(dev, 0x00, 0x3c80, 0x00, 0x00); | 873 | t16RegWrite(dev, 0x00, 0x3c80, NULL, 0x00); |
864 | /* just in case and to keep sync with logs (for mine) */ | 874 | /* just in case and to keep sync with logs (for mine) */ |
865 | t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[3], 0x8); | 875 | t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[3], 0x8); |
866 | t16RegWrite(dev, 0x00, 0x3c80, 0x00, 0x00); | 876 | t16RegWrite(dev, 0x00, 0x3c80, NULL, 0x00); |
867 | /* just in case and to keep sync with logs (for mine) */ | 877 | /* just in case and to keep sync with logs (for mine) */ |
868 | t16RegWrite(dev, 0x01, 0x0000, t1, 4); | 878 | t16RegWrite(dev, 0x01, 0x0000, t1, 4); |
869 | t16RegWrite(dev, 0x01, 0x0000, t2, 6); | 879 | t16RegWrite(dev, 0x01, 0x0000, t2, 6); |
870 | t16RegRead(dev, 0x0012, &test_byte, 0x1); | 880 | t16RegRead(dev, 0x0012, &test_byte, 0x1); |
871 | t16RegWrite(dev, 0x01, 0x0000, t3, 0x10); | 881 | t16RegWrite(dev, 0x01, 0x0000, t3, 0x10); |
872 | t16RegWrite(dev, 0x00, 0x0013, 0x00, 0x00); | 882 | t16RegWrite(dev, 0x00, 0x0013, NULL, 0x00); |
873 | t16RegWrite(dev, 0x01, 0x0000, t4, 0x4); | 883 | t16RegWrite(dev, 0x01, 0x0000, t4, 0x4); |
874 | /* restart on each start, just in case, sometimes regs goes wrong | 884 | /* restart on each start, just in case, sometimes regs goes wrong |
875 | * when using controls from app */ | 885 | * when using controls from app */ |
@@ -892,11 +902,11 @@ static void sd_close(struct gspca_dev *gspca_dev) | |||
892 | 902 | ||
893 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 903 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
894 | struct gspca_frame *frame, /* target */ | 904 | struct gspca_frame *frame, /* target */ |
895 | unsigned char *data, /* isoc packet */ | 905 | __u8 *data, /* isoc packet */ |
896 | int len) /* iso packet length */ | 906 | int len) /* iso packet length */ |
897 | { | 907 | { |
898 | int sof = 0; | 908 | int sof = 0; |
899 | static unsigned char ffd9[] = { 0xff, 0xd9 }; | 909 | static __u8 ffd9[] = { 0xff, 0xd9 }; |
900 | 910 | ||
901 | if (data[0] == 0x5a) { | 911 | if (data[0] == 0x5a) { |
902 | /* Control Packet, after this came the header again, | 912 | /* Control Packet, after this came the header again, |
@@ -935,27 +945,26 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
935 | static int sd_querymenu(struct gspca_dev *gspca_dev, | 945 | static int sd_querymenu(struct gspca_dev *gspca_dev, |
936 | struct v4l2_querymenu *menu) | 946 | struct v4l2_querymenu *menu) |
937 | { | 947 | { |
938 | memset(menu->name, 0, sizeof menu->name); | ||
939 | |||
940 | switch (menu->id) { | 948 | switch (menu->id) { |
941 | case V4L2_CID_POWER_LINE_FREQUENCY: | 949 | case V4L2_CID_POWER_LINE_FREQUENCY: |
942 | switch (menu->index) { | 950 | switch (menu->index) { |
943 | case 1: /* V4L2_CID_POWER_LINE_FREQUENCY_50HZ */ | 951 | case 1: /* V4L2_CID_POWER_LINE_FREQUENCY_50HZ */ |
944 | strcpy(menu->name, "50 Hz"); | 952 | strcpy((char *) menu->name, "50 Hz"); |
945 | return 0; | 953 | return 0; |
946 | case 2: /* V4L2_CID_POWER_LINE_FREQUENCY_60HZ */ | 954 | case 2: /* V4L2_CID_POWER_LINE_FREQUENCY_60HZ */ |
947 | strcpy(menu->name, "60 Hz"); | 955 | strcpy((char *) menu->name, "60 Hz"); |
948 | return 0; | 956 | return 0; |
949 | } | 957 | } |
950 | break; | 958 | break; |
951 | case V4L2_CID_EFFECTS: | 959 | case V4L2_CID_EFFECTS: |
952 | if (menu->index < 0 || menu->index >= NUM_EFFECTS_CONTROL) | 960 | if ((unsigned) menu->index < ARRAY_SIZE(effects_control)) { |
953 | return -EINVAL; | 961 | strncpy((char *) menu->name, |
954 | strncpy((char *) menu->name, | 962 | effects_control[menu->index], 32); |
955 | effects_control[menu->index].name, 32); | 963 | return 0; |
964 | } | ||
956 | break; | 965 | break; |
957 | } | 966 | } |
958 | return 0; | 967 | return -EINVAL; |
959 | } | 968 | } |
960 | 969 | ||
961 | /* this function is called at open time */ | 970 | /* this function is called at open time */ |
@@ -966,7 +975,7 @@ static int sd_open(struct gspca_dev *gspca_dev) | |||
966 | } | 975 | } |
967 | 976 | ||
968 | /* sub-driver description */ | 977 | /* sub-driver description */ |
969 | static struct sd_desc sd_desc = { | 978 | static const struct sd_desc sd_desc = { |
970 | .name = MODULE_NAME, | 979 | .name = MODULE_NAME, |
971 | .ctrls = sd_ctrls, | 980 | .ctrls = sd_ctrls, |
972 | .nctrls = ARRAY_SIZE(sd_ctrls), | 981 | .nctrls = ARRAY_SIZE(sd_ctrls), |
@@ -982,11 +991,10 @@ static struct sd_desc sd_desc = { | |||
982 | 991 | ||
983 | /* -- module initialisation -- */ | 992 | /* -- module initialisation -- */ |
984 | #define DVNM(name) .driver_info = (kernel_ulong_t) name | 993 | #define DVNM(name) .driver_info = (kernel_ulong_t) name |
985 | static __devinitdata struct usb_device_id device_table[] = { | 994 | static const __devinitdata struct usb_device_id device_table[] = { |
986 | {USB_DEVICE(0x17a1, 0x0128), DVNM("XPX Webcam")}, | 995 | {USB_DEVICE(0x17a1, 0x0128), DVNM("XPX Webcam")}, |
987 | {} | 996 | {} |
988 | }; | 997 | }; |
989 | |||
990 | MODULE_DEVICE_TABLE(usb, device_table); | 998 | MODULE_DEVICE_TABLE(usb, device_table); |
991 | 999 | ||
992 | /* -- device connect -- */ | 1000 | /* -- device connect -- */ |
diff --git a/drivers/media/video/gspca/tv8532.c b/drivers/media/video/gspca/tv8532.c index 6da5280b5433..8561234d65e2 100644 --- a/drivers/media/video/gspca/tv8532.c +++ b/drivers/media/video/gspca/tv8532.c | |||
@@ -22,8 +22,8 @@ | |||
22 | 22 | ||
23 | #include "gspca.h" | 23 | #include "gspca.h" |
24 | 24 | ||
25 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 0) | 25 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4) |
26 | static const char version[] = "2.1.0"; | 26 | static const char version[] = "2.1.4"; |
27 | 27 | ||
28 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); | 28 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); |
29 | MODULE_DESCRIPTION("TV8532 USB Camera Driver"); | 29 | MODULE_DESCRIPTION("TV8532 USB Camera Driver"); |
@@ -152,7 +152,7 @@ static struct cam_mode sif_mode[] = { | |||
152 | #define TV8532_AD_ROWBEGIN_L 0x14 | 152 | #define TV8532_AD_ROWBEGIN_L 0x14 |
153 | #define TV8532_AD_ROWBEGIN_H 0x15 | 153 | #define TV8532_AD_ROWBEGIN_H 0x15 |
154 | 154 | ||
155 | static __u32 tv_8532_eeprom_data[] = { | 155 | static const __u32 tv_8532_eeprom_data[] = { |
156 | /* add dataL dataM dataH */ | 156 | /* add dataL dataM dataH */ |
157 | 0x00010001, 0x01018011, 0x02050014, 0x0305001c, | 157 | 0x00010001, 0x01018011, 0x02050014, 0x0305001c, |
158 | 0x040d001e, 0x0505001f, 0x06050519, 0x0705011b, | 158 | 0x040d001e, 0x0505001f, 0x06050519, 0x0705011b, |
@@ -243,7 +243,7 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
243 | static void tv_8532ReadRegisters(struct gspca_dev *gspca_dev) | 243 | static void tv_8532ReadRegisters(struct gspca_dev *gspca_dev) |
244 | { | 244 | { |
245 | struct usb_device *dev = gspca_dev->dev; | 245 | struct usb_device *dev = gspca_dev->dev; |
246 | __u8 data = 0; | 246 | __u8 data; |
247 | /* __u16 vid, pid; */ | 247 | /* __u16 vid, pid; */ |
248 | 248 | ||
249 | reg_r(dev, 0x0001, &data); | 249 | reg_r(dev, 0x0001, &data); |
@@ -275,7 +275,7 @@ static void tv_8532ReadRegisters(struct gspca_dev *gspca_dev) | |||
275 | static void tv_8532_setReg(struct gspca_dev *gspca_dev) | 275 | static void tv_8532_setReg(struct gspca_dev *gspca_dev) |
276 | { | 276 | { |
277 | struct usb_device *dev = gspca_dev->dev; | 277 | struct usb_device *dev = gspca_dev->dev; |
278 | __u8 data = 0; | 278 | __u8 data; |
279 | __u8 value[2] = { 0, 0 }; | 279 | __u8 value[2] = { 0, 0 }; |
280 | 280 | ||
281 | data = ADCBEGINL; | 281 | data = ADCBEGINL; |
@@ -320,7 +320,7 @@ static void tv_8532_setReg(struct gspca_dev *gspca_dev) | |||
320 | static void tv_8532_PollReg(struct gspca_dev *gspca_dev) | 320 | static void tv_8532_PollReg(struct gspca_dev *gspca_dev) |
321 | { | 321 | { |
322 | struct usb_device *dev = gspca_dev->dev; | 322 | struct usb_device *dev = gspca_dev->dev; |
323 | __u8 data = 0; | 323 | __u8 data; |
324 | int i; | 324 | int i; |
325 | 325 | ||
326 | /* strange polling from tgc */ | 326 | /* strange polling from tgc */ |
@@ -338,9 +338,9 @@ static void tv_8532_PollReg(struct gspca_dev *gspca_dev) | |||
338 | static int sd_open(struct gspca_dev *gspca_dev) | 338 | static int sd_open(struct gspca_dev *gspca_dev) |
339 | { | 339 | { |
340 | struct usb_device *dev = gspca_dev->dev; | 340 | struct usb_device *dev = gspca_dev->dev; |
341 | __u8 data = 0; | 341 | __u8 data; |
342 | __u8 dataStart = 0; | 342 | __u8 dataStart; |
343 | __u8 value[2] = { 0, 0 }; | 343 | __u8 value[2]; |
344 | 344 | ||
345 | data = 0x32; | 345 | data = 0x32; |
346 | reg_w(dev, TV8532_AD_SLOPE, &data, 1); | 346 | reg_w(dev, TV8532_AD_SLOPE, &data, 1); |
@@ -646,7 +646,7 @@ static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val) | |||
646 | } | 646 | } |
647 | 647 | ||
648 | /* sub-driver description */ | 648 | /* sub-driver description */ |
649 | static struct sd_desc sd_desc = { | 649 | static const struct sd_desc sd_desc = { |
650 | .name = MODULE_NAME, | 650 | .name = MODULE_NAME, |
651 | .ctrls = sd_ctrls, | 651 | .ctrls = sd_ctrls, |
652 | .nctrls = ARRAY_SIZE(sd_ctrls), | 652 | .nctrls = ARRAY_SIZE(sd_ctrls), |
@@ -661,7 +661,7 @@ static struct sd_desc sd_desc = { | |||
661 | 661 | ||
662 | /* -- module initialisation -- */ | 662 | /* -- module initialisation -- */ |
663 | #define DVNM(name) .driver_info = (kernel_ulong_t) name | 663 | #define DVNM(name) .driver_info = (kernel_ulong_t) name |
664 | static __devinitdata struct usb_device_id device_table[] = { | 664 | static const __devinitdata struct usb_device_id device_table[] = { |
665 | {USB_DEVICE(0x046d, 0x0920), DVNM("QC Express")}, | 665 | {USB_DEVICE(0x046d, 0x0920), DVNM("QC Express")}, |
666 | {USB_DEVICE(0x046d, 0x0921), DVNM("Labtec Webcam")}, | 666 | {USB_DEVICE(0x046d, 0x0921), DVNM("Labtec Webcam")}, |
667 | {USB_DEVICE(0x0545, 0x808b), DVNM("Veo Stingray")}, | 667 | {USB_DEVICE(0x0545, 0x808b), DVNM("Veo Stingray")}, |
diff --git a/drivers/media/video/gspca/vc032x.c b/drivers/media/video/gspca/vc032x.c index 8b5f6d17d2a5..4144e11c60bb 100644 --- a/drivers/media/video/gspca/vc032x.c +++ b/drivers/media/video/gspca/vc032x.c | |||
@@ -24,8 +24,8 @@ | |||
24 | 24 | ||
25 | #include "gspca.h" | 25 | #include "gspca.h" |
26 | 26 | ||
27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 0) | 27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4) |
28 | static const char version[] = "2.1.0"; | 28 | static const char version[] = "2.1.4"; |
29 | 29 | ||
30 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); | 30 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); |
31 | MODULE_DESCRIPTION("GSPCA/VC032X USB Camera Driver"); | 31 | MODULE_DESCRIPTION("GSPCA/VC032X USB Camera Driver"); |
@@ -97,7 +97,7 @@ static struct cam_mode vc0323_mode[] = { | |||
97 | {V4L2_PIX_FMT_JPEG, 640, 480, 0}, | 97 | {V4L2_PIX_FMT_JPEG, 640, 480, 0}, |
98 | }; | 98 | }; |
99 | 99 | ||
100 | static __u8 mi1310_socinitVGA_JPG[][4] = { | 100 | static const __u8 mi1310_socinitVGA_JPG[][4] = { |
101 | {0xb0, 0x03, 0x19, 0xcc}, | 101 | {0xb0, 0x03, 0x19, 0xcc}, |
102 | {0xb0, 0x04, 0x02, 0xcc}, | 102 | {0xb0, 0x04, 0x02, 0xcc}, |
103 | {0xb3, 0x00, 0x64, 0xcc}, | 103 | {0xb3, 0x00, 0x64, 0xcc}, |
@@ -249,7 +249,7 @@ static __u8 mi1310_socinitVGA_JPG[][4] = { | |||
249 | {0x03, 0x03, 0xc0, 0xbb}, | 249 | {0x03, 0x03, 0xc0, 0xbb}, |
250 | {}, | 250 | {}, |
251 | }; | 251 | }; |
252 | static __u8 mi1310_socinitQVGA_JPG[][4] = { | 252 | static const __u8 mi1310_socinitQVGA_JPG[][4] = { |
253 | {0xb0, 0x03, 0x19, 0xcc}, {0xb0, 0x04, 0x02, 0xcc}, | 253 | {0xb0, 0x03, 0x19, 0xcc}, {0xb0, 0x04, 0x02, 0xcc}, |
254 | {0xb3, 0x00, 0x64, 0xcc}, {0xb3, 0x00, 0x65, 0xcc}, | 254 | {0xb3, 0x00, 0x64, 0xcc}, {0xb3, 0x00, 0x65, 0xcc}, |
255 | {0xb3, 0x05, 0x00, 0xcc}, {0xb3, 0x06, 0x00, 0xcc}, | 255 | {0xb3, 0x05, 0x00, 0xcc}, {0xb3, 0x06, 0x00, 0xcc}, |
@@ -323,14 +323,14 @@ static __u8 mi1310_socinitQVGA_JPG[][4] = { | |||
323 | {}, | 323 | {}, |
324 | }; | 324 | }; |
325 | 325 | ||
326 | static __u8 mi1320_gamma[17] = { | 326 | static const __u8 mi1320_gamma[17] = { |
327 | 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8, | 327 | 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8, |
328 | 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff | 328 | 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff |
329 | }; | 329 | }; |
330 | static __u8 mi1320_matrix[9] = { | 330 | static const __u8 mi1320_matrix[9] = { |
331 | 0x54, 0xda, 0x06, 0xf1, 0x50, 0xf4, 0xf7, 0xea, 0x52 | 331 | 0x54, 0xda, 0x06, 0xf1, 0x50, 0xf4, 0xf7, 0xea, 0x52 |
332 | }; | 332 | }; |
333 | static __u8 mi1320_initVGA_data[][4] = { | 333 | static const __u8 mi1320_initVGA_data[][4] = { |
334 | {0xb3, 0x01, 0x01, 0xcc}, {0x00, 0x00, 0x33, 0xdd}, | 334 | {0xb3, 0x01, 0x01, 0xcc}, {0x00, 0x00, 0x33, 0xdd}, |
335 | {0xb0, 0x03, 0x19, 0xcc}, {0x00, 0x00, 0x33, 0xdd}, | 335 | {0xb0, 0x03, 0x19, 0xcc}, {0x00, 0x00, 0x33, 0xdd}, |
336 | {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x33, 0xdd}, | 336 | {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x33, 0xdd}, |
@@ -409,7 +409,7 @@ static __u8 mi1320_initVGA_data[][4] = { | |||
409 | {0xb3, 0x5c, 0x01, 0xcc}, {0xb3, 0x01, 0x41, 0xcc}, | 409 | {0xb3, 0x5c, 0x01, 0xcc}, {0xb3, 0x01, 0x41, 0xcc}, |
410 | {} | 410 | {} |
411 | }; | 411 | }; |
412 | static __u8 mi1320_initQVGA_data[][4] = { | 412 | static const __u8 mi1320_initQVGA_data[][4] = { |
413 | {0xb3, 0x01, 0x01, 0xcc}, {0x00, 0x00, 0x33, 0xdd}, | 413 | {0xb3, 0x01, 0x01, 0xcc}, {0x00, 0x00, 0x33, 0xdd}, |
414 | {0xb0, 0x03, 0x19, 0xcc}, {0x00, 0x00, 0x33, 0xdd}, | 414 | {0xb0, 0x03, 0x19, 0xcc}, {0x00, 0x00, 0x33, 0xdd}, |
415 | {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x33, 0xdd}, | 415 | {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x33, 0xdd}, |
@@ -478,15 +478,15 @@ static __u8 mi1320_initQVGA_data[][4] = { | |||
478 | {} | 478 | {} |
479 | }; | 479 | }; |
480 | 480 | ||
481 | static __u8 po3130_gamma[17] = { | 481 | static const __u8 po3130_gamma[17] = { |
482 | 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8, | 482 | 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8, |
483 | 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff | 483 | 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff |
484 | }; | 484 | }; |
485 | static __u8 po3130_matrix[9] = { | 485 | static const __u8 po3130_matrix[9] = { |
486 | 0x5f, 0xec, 0xf5, 0xf1, 0x5a, 0xf5, 0xf1, 0xec, 0x63 | 486 | 0x5f, 0xec, 0xf5, 0xf1, 0x5a, 0xf5, 0xf1, 0xec, 0x63 |
487 | }; | 487 | }; |
488 | 488 | ||
489 | static __u8 po3130_initVGA_data[][4] = { | 489 | static const __u8 po3130_initVGA_data[][4] = { |
490 | {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc}, | 490 | {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc}, |
491 | {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc}, | 491 | {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc}, |
492 | {0xb3, 0x00, 0x04, 0xcc}, {0xb3, 0x00, 0x24, 0xcc}, | 492 | {0xb3, 0x00, 0x04, 0xcc}, {0xb3, 0x00, 0x24, 0xcc}, |
@@ -569,7 +569,7 @@ static __u8 po3130_initVGA_data[][4] = { | |||
569 | {0xb3, 0x5c, 0x00, 0xcc}, {0xb3, 0x01, 0x41, 0xcc}, | 569 | {0xb3, 0x5c, 0x00, 0xcc}, {0xb3, 0x01, 0x41, 0xcc}, |
570 | {} | 570 | {} |
571 | }; | 571 | }; |
572 | static __u8 po3130_rundata[][4] = { | 572 | static const __u8 po3130_rundata[][4] = { |
573 | {0x00, 0x47, 0x45, 0xaa}, {0x00, 0x48, 0x9b, 0xaa}, | 573 | {0x00, 0x47, 0x45, 0xaa}, {0x00, 0x48, 0x9b, 0xaa}, |
574 | {0x00, 0x49, 0x3a, 0xaa}, {0x00, 0x4a, 0x01, 0xaa}, | 574 | {0x00, 0x49, 0x3a, 0xaa}, {0x00, 0x4a, 0x01, 0xaa}, |
575 | {0x00, 0x44, 0x40, 0xaa}, | 575 | {0x00, 0x44, 0x40, 0xaa}, |
@@ -584,7 +584,7 @@ static __u8 po3130_rundata[][4] = { | |||
584 | {} | 584 | {} |
585 | }; | 585 | }; |
586 | 586 | ||
587 | static __u8 po3130_initQVGA_data[][4] = { | 587 | static const __u8 po3130_initQVGA_data[][4] = { |
588 | {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc}, | 588 | {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc}, |
589 | {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x09, 0xcc}, | 589 | {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x09, 0xcc}, |
590 | {0xb3, 0x00, 0x04, 0xcc}, {0xb3, 0x00, 0x24, 0xcc}, | 590 | {0xb3, 0x00, 0x04, 0xcc}, {0xb3, 0x00, 0x24, 0xcc}, |
@@ -670,16 +670,16 @@ static __u8 po3130_initQVGA_data[][4] = { | |||
670 | {} | 670 | {} |
671 | }; | 671 | }; |
672 | 672 | ||
673 | static __u8 hv7131r_gamma[17] = { | 673 | static const __u8 hv7131r_gamma[17] = { |
674 | /* 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8, | 674 | /* 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8, |
675 | * 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff */ | 675 | * 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff */ |
676 | 0x04, 0x1a, 0x36, 0x55, 0x6f, 0x87, 0x9d, 0xb0, 0xc1, | 676 | 0x04, 0x1a, 0x36, 0x55, 0x6f, 0x87, 0x9d, 0xb0, 0xc1, |
677 | 0xcf, 0xda, 0xe4, 0xec, 0xf3, 0xf8, 0xfd, 0xff | 677 | 0xcf, 0xda, 0xe4, 0xec, 0xf3, 0xf8, 0xfd, 0xff |
678 | }; | 678 | }; |
679 | static __u8 hv7131r_matrix[9] = { | 679 | static const __u8 hv7131r_matrix[9] = { |
680 | 0x5f, 0xec, 0xf5, 0xf1, 0x5a, 0xf5, 0xf1, 0xec, 0x63 | 680 | 0x5f, 0xec, 0xf5, 0xf1, 0x5a, 0xf5, 0xf1, 0xec, 0x63 |
681 | }; | 681 | }; |
682 | static __u8 hv7131r_initVGA_data[][4] = { | 682 | static const __u8 hv7131r_initVGA_data[][4] = { |
683 | {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc}, | 683 | {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc}, |
684 | {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc}, | 684 | {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc}, |
685 | {0xb3, 0x00, 0x24, 0xcc}, | 685 | {0xb3, 0x00, 0x24, 0xcc}, |
@@ -722,7 +722,7 @@ static __u8 hv7131r_initVGA_data[][4] = { | |||
722 | {} | 722 | {} |
723 | }; | 723 | }; |
724 | 724 | ||
725 | static __u8 hv7131r_initQVGA_data[][4] = { | 725 | static const __u8 hv7131r_initQVGA_data[][4] = { |
726 | {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc}, | 726 | {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc}, |
727 | {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc}, | 727 | {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc}, |
728 | {0xb3, 0x00, 0x24, 0xcc}, | 728 | {0xb3, 0x00, 0x24, 0xcc}, |
@@ -777,14 +777,14 @@ static __u8 hv7131r_initQVGA_data[][4] = { | |||
777 | {} | 777 | {} |
778 | }; | 778 | }; |
779 | 779 | ||
780 | static __u8 ov7660_gamma[17] = { | 780 | static const __u8 ov7660_gamma[17] = { |
781 | 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8, | 781 | 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8, |
782 | 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff | 782 | 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff |
783 | }; | 783 | }; |
784 | static __u8 ov7660_matrix[9] = { | 784 | static const __u8 ov7660_matrix[9] = { |
785 | 0x5a, 0xf0, 0xf6, 0xf3, 0x57, 0xf6, 0xf3, 0xef, 0x62 | 785 | 0x5a, 0xf0, 0xf6, 0xf3, 0x57, 0xf6, 0xf3, 0xef, 0x62 |
786 | }; | 786 | }; |
787 | static __u8 ov7660_initVGA_data[][4] = { | 787 | static const __u8 ov7660_initVGA_data[][4] = { |
788 | {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc}, | 788 | {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc}, |
789 | {0x00, 0x00, 0x50, 0xdd}, | 789 | {0x00, 0x00, 0x50, 0xdd}, |
790 | {0xb0, 0x03, 0x01, 0xcc}, | 790 | {0xb0, 0x03, 0x01, 0xcc}, |
@@ -842,7 +842,7 @@ static __u8 ov7660_initVGA_data[][4] = { | |||
842 | {0x00, 0x29, 0x3c, 0xaa}, {0xb3, 0x01, 0x45, 0xcc}, | 842 | {0x00, 0x29, 0x3c, 0xaa}, {0xb3, 0x01, 0x45, 0xcc}, |
843 | {} | 843 | {} |
844 | }; | 844 | }; |
845 | static __u8 ov7660_initQVGA_data[][4] = { | 845 | static const __u8 ov7660_initQVGA_data[][4] = { |
846 | {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc}, | 846 | {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc}, |
847 | {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc}, | 847 | {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc}, |
848 | {0xb3, 0x00, 0x21, 0xcc}, {0xb3, 0x00, 0x26, 0xcc}, | 848 | {0xb3, 0x00, 0x21, 0xcc}, {0xb3, 0x00, 0x26, 0xcc}, |
@@ -911,26 +911,26 @@ static __u8 ov7660_initQVGA_data[][4] = { | |||
911 | {0x00, 0x00, 0x00, 0x00} | 911 | {0x00, 0x00, 0x00, 0x00} |
912 | }; | 912 | }; |
913 | 913 | ||
914 | static __u8 ov7660_50HZ[][4] = { | 914 | static const __u8 ov7660_50HZ[][4] = { |
915 | {0x00, 0x3b, 0x08, 0xaa}, | 915 | {0x00, 0x3b, 0x08, 0xaa}, |
916 | {0x00, 0x9d, 0x40, 0xaa}, | 916 | {0x00, 0x9d, 0x40, 0xaa}, |
917 | {0x00, 0x13, 0xa7, 0xaa}, | 917 | {0x00, 0x13, 0xa7, 0xaa}, |
918 | {0x00, 0x00, 0x00, 0x00} | 918 | {0x00, 0x00, 0x00, 0x00} |
919 | }; | 919 | }; |
920 | 920 | ||
921 | static __u8 ov7660_60HZ[][4] = { | 921 | static const __u8 ov7660_60HZ[][4] = { |
922 | {0x00, 0x3b, 0x00, 0xaa}, | 922 | {0x00, 0x3b, 0x00, 0xaa}, |
923 | {0x00, 0x9e, 0x40, 0xaa}, | 923 | {0x00, 0x9e, 0x40, 0xaa}, |
924 | {0x00, 0x13, 0xa7, 0xaa}, | 924 | {0x00, 0x13, 0xa7, 0xaa}, |
925 | {} | 925 | {} |
926 | }; | 926 | }; |
927 | 927 | ||
928 | static __u8 ov7660_NoFliker[][4] = { | 928 | static const __u8 ov7660_NoFliker[][4] = { |
929 | {0x00, 0x13, 0x87, 0xaa}, | 929 | {0x00, 0x13, 0x87, 0xaa}, |
930 | {} | 930 | {} |
931 | }; | 931 | }; |
932 | 932 | ||
933 | static __u8 ov7670_initVGA_JPG[][4] = { | 933 | static const __u8 ov7670_initVGA_JPG[][4] = { |
934 | {0xb3, 0x01, 0x05, 0xcc}, | 934 | {0xb3, 0x01, 0x05, 0xcc}, |
935 | {0x00, 0x00, 0x30, 0xdd}, {0xb0, 0x03, 0x19, 0xcc}, | 935 | {0x00, 0x00, 0x30, 0xdd}, {0xb0, 0x03, 0x19, 0xcc}, |
936 | {0x00, 0x00, 0x10, 0xdd}, | 936 | {0x00, 0x00, 0x10, 0xdd}, |
@@ -1058,7 +1058,7 @@ static __u8 ov7670_initVGA_JPG[][4] = { | |||
1058 | {}, | 1058 | {}, |
1059 | }; | 1059 | }; |
1060 | 1060 | ||
1061 | static __u8 ov7670_initQVGA_JPG[][4] = { | 1061 | static const __u8 ov7670_initQVGA_JPG[][4] = { |
1062 | {0xb3, 0x01, 0x05, 0xcc}, {0x00, 0x00, 0x30, 0xdd}, | 1062 | {0xb3, 0x01, 0x05, 0xcc}, {0x00, 0x00, 0x30, 0xdd}, |
1063 | {0xb0, 0x03, 0x19, 0xcc}, {0x00, 0x00, 0x10, 0xdd}, | 1063 | {0xb0, 0x03, 0x19, 0xcc}, {0x00, 0x00, 0x10, 0xdd}, |
1064 | {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x10, 0xdd}, | 1064 | {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x10, 0xdd}, |
@@ -1200,7 +1200,7 @@ struct sensor_info { | |||
1200 | __u8 op; | 1200 | __u8 op; |
1201 | }; | 1201 | }; |
1202 | 1202 | ||
1203 | static struct sensor_info sensor_info_data[] = { | 1203 | static const struct sensor_info sensor_info_data[] = { |
1204 | /* sensorId, I2cAdd, IdAdd, VpId, m1, m2, op */ | 1204 | /* sensorId, I2cAdd, IdAdd, VpId, m1, m2, op */ |
1205 | {SENSOR_HV7131R, 0x80 | 0x11, 0x00, 0x0209, 0x24, 0x25, 0x01}, | 1205 | {SENSOR_HV7131R, 0x80 | 0x11, 0x00, 0x0209, 0x24, 0x25, 0x01}, |
1206 | {SENSOR_OV7660, 0x80 | 0x21, 0x0a, 0x7660, 0x26, 0x26, 0x05}, | 1206 | {SENSOR_OV7660, 0x80 | 0x21, 0x0a, 0x7660, 0x26, 0x26, 0x05}, |
@@ -1282,7 +1282,7 @@ static int vc032x_probe_sensor(struct gspca_dev *gspca_dev) | |||
1282 | int i; | 1282 | int i; |
1283 | __u8 data; | 1283 | __u8 data; |
1284 | __u16 value; | 1284 | __u16 value; |
1285 | struct sensor_info *ptsensor_info; | 1285 | const struct sensor_info *ptsensor_info; |
1286 | 1286 | ||
1287 | reg_r(dev, 0xa1, 0xbfcf, &data, 1); | 1287 | reg_r(dev, 0xa1, 0xbfcf, &data, 1); |
1288 | PDEBUG(D_PROBE, "check sensor header %d", data); | 1288 | PDEBUG(D_PROBE, "check sensor header %d", data); |
@@ -1309,7 +1309,7 @@ static int vc032x_probe_sensor(struct gspca_dev *gspca_dev) | |||
1309 | } | 1309 | } |
1310 | 1310 | ||
1311 | static __u8 i2c_write(struct usb_device *dev, | 1311 | static __u8 i2c_write(struct usb_device *dev, |
1312 | __u8 reg, __u8 *val, __u8 size) | 1312 | __u8 reg, const __u8 *val, __u8 size) |
1313 | { | 1313 | { |
1314 | __u8 retbyte; | 1314 | __u8 retbyte; |
1315 | 1315 | ||
@@ -1341,7 +1341,7 @@ static __u8 i2c_write(struct usb_device *dev, | |||
1341 | } | 1341 | } |
1342 | 1342 | ||
1343 | static void put_tab_to_reg(struct gspca_dev *gspca_dev, | 1343 | static void put_tab_to_reg(struct gspca_dev *gspca_dev, |
1344 | __u8 *tab, __u8 tabsize, __u16 addr) | 1344 | const __u8 *tab, __u8 tabsize, __u16 addr) |
1345 | { | 1345 | { |
1346 | int j; | 1346 | int j; |
1347 | __u16 ad = addr; | 1347 | __u16 ad = addr; |
@@ -1351,7 +1351,7 @@ static void put_tab_to_reg(struct gspca_dev *gspca_dev, | |||
1351 | } | 1351 | } |
1352 | 1352 | ||
1353 | static void usb_exchange(struct gspca_dev *gspca_dev, | 1353 | static void usb_exchange(struct gspca_dev *gspca_dev, |
1354 | __u8 data[][4]) | 1354 | const __u8 data[][4]) |
1355 | { | 1355 | { |
1356 | struct usb_device *dev = gspca_dev->dev; | 1356 | struct usb_device *dev = gspca_dev->dev; |
1357 | int i = 0; | 1357 | int i = 0; |
@@ -1511,7 +1511,7 @@ static void setautogain(struct gspca_dev *gspca_dev) | |||
1511 | static void setlightfreq(struct gspca_dev *gspca_dev) | 1511 | static void setlightfreq(struct gspca_dev *gspca_dev) |
1512 | { | 1512 | { |
1513 | struct sd *sd = (struct sd *) gspca_dev; | 1513 | struct sd *sd = (struct sd *) gspca_dev; |
1514 | static __u8 (*ov7660_freq_tb[3])[4] = | 1514 | static const __u8 (*ov7660_freq_tb[3])[4] = |
1515 | {ov7660_NoFliker, ov7660_50HZ, ov7660_60HZ}; | 1515 | {ov7660_NoFliker, ov7660_50HZ, ov7660_60HZ}; |
1516 | 1516 | ||
1517 | if (sd->sensor != SENSOR_OV7660) | 1517 | if (sd->sensor != SENSOR_OV7660) |
@@ -1523,8 +1523,8 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
1523 | { | 1523 | { |
1524 | struct sd *sd = (struct sd *) gspca_dev; | 1524 | struct sd *sd = (struct sd *) gspca_dev; |
1525 | /* __u8 tmp2; */ | 1525 | /* __u8 tmp2; */ |
1526 | __u8 *GammaT = NULL; | 1526 | const __u8 *GammaT = NULL; |
1527 | __u8 *MatrixT = NULL; | 1527 | const __u8 *MatrixT = NULL; |
1528 | int mode; | 1528 | int mode; |
1529 | 1529 | ||
1530 | /* Assume start use the good resolution from gspca_dev->mode */ | 1530 | /* Assume start use the good resolution from gspca_dev->mode */ |
@@ -1673,7 +1673,7 @@ static void sd_close(struct gspca_dev *gspca_dev) | |||
1673 | 1673 | ||
1674 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 1674 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
1675 | struct gspca_frame *frame, /* target */ | 1675 | struct gspca_frame *frame, /* target */ |
1676 | unsigned char *data, /* isoc packet */ | 1676 | __u8 *data, /* isoc packet */ |
1677 | int len) /* iso pkt length */ | 1677 | int len) /* iso pkt length */ |
1678 | { | 1678 | { |
1679 | struct sd *sd = (struct sd *) gspca_dev; | 1679 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -1739,13 +1739,13 @@ static int sd_querymenu(struct gspca_dev *gspca_dev, | |||
1739 | case V4L2_CID_POWER_LINE_FREQUENCY: | 1739 | case V4L2_CID_POWER_LINE_FREQUENCY: |
1740 | switch (menu->index) { | 1740 | switch (menu->index) { |
1741 | case 0: /* V4L2_CID_POWER_LINE_FREQUENCY_DISABLED */ | 1741 | case 0: /* V4L2_CID_POWER_LINE_FREQUENCY_DISABLED */ |
1742 | strcpy(menu->name, "NoFliker"); | 1742 | strcpy((char *) menu->name, "NoFliker"); |
1743 | return 0; | 1743 | return 0; |
1744 | case 1: /* V4L2_CID_POWER_LINE_FREQUENCY_50HZ */ | 1744 | case 1: /* V4L2_CID_POWER_LINE_FREQUENCY_50HZ */ |
1745 | strcpy(menu->name, "50 Hz"); | 1745 | strcpy((char *) menu->name, "50 Hz"); |
1746 | return 0; | 1746 | return 0; |
1747 | case 2: /* V4L2_CID_POWER_LINE_FREQUENCY_60HZ */ | 1747 | case 2: /* V4L2_CID_POWER_LINE_FREQUENCY_60HZ */ |
1748 | strcpy(menu->name, "60 Hz"); | 1748 | strcpy((char *) menu->name, "60 Hz"); |
1749 | return 0; | 1749 | return 0; |
1750 | } | 1750 | } |
1751 | break; | 1751 | break; |
@@ -1754,7 +1754,7 @@ static int sd_querymenu(struct gspca_dev *gspca_dev, | |||
1754 | } | 1754 | } |
1755 | 1755 | ||
1756 | /* sub-driver description */ | 1756 | /* sub-driver description */ |
1757 | static struct sd_desc sd_desc = { | 1757 | static const struct sd_desc sd_desc = { |
1758 | .name = MODULE_NAME, | 1758 | .name = MODULE_NAME, |
1759 | .ctrls = sd_ctrls, | 1759 | .ctrls = sd_ctrls, |
1760 | .nctrls = ARRAY_SIZE(sd_ctrls), | 1760 | .nctrls = ARRAY_SIZE(sd_ctrls), |
@@ -1770,7 +1770,7 @@ static struct sd_desc sd_desc = { | |||
1770 | 1770 | ||
1771 | /* -- module initialisation -- */ | 1771 | /* -- module initialisation -- */ |
1772 | #define DVNM(name) .driver_info = (kernel_ulong_t) name | 1772 | #define DVNM(name) .driver_info = (kernel_ulong_t) name |
1773 | static __devinitdata struct usb_device_id device_table[] = { | 1773 | static const __devinitdata struct usb_device_id device_table[] = { |
1774 | {USB_DEVICE(0x046d, 0x0892), DVNM("Logitech Orbicam")}, | 1774 | {USB_DEVICE(0x046d, 0x0892), DVNM("Logitech Orbicam")}, |
1775 | {USB_DEVICE(0x046d, 0x0896), DVNM("Logitech Orbicam")}, | 1775 | {USB_DEVICE(0x046d, 0x0896), DVNM("Logitech Orbicam")}, |
1776 | {USB_DEVICE(0x0ac8, 0x0321), DVNM("Vimicro generic vc0321")}, | 1776 | {USB_DEVICE(0x0ac8, 0x0321), DVNM("Vimicro generic vc0321")}, |
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c index ccd24cb92b3f..878344e4d2ec 100644 --- a/drivers/media/video/gspca/zc3xx.c +++ b/drivers/media/video/gspca/zc3xx.c | |||
@@ -24,8 +24,8 @@ | |||
24 | 24 | ||
25 | #include "gspca.h" | 25 | #include "gspca.h" |
26 | 26 | ||
27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 0) | 27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4) |
28 | static const char version[] = "2.1.0"; | 28 | static const char version[] = "2.1.4"; |
29 | 29 | ||
30 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>, " | 30 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>, " |
31 | "Serge A. Suchkov <Serge.A.S@tochka.ru>"); | 31 | "Serge A. Suchkov <Serge.A.S@tochka.ru>"); |
@@ -190,7 +190,7 @@ struct usb_action { | |||
190 | __u16 idx; | 190 | __u16 idx; |
191 | }; | 191 | }; |
192 | 192 | ||
193 | static struct usb_action cs2102_Initial[] = { | 193 | static const struct usb_action cs2102_Initial[] = { |
194 | {0xa1, 0x01, 0x0008}, | 194 | {0xa1, 0x01, 0x0008}, |
195 | {0xa1, 0x01, 0x0008}, | 195 | {0xa1, 0x01, 0x0008}, |
196 | {0xa0, 0x01, 0x0000}, | 196 | {0xa0, 0x01, 0x0000}, |
@@ -320,7 +320,7 @@ static struct usb_action cs2102_Initial[] = { | |||
320 | {} | 320 | {} |
321 | }; | 321 | }; |
322 | 322 | ||
323 | static struct usb_action cs2102_InitialScale[] = { | 323 | static const struct usb_action cs2102_InitialScale[] = { |
324 | {0xa1, 0x01, 0x0008}, | 324 | {0xa1, 0x01, 0x0008}, |
325 | {0xa1, 0x01, 0x0008}, | 325 | {0xa1, 0x01, 0x0008}, |
326 | {0xa0, 0x01, 0x0000}, | 326 | {0xa0, 0x01, 0x0000}, |
@@ -449,7 +449,7 @@ static struct usb_action cs2102_InitialScale[] = { | |||
449 | {0xa0, 0x40, 0x0118}, | 449 | {0xa0, 0x40, 0x0118}, |
450 | {} | 450 | {} |
451 | }; | 451 | }; |
452 | static struct usb_action cs2102_50HZ[] = { | 452 | static const struct usb_action cs2102_50HZ[] = { |
453 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 453 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
454 | {0xaa, 0x0f, 0x008c}, /* 00,0f,8c,aa */ | 454 | {0xaa, 0x0f, 0x008c}, /* 00,0f,8c,aa */ |
455 | {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */ | 455 | {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */ |
@@ -474,7 +474,7 @@ static struct usb_action cs2102_50HZ[] = { | |||
474 | {0xa0, 0xd0, 0x001f}, /* 00,1f,d0,cc */ | 474 | {0xa0, 0xd0, 0x001f}, /* 00,1f,d0,cc */ |
475 | {} | 475 | {} |
476 | }; | 476 | }; |
477 | static struct usb_action cs2102_50HZScale[] = { | 477 | static const struct usb_action cs2102_50HZScale[] = { |
478 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 478 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
479 | {0xaa, 0x0f, 0x0093}, /* 00,0f,93,aa */ | 479 | {0xaa, 0x0f, 0x0093}, /* 00,0f,93,aa */ |
480 | {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */ | 480 | {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */ |
@@ -499,7 +499,7 @@ static struct usb_action cs2102_50HZScale[] = { | |||
499 | {0xa0, 0xd0, 0x001f}, /* 00,1f,d0,cc */ | 499 | {0xa0, 0xd0, 0x001f}, /* 00,1f,d0,cc */ |
500 | {} | 500 | {} |
501 | }; | 501 | }; |
502 | static struct usb_action cs2102_60HZ[] = { | 502 | static const struct usb_action cs2102_60HZ[] = { |
503 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 503 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
504 | {0xaa, 0x0f, 0x005d}, /* 00,0f,5d,aa */ | 504 | {0xaa, 0x0f, 0x005d}, /* 00,0f,5d,aa */ |
505 | {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */ | 505 | {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */ |
@@ -524,7 +524,7 @@ static struct usb_action cs2102_60HZ[] = { | |||
524 | {0xa0, 0xd0, 0x00c8}, /* 00,c8,d0,cc */ | 524 | {0xa0, 0xd0, 0x00c8}, /* 00,c8,d0,cc */ |
525 | {} | 525 | {} |
526 | }; | 526 | }; |
527 | static struct usb_action cs2102_60HZScale[] = { | 527 | static const struct usb_action cs2102_60HZScale[] = { |
528 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 528 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
529 | {0xaa, 0x0f, 0x00b7}, /* 00,0f,b7,aa */ | 529 | {0xaa, 0x0f, 0x00b7}, /* 00,0f,b7,aa */ |
530 | {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */ | 530 | {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */ |
@@ -549,7 +549,7 @@ static struct usb_action cs2102_60HZScale[] = { | |||
549 | {0xa0, 0xe8, 0x001f}, /* 00,1f,e8,cc */ | 549 | {0xa0, 0xe8, 0x001f}, /* 00,1f,e8,cc */ |
550 | {} | 550 | {} |
551 | }; | 551 | }; |
552 | static struct usb_action cs2102_NoFliker[] = { | 552 | static const struct usb_action cs2102_NoFliker[] = { |
553 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 553 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
554 | {0xaa, 0x0f, 0x0059}, /* 00,0f,59,aa */ | 554 | {0xaa, 0x0f, 0x0059}, /* 00,0f,59,aa */ |
555 | {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */ | 555 | {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */ |
@@ -574,7 +574,7 @@ static struct usb_action cs2102_NoFliker[] = { | |||
574 | {0xa0, 0xc8, 0x001f}, /* 00,1f,c8,cc */ | 574 | {0xa0, 0xc8, 0x001f}, /* 00,1f,c8,cc */ |
575 | {} | 575 | {} |
576 | }; | 576 | }; |
577 | static struct usb_action cs2102_NoFlikerScale[] = { | 577 | static const struct usb_action cs2102_NoFlikerScale[] = { |
578 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 578 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
579 | {0xaa, 0x0f, 0x0059}, /* 00,0f,59,aa */ | 579 | {0xaa, 0x0f, 0x0059}, /* 00,0f,59,aa */ |
580 | {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */ | 580 | {0xaa, 0x03, 0x0005}, /* 00,03,05,aa */ |
@@ -601,7 +601,7 @@ static struct usb_action cs2102_NoFlikerScale[] = { | |||
601 | }; | 601 | }; |
602 | 602 | ||
603 | /* CS2102_KOCOM */ | 603 | /* CS2102_KOCOM */ |
604 | static struct usb_action cs2102K_Initial[] = { | 604 | static const struct usb_action cs2102K_Initial[] = { |
605 | {0xa0, 0x11, 0x0002}, | 605 | {0xa0, 0x11, 0x0002}, |
606 | {0xa0, 0x03, 0x0008}, | 606 | {0xa0, 0x03, 0x0008}, |
607 | {0xa0, 0x08, 0x0010}, | 607 | {0xa0, 0x08, 0x0010}, |
@@ -860,7 +860,7 @@ static struct usb_action cs2102K_Initial[] = { | |||
860 | {} | 860 | {} |
861 | }; | 861 | }; |
862 | 862 | ||
863 | static struct usb_action cs2102K_InitialScale[] = { | 863 | static const struct usb_action cs2102K_InitialScale[] = { |
864 | {0xa0, 0x11, 0x0002}, | 864 | {0xa0, 0x11, 0x0002}, |
865 | {0xa0, 0x00, 0x0002}, | 865 | {0xa0, 0x00, 0x0002}, |
866 | {0xa0, 0x03, 0x0008}, | 866 | {0xa0, 0x03, 0x0008}, |
@@ -1437,7 +1437,7 @@ static struct usb_action cs2102K_InitialScale[] = { | |||
1437 | {} | 1437 | {} |
1438 | }; | 1438 | }; |
1439 | 1439 | ||
1440 | static struct usb_action gc0305_Initial[] = { /* 640x480 */ | 1440 | static const struct usb_action gc0305_Initial[] = { /* 640x480 */ |
1441 | {0xa0, 0x01, 0x0000}, /* 00,00,01,cc */ | 1441 | {0xa0, 0x01, 0x0000}, /* 00,00,01,cc */ |
1442 | {0xa0, 0x03, 0x0008}, /* 00,08,03,cc */ | 1442 | {0xa0, 0x03, 0x0008}, /* 00,08,03,cc */ |
1443 | {0xa0, 0x01, 0x0010}, /* 00,10,01,cc */ | 1443 | {0xa0, 0x01, 0x0010}, /* 00,10,01,cc */ |
@@ -1501,7 +1501,7 @@ static struct usb_action gc0305_Initial[] = { /* 640x480 */ | |||
1501 | {0xa0, 0x03, 0x0113}, /* 01,13,03,cc */ | 1501 | {0xa0, 0x03, 0x0113}, /* 01,13,03,cc */ |
1502 | {} | 1502 | {} |
1503 | }; | 1503 | }; |
1504 | static struct usb_action gc0305_InitialScale[] = { /* 320x240 */ | 1504 | static const struct usb_action gc0305_InitialScale[] = { /* 320x240 */ |
1505 | {0xa0, 0x01, 0x0000}, /* 00,00,01,cc */ | 1505 | {0xa0, 0x01, 0x0000}, /* 00,00,01,cc */ |
1506 | {0xa0, 0x03, 0x0008}, /* 00,08,03,cc */ | 1506 | {0xa0, 0x03, 0x0008}, /* 00,08,03,cc */ |
1507 | {0xa0, 0x01, 0x0010}, /* 00,10,01,cc */ | 1507 | {0xa0, 0x01, 0x0010}, /* 00,10,01,cc */ |
@@ -1564,7 +1564,7 @@ static struct usb_action gc0305_InitialScale[] = { /* 320x240 */ | |||
1564 | {0xa0, 0x03, 0x0113}, /* 01,13,03,cc */ | 1564 | {0xa0, 0x03, 0x0113}, /* 01,13,03,cc */ |
1565 | {} | 1565 | {} |
1566 | }; | 1566 | }; |
1567 | static struct usb_action gc0305_50HZ[] = { | 1567 | static const struct usb_action gc0305_50HZ[] = { |
1568 | {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */ | 1568 | {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */ |
1569 | {0xaa, 0x83, 0x0002}, /* 00,83,02,aa */ | 1569 | {0xaa, 0x83, 0x0002}, /* 00,83,02,aa */ |
1570 | {0xaa, 0x84, 0x0038}, /* 00,84,38,aa */ /* win: 00,84,ec */ | 1570 | {0xaa, 0x84, 0x0038}, /* 00,84,38,aa */ /* win: 00,84,ec */ |
@@ -1587,7 +1587,7 @@ static struct usb_action gc0305_50HZ[] = { | |||
1587 | /* {0xa0, 0x85, 0x018d}, * 01,8d,85,cc * * if 640x480 */ | 1587 | /* {0xa0, 0x85, 0x018d}, * 01,8d,85,cc * * if 640x480 */ |
1588 | {} | 1588 | {} |
1589 | }; | 1589 | }; |
1590 | static struct usb_action gc0305_60HZ[] = { | 1590 | static const struct usb_action gc0305_60HZ[] = { |
1591 | {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */ | 1591 | {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */ |
1592 | {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */ | 1592 | {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */ |
1593 | {0xaa, 0x84, 0x00ec}, /* 00,84,ec,aa */ | 1593 | {0xaa, 0x84, 0x00ec}, /* 00,84,ec,aa */ |
@@ -1611,7 +1611,7 @@ static struct usb_action gc0305_60HZ[] = { | |||
1611 | {} | 1611 | {} |
1612 | }; | 1612 | }; |
1613 | 1613 | ||
1614 | static struct usb_action gc0305_NoFliker[] = { | 1614 | static const struct usb_action gc0305_NoFliker[] = { |
1615 | {0xa0, 0x0c, 0x0100}, /* 01,00,0c,cc */ | 1615 | {0xa0, 0x0c, 0x0100}, /* 01,00,0c,cc */ |
1616 | {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */ | 1616 | {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */ |
1617 | {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */ | 1617 | {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */ |
@@ -1635,7 +1635,7 @@ static struct usb_action gc0305_NoFliker[] = { | |||
1635 | }; | 1635 | }; |
1636 | 1636 | ||
1637 | /* play poker with registers at your own risk !! */ | 1637 | /* play poker with registers at your own risk !! */ |
1638 | static struct usb_action hdcs2020xx_Initial[] = { | 1638 | static const struct usb_action hdcs2020xx_Initial[] = { |
1639 | {0xa0, 0x01, 0x0000}, | 1639 | {0xa0, 0x01, 0x0000}, |
1640 | {0xa0, 0x03, 0x0008}, | 1640 | {0xa0, 0x03, 0x0008}, |
1641 | {0xa0, 0x0e, 0x0010}, | 1641 | {0xa0, 0x0e, 0x0010}, |
@@ -1780,7 +1780,7 @@ static struct usb_action hdcs2020xx_Initial[] = { | |||
1780 | {} | 1780 | {} |
1781 | }; | 1781 | }; |
1782 | 1782 | ||
1783 | static struct usb_action hdcs2020xx_InitialScale[] = { | 1783 | static const struct usb_action hdcs2020xx_InitialScale[] = { |
1784 | {0xa0, 0x01, 0x0000}, | 1784 | {0xa0, 0x01, 0x0000}, |
1785 | {0xa0, 0x03, 0x0008}, | 1785 | {0xa0, 0x03, 0x0008}, |
1786 | {0xa0, 0x0e, 0x0010}, | 1786 | {0xa0, 0x0e, 0x0010}, |
@@ -1922,7 +1922,7 @@ static struct usb_action hdcs2020xx_InitialScale[] = { | |||
1922 | /* {0xa0, 0x18, 0x00fe}, */ | 1922 | /* {0xa0, 0x18, 0x00fe}, */ |
1923 | {} | 1923 | {} |
1924 | }; | 1924 | }; |
1925 | static struct usb_action hdcs2020xb_Initial[] = { | 1925 | static const struct usb_action hdcs2020xb_Initial[] = { |
1926 | {0xa0, 0x01, 0x0000}, | 1926 | {0xa0, 0x01, 0x0000}, |
1927 | {0xa0, 0x11, 0x0002}, | 1927 | {0xa0, 0x11, 0x0002}, |
1928 | {0xa0, 0x03, 0x0008}, /* qtable 0x05 */ | 1928 | {0xa0, 0x03, 0x0008}, /* qtable 0x05 */ |
@@ -2054,7 +2054,7 @@ static struct usb_action hdcs2020xb_Initial[] = { | |||
2054 | {0xa0, 0x40, 0x0118}, | 2054 | {0xa0, 0x40, 0x0118}, |
2055 | {} | 2055 | {} |
2056 | }; | 2056 | }; |
2057 | static struct usb_action hdcs2020xb_InitialScale[] = { | 2057 | static const struct usb_action hdcs2020xb_InitialScale[] = { |
2058 | {0xa0, 0x01, 0x0000}, | 2058 | {0xa0, 0x01, 0x0000}, |
2059 | {0xa0, 0x00, 0x0002}, | 2059 | {0xa0, 0x00, 0x0002}, |
2060 | {0xa0, 0x03, 0x0008}, | 2060 | {0xa0, 0x03, 0x0008}, |
@@ -2182,7 +2182,7 @@ static struct usb_action hdcs2020xb_InitialScale[] = { | |||
2182 | {0xa0, 0x40, 0x0118}, | 2182 | {0xa0, 0x40, 0x0118}, |
2183 | {} | 2183 | {} |
2184 | }; | 2184 | }; |
2185 | static struct usb_action hdcs2020b_50HZ[] = { | 2185 | static const struct usb_action hdcs2020b_50HZ[] = { |
2186 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 2186 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
2187 | {0xaa, 0x13, 0x0018}, /* 00,13,18,aa */ | 2187 | {0xaa, 0x13, 0x0018}, /* 00,13,18,aa */ |
2188 | {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */ | 2188 | {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */ |
@@ -2203,7 +2203,7 @@ static struct usb_action hdcs2020b_50HZ[] = { | |||
2203 | {0xa0, 0x2f, 0x001f}, /* 00,1f,2f,cc */ | 2203 | {0xa0, 0x2f, 0x001f}, /* 00,1f,2f,cc */ |
2204 | {} | 2204 | {} |
2205 | }; | 2205 | }; |
2206 | static struct usb_action hdcs2020b_60HZ[] = { | 2206 | static const struct usb_action hdcs2020b_60HZ[] = { |
2207 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 2207 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
2208 | {0xaa, 0x13, 0x0031}, /* 00,13,31,aa */ | 2208 | {0xaa, 0x13, 0x0031}, /* 00,13,31,aa */ |
2209 | {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */ | 2209 | {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */ |
@@ -2224,7 +2224,7 @@ static struct usb_action hdcs2020b_60HZ[] = { | |||
2224 | {0xa0, 0x2c, 0x001f}, /* 00,1f,2c,cc */ | 2224 | {0xa0, 0x2c, 0x001f}, /* 00,1f,2c,cc */ |
2225 | {} | 2225 | {} |
2226 | }; | 2226 | }; |
2227 | static struct usb_action hdcs2020b_NoFliker[] = { | 2227 | static const struct usb_action hdcs2020b_NoFliker[] = { |
2228 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 2228 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
2229 | {0xaa, 0x13, 0x0010}, /* 00,13,10,aa */ | 2229 | {0xaa, 0x13, 0x0010}, /* 00,13,10,aa */ |
2230 | {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */ | 2230 | {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */ |
@@ -2246,7 +2246,7 @@ static struct usb_action hdcs2020b_NoFliker[] = { | |||
2246 | {} | 2246 | {} |
2247 | }; | 2247 | }; |
2248 | 2248 | ||
2249 | static struct usb_action hv7131bxx_Initial[] = { | 2249 | static const struct usb_action hv7131bxx_Initial[] = { |
2250 | {0xa0, 0x01, 0x0000}, | 2250 | {0xa0, 0x01, 0x0000}, |
2251 | {0xa0, 0x10, 0x0002}, | 2251 | {0xa0, 0x10, 0x0002}, |
2252 | {0xa0, 0x00, 0x0010}, | 2252 | {0xa0, 0x00, 0x0010}, |
@@ -2354,7 +2354,7 @@ static struct usb_action hv7131bxx_Initial[] = { | |||
2354 | {} | 2354 | {} |
2355 | }; | 2355 | }; |
2356 | 2356 | ||
2357 | static struct usb_action hv7131bxx_InitialScale[] = { | 2357 | static const struct usb_action hv7131bxx_InitialScale[] = { |
2358 | {0xa0, 0x01, 0x0000}, | 2358 | {0xa0, 0x01, 0x0000}, |
2359 | {0xa0, 0x00, 0x0002}, | 2359 | {0xa0, 0x00, 0x0002}, |
2360 | {0xa0, 0x00, 0x0010}, | 2360 | {0xa0, 0x00, 0x0010}, |
@@ -2460,7 +2460,7 @@ static struct usb_action hv7131bxx_InitialScale[] = { | |||
2460 | {} | 2460 | {} |
2461 | }; | 2461 | }; |
2462 | 2462 | ||
2463 | static struct usb_action hv7131cxx_Initial[] = { | 2463 | static const struct usb_action hv7131cxx_Initial[] = { |
2464 | {0xa0, 0x01, 0x0000}, | 2464 | {0xa0, 0x01, 0x0000}, |
2465 | {0xa0, 0x10, 0x0002}, | 2465 | {0xa0, 0x10, 0x0002}, |
2466 | {0xa0, 0x01, 0x0010}, | 2466 | {0xa0, 0x01, 0x0010}, |
@@ -2554,7 +2554,7 @@ static struct usb_action hv7131cxx_Initial[] = { | |||
2554 | {} | 2554 | {} |
2555 | }; | 2555 | }; |
2556 | 2556 | ||
2557 | static struct usb_action hv7131cxx_InitialScale[] = { | 2557 | static const struct usb_action hv7131cxx_InitialScale[] = { |
2558 | {0xa0, 0x01, 0x0000}, | 2558 | {0xa0, 0x01, 0x0000}, |
2559 | 2559 | ||
2560 | {0xa0, 0x00, 0x0002}, /* diff */ | 2560 | {0xa0, 0x00, 0x0002}, /* diff */ |
@@ -2655,7 +2655,7 @@ static struct usb_action hv7131cxx_InitialScale[] = { | |||
2655 | {} | 2655 | {} |
2656 | }; | 2656 | }; |
2657 | 2657 | ||
2658 | static struct usb_action icm105axx_Initial[] = { | 2658 | static const struct usb_action icm105axx_Initial[] = { |
2659 | {0xa0, 0x01, 0x0000}, | 2659 | {0xa0, 0x01, 0x0000}, |
2660 | {0xa0, 0x10, 0x0002}, | 2660 | {0xa0, 0x10, 0x0002}, |
2661 | {0xa0, 0x03, 0x0008}, | 2661 | {0xa0, 0x03, 0x0008}, |
@@ -2832,7 +2832,7 @@ static struct usb_action icm105axx_Initial[] = { | |||
2832 | {} | 2832 | {} |
2833 | }; | 2833 | }; |
2834 | 2834 | ||
2835 | static struct usb_action icm105axx_InitialScale[] = { | 2835 | static const struct usb_action icm105axx_InitialScale[] = { |
2836 | {0xa0, 0x01, 0x0000}, | 2836 | {0xa0, 0x01, 0x0000}, |
2837 | {0xa0, 0x00, 0x0002}, | 2837 | {0xa0, 0x00, 0x0002}, |
2838 | {0xa0, 0x03, 0x0008}, | 2838 | {0xa0, 0x03, 0x0008}, |
@@ -3011,7 +3011,7 @@ static struct usb_action icm105axx_InitialScale[] = { | |||
3011 | {0xa0, 0x40, 0x0118}, | 3011 | {0xa0, 0x40, 0x0118}, |
3012 | {} | 3012 | {} |
3013 | }; | 3013 | }; |
3014 | static struct usb_action icm105a_50HZ[] = { | 3014 | static const struct usb_action icm105a_50HZ[] = { |
3015 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 3015 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
3016 | {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */ | 3016 | {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */ |
3017 | {0xaa, 0x0c, 0x0020}, /* 00,0c,20,aa */ | 3017 | {0xaa, 0x0c, 0x0020}, /* 00,0c,20,aa */ |
@@ -3042,7 +3042,7 @@ static struct usb_action icm105a_50HZ[] = { | |||
3042 | {0xa0, 0xff, 0x0020}, /* 00,20,ff,cc */ | 3042 | {0xa0, 0xff, 0x0020}, /* 00,20,ff,cc */ |
3043 | {} | 3043 | {} |
3044 | }; | 3044 | }; |
3045 | static struct usb_action icm105a_50HZScale[] = { | 3045 | static const struct usb_action icm105a_50HZScale[] = { |
3046 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 3046 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
3047 | {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */ | 3047 | {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */ |
3048 | {0xaa, 0x0c, 0x008c}, /* 00,0c,8c,aa */ | 3048 | {0xaa, 0x0c, 0x008c}, /* 00,0c,8c,aa */ |
@@ -3075,7 +3075,7 @@ static struct usb_action icm105a_50HZScale[] = { | |||
3075 | {0xa0, 0xc0, 0x01a8}, /* 01,a8,c0,cc */ | 3075 | {0xa0, 0xc0, 0x01a8}, /* 01,a8,c0,cc */ |
3076 | {} | 3076 | {} |
3077 | }; | 3077 | }; |
3078 | static struct usb_action icm105a_60HZ[] = { | 3078 | static const struct usb_action icm105a_60HZ[] = { |
3079 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 3079 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
3080 | {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */ | 3080 | {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */ |
3081 | {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */ | 3081 | {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */ |
@@ -3106,7 +3106,7 @@ static struct usb_action icm105a_60HZ[] = { | |||
3106 | {0xa0, 0xff, 0x0020}, /* 00,20,ff,cc */ | 3106 | {0xa0, 0xff, 0x0020}, /* 00,20,ff,cc */ |
3107 | {} | 3107 | {} |
3108 | }; | 3108 | }; |
3109 | static struct usb_action icm105a_60HZScale[] = { | 3109 | static const struct usb_action icm105a_60HZScale[] = { |
3110 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 3110 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
3111 | {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */ | 3111 | {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */ |
3112 | {0xaa, 0x0c, 0x0008}, /* 00,0c,08,aa */ | 3112 | {0xaa, 0x0c, 0x0008}, /* 00,0c,08,aa */ |
@@ -3139,7 +3139,7 @@ static struct usb_action icm105a_60HZScale[] = { | |||
3139 | {0xa0, 0xc0, 0x01a8}, /* 01,a8,c0,cc */ | 3139 | {0xa0, 0xc0, 0x01a8}, /* 01,a8,c0,cc */ |
3140 | {} | 3140 | {} |
3141 | }; | 3141 | }; |
3142 | static struct usb_action icm105a_NoFliker[] = { | 3142 | static const struct usb_action icm105a_NoFliker[] = { |
3143 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 3143 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
3144 | {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */ | 3144 | {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */ |
3145 | {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */ | 3145 | {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */ |
@@ -3170,7 +3170,7 @@ static struct usb_action icm105a_NoFliker[] = { | |||
3170 | {0xa0, 0xff, 0x0020}, /* 00,20,ff,cc */ | 3170 | {0xa0, 0xff, 0x0020}, /* 00,20,ff,cc */ |
3171 | {} | 3171 | {} |
3172 | }; | 3172 | }; |
3173 | static struct usb_action icm105a_NoFlikerScale[] = { | 3173 | static const struct usb_action icm105a_NoFlikerScale[] = { |
3174 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 3174 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
3175 | {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */ | 3175 | {0xaa, 0x0d, 0x0003}, /* 00,0d,03,aa */ |
3176 | {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */ | 3176 | {0xaa, 0x0c, 0x0004}, /* 00,0c,04,aa */ |
@@ -3204,7 +3204,7 @@ static struct usb_action icm105a_NoFlikerScale[] = { | |||
3204 | {} | 3204 | {} |
3205 | }; | 3205 | }; |
3206 | 3206 | ||
3207 | static struct usb_action MC501CB_InitialScale[] = { | 3207 | static const struct usb_action MC501CB_InitialScale[] = { |
3208 | {0xa0, 0x01, 0x0000}, /* 00,00,01,cc */ | 3208 | {0xa0, 0x01, 0x0000}, /* 00,00,01,cc */ |
3209 | {0xa0, 0x00, 0x0002}, /* 00,02,00,cc */ | 3209 | {0xa0, 0x00, 0x0002}, /* 00,02,00,cc */ |
3210 | {0xa0, 0x01, 0x0010}, /* 00,10,01,cc */ | 3210 | {0xa0, 0x01, 0x0010}, /* 00,10,01,cc */ |
@@ -3324,7 +3324,7 @@ static struct usb_action MC501CB_InitialScale[] = { | |||
3324 | {} | 3324 | {} |
3325 | }; | 3325 | }; |
3326 | 3326 | ||
3327 | static struct usb_action MC501CB_Initial[] = { /* 320x240 */ | 3327 | static const struct usb_action MC501CB_Initial[] = { /* 320x240 */ |
3328 | {0xa0, 0x01, 0x0000}, /* 00,00,01,cc */ | 3328 | {0xa0, 0x01, 0x0000}, /* 00,00,01,cc */ |
3329 | {0xa0, 0x10, 0x0002}, /* 00,02,10,cc */ | 3329 | {0xa0, 0x10, 0x0002}, /* 00,02,10,cc */ |
3330 | {0xa0, 0x01, 0x0010}, /* 00,10,01,cc */ | 3330 | {0xa0, 0x01, 0x0010}, /* 00,10,01,cc */ |
@@ -3443,7 +3443,7 @@ static struct usb_action MC501CB_Initial[] = { /* 320x240 */ | |||
3443 | {} | 3443 | {} |
3444 | }; | 3444 | }; |
3445 | 3445 | ||
3446 | static struct usb_action MC501CB_50HZ[] = { | 3446 | static const struct usb_action MC501CB_50HZ[] = { |
3447 | {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */ | 3447 | {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */ |
3448 | {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */ | 3448 | {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */ |
3449 | {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */ | 3449 | {0xaa, 0x36, 0x001d}, /* 00,36,1D,aa */ |
@@ -3460,7 +3460,7 @@ static struct usb_action MC501CB_50HZ[] = { | |||
3460 | {} | 3460 | {} |
3461 | }; | 3461 | }; |
3462 | 3462 | ||
3463 | static struct usb_action MC501CB_50HZScale[] = { | 3463 | static const struct usb_action MC501CB_50HZScale[] = { |
3464 | {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */ | 3464 | {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */ |
3465 | {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */ | 3465 | {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */ |
3466 | {0xaa, 0x36, 0x003a}, /* 00,36,3A,aa */ | 3466 | {0xaa, 0x36, 0x003a}, /* 00,36,3A,aa */ |
@@ -3477,7 +3477,7 @@ static struct usb_action MC501CB_50HZScale[] = { | |||
3477 | {} | 3477 | {} |
3478 | }; | 3478 | }; |
3479 | 3479 | ||
3480 | static struct usb_action MC501CB_60HZ[] = { | 3480 | static const struct usb_action MC501CB_60HZ[] = { |
3481 | {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */ | 3481 | {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */ |
3482 | {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */ | 3482 | {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */ |
3483 | {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */ | 3483 | {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */ |
@@ -3494,7 +3494,7 @@ static struct usb_action MC501CB_60HZ[] = { | |||
3494 | {} | 3494 | {} |
3495 | }; | 3495 | }; |
3496 | 3496 | ||
3497 | static struct usb_action MC501CB_60HZScale[] = { | 3497 | static const struct usb_action MC501CB_60HZScale[] = { |
3498 | {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */ | 3498 | {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */ |
3499 | {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */ | 3499 | {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */ |
3500 | {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */ | 3500 | {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */ |
@@ -3511,7 +3511,7 @@ static struct usb_action MC501CB_60HZScale[] = { | |||
3511 | {} | 3511 | {} |
3512 | }; | 3512 | }; |
3513 | 3513 | ||
3514 | static struct usb_action MC501CB_NoFliker[] = { | 3514 | static const struct usb_action MC501CB_NoFliker[] = { |
3515 | {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */ | 3515 | {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */ |
3516 | {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */ | 3516 | {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */ |
3517 | {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */ | 3517 | {0xaa, 0x36, 0x0018}, /* 00,36,18,aa */ |
@@ -3528,7 +3528,7 @@ static struct usb_action MC501CB_NoFliker[] = { | |||
3528 | {} | 3528 | {} |
3529 | }; | 3529 | }; |
3530 | 3530 | ||
3531 | static struct usb_action MC501CB_NoFlikerScale[] = { | 3531 | static const struct usb_action MC501CB_NoFlikerScale[] = { |
3532 | {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */ | 3532 | {0xaa, 0x03, 0x0003}, /* 00,03,03,aa */ |
3533 | {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */ | 3533 | {0xaa, 0x10, 0x00fc}, /* 00,10,fc,aa */ |
3534 | {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */ | 3534 | {0xaa, 0x36, 0x0030}, /* 00,36,30,aa */ |
@@ -3541,7 +3541,7 @@ static struct usb_action MC501CB_NoFlikerScale[] = { | |||
3541 | }; | 3541 | }; |
3542 | 3542 | ||
3543 | /* from zs211.inf - HKR,%OV7620%,Initial - 640x480 */ | 3543 | /* from zs211.inf - HKR,%OV7620%,Initial - 640x480 */ |
3544 | static struct usb_action OV7620_mode0[] = { | 3544 | static const struct usb_action OV7620_mode0[] = { |
3545 | {0xa0, 0x01, 0x0000}, /* 00,00,01,cc */ | 3545 | {0xa0, 0x01, 0x0000}, /* 00,00,01,cc */ |
3546 | {0xa0, 0x40, 0x0002}, /* 00,02,40,cc */ | 3546 | {0xa0, 0x40, 0x0002}, /* 00,02,40,cc */ |
3547 | {0xa0, 0x00, 0x0008}, /* 00,08,00,cc */ | 3547 | {0xa0, 0x00, 0x0008}, /* 00,08,00,cc */ |
@@ -3612,7 +3612,7 @@ static struct usb_action OV7620_mode0[] = { | |||
3612 | }; | 3612 | }; |
3613 | 3613 | ||
3614 | /* from zs211.inf - HKR,%OV7620%,InitialScale - 320x240 */ | 3614 | /* from zs211.inf - HKR,%OV7620%,InitialScale - 320x240 */ |
3615 | static struct usb_action OV7620_mode1[] = { | 3615 | static const struct usb_action OV7620_mode1[] = { |
3616 | {0xa0, 0x01, 0x0000}, /* 00,00,01,cc */ | 3616 | {0xa0, 0x01, 0x0000}, /* 00,00,01,cc */ |
3617 | {0xa0, 0x50, 0x0002}, /* 00,02,50,cc */ | 3617 | {0xa0, 0x50, 0x0002}, /* 00,02,50,cc */ |
3618 | {0xa0, 0x03, 0x0008}, /* 00,08,00,cc */ /* mx change? */ | 3618 | {0xa0, 0x03, 0x0008}, /* 00,08,00,cc */ /* mx change? */ |
@@ -3683,7 +3683,7 @@ static struct usb_action OV7620_mode1[] = { | |||
3683 | }; | 3683 | }; |
3684 | 3684 | ||
3685 | /* from zs211.inf - HKR,%OV7620%\AE,50HZ */ | 3685 | /* from zs211.inf - HKR,%OV7620%\AE,50HZ */ |
3686 | static struct usb_action OV7620_50HZ[] = { | 3686 | static const struct usb_action OV7620_50HZ[] = { |
3687 | {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */ | 3687 | {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */ |
3688 | {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */ | 3688 | {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */ |
3689 | {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */ | 3689 | {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */ |
@@ -3702,7 +3702,7 @@ static struct usb_action OV7620_50HZ[] = { | |||
3702 | }; | 3702 | }; |
3703 | 3703 | ||
3704 | /* from zs211.inf - HKR,%OV7620%\AE,60HZ */ | 3704 | /* from zs211.inf - HKR,%OV7620%\AE,60HZ */ |
3705 | static struct usb_action OV7620_60HZ[] = { | 3705 | static const struct usb_action OV7620_60HZ[] = { |
3706 | {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */ /* (bug in zs211.inf) */ | 3706 | {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */ /* (bug in zs211.inf) */ |
3707 | {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */ | 3707 | {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */ |
3708 | {0xaa, 0x2b, 0x0000}, /* 00,2b,00,aa */ | 3708 | {0xaa, 0x2b, 0x0000}, /* 00,2b,00,aa */ |
@@ -3724,7 +3724,7 @@ static struct usb_action OV7620_60HZ[] = { | |||
3724 | }; | 3724 | }; |
3725 | 3725 | ||
3726 | /* from zs211.inf - HKR,%OV7620%\AE,NoFliker */ | 3726 | /* from zs211.inf - HKR,%OV7620%\AE,NoFliker */ |
3727 | static struct usb_action OV7620_NoFliker[] = { | 3727 | static const struct usb_action OV7620_NoFliker[] = { |
3728 | {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */ /* (bug in zs211.inf) */ | 3728 | {0xaa, 0x13, 0x00a3}, /* 00,13,a3,aa */ /* (bug in zs211.inf) */ |
3729 | {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */ | 3729 | {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */ |
3730 | {0xaa, 0x2b, 0x0000}, /* 00,2b,00,aa */ | 3730 | {0xaa, 0x2b, 0x0000}, /* 00,2b,00,aa */ |
@@ -3743,7 +3743,7 @@ static struct usb_action OV7620_NoFliker[] = { | |||
3743 | {} | 3743 | {} |
3744 | }; | 3744 | }; |
3745 | 3745 | ||
3746 | static struct usb_action ov7630c_Initial[] = { | 3746 | static const struct usb_action ov7630c_Initial[] = { |
3747 | {0xa0, 0x01, 0x0000}, | 3747 | {0xa0, 0x01, 0x0000}, |
3748 | {0xa0, 0x10, 0x0002}, | 3748 | {0xa0, 0x10, 0x0002}, |
3749 | {0xa0, 0x01, 0x0000}, | 3749 | {0xa0, 0x01, 0x0000}, |
@@ -3900,7 +3900,7 @@ static struct usb_action ov7630c_Initial[] = { | |||
3900 | {} | 3900 | {} |
3901 | }; | 3901 | }; |
3902 | 3902 | ||
3903 | static struct usb_action ov7630c_InitialScale[] = { | 3903 | static const struct usb_action ov7630c_InitialScale[] = { |
3904 | {0xa0, 0x01, 0x0000}, | 3904 | {0xa0, 0x01, 0x0000}, |
3905 | {0xa0, 0x00, 0x0002}, | 3905 | {0xa0, 0x00, 0x0002}, |
3906 | {0xa0, 0x03, 0x0008}, | 3906 | {0xa0, 0x03, 0x0008}, |
@@ -4057,7 +4057,7 @@ static struct usb_action ov7630c_InitialScale[] = { | |||
4057 | {} | 4057 | {} |
4058 | }; | 4058 | }; |
4059 | 4059 | ||
4060 | static struct usb_action pas106b_Initial_com[] = { | 4060 | static const struct usb_action pas106b_Initial_com[] = { |
4061 | /* Sream and Sensor specific */ | 4061 | /* Sream and Sensor specific */ |
4062 | {0xa1, 0x01, 0x0010}, /* CMOSSensorSelect */ | 4062 | {0xa1, 0x01, 0x0010}, /* CMOSSensorSelect */ |
4063 | /* System */ | 4063 | /* System */ |
@@ -4071,7 +4071,7 @@ static struct usb_action pas106b_Initial_com[] = { | |||
4071 | {} | 4071 | {} |
4072 | }; | 4072 | }; |
4073 | 4073 | ||
4074 | static struct usb_action pas106b_Initial[] = { /* 176x144 */ | 4074 | static const struct usb_action pas106b_Initial[] = { /* 176x144 */ |
4075 | /* JPEG control */ | 4075 | /* JPEG control */ |
4076 | {0xa0, 0x03, 0x0008}, /* ClockSetting */ | 4076 | {0xa0, 0x03, 0x0008}, /* ClockSetting */ |
4077 | /* Sream and Sensor specific */ | 4077 | /* Sream and Sensor specific */ |
@@ -4189,7 +4189,7 @@ static struct usb_action pas106b_Initial[] = { /* 176x144 */ | |||
4189 | {} | 4189 | {} |
4190 | }; | 4190 | }; |
4191 | 4191 | ||
4192 | static struct usb_action pas106b_InitialScale[] = { /* 352x288 */ | 4192 | static const struct usb_action pas106b_InitialScale[] = { /* 352x288 */ |
4193 | /* JPEG control */ | 4193 | /* JPEG control */ |
4194 | {0xa0, 0x03, 0x0008}, /* ClockSetting */ | 4194 | {0xa0, 0x03, 0x0008}, /* ClockSetting */ |
4195 | /* Sream and Sensor specific */ | 4195 | /* Sream and Sensor specific */ |
@@ -4312,7 +4312,7 @@ static struct usb_action pas106b_InitialScale[] = { /* 352x288 */ | |||
4312 | {0xa0, 0xff, 0x0018}, /* Frame adjust */ | 4312 | {0xa0, 0xff, 0x0018}, /* Frame adjust */ |
4313 | {} | 4313 | {} |
4314 | }; | 4314 | }; |
4315 | static struct usb_action pas106b_50HZ[] = { | 4315 | static const struct usb_action pas106b_50HZ[] = { |
4316 | {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */ | 4316 | {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */ |
4317 | {0xa0, 0x06, 0x0191}, /* 01,91,06,cc */ | 4317 | {0xa0, 0x06, 0x0191}, /* 01,91,06,cc */ |
4318 | {0xa0, 0x54, 0x0192}, /* 01,92,54,cc */ | 4318 | {0xa0, 0x54, 0x0192}, /* 01,92,54,cc */ |
@@ -4328,7 +4328,7 @@ static struct usb_action pas106b_50HZ[] = { | |||
4328 | {0xa0, 0x04, 0x01a9}, /* 01,a9,04,cc */ | 4328 | {0xa0, 0x04, 0x01a9}, /* 01,a9,04,cc */ |
4329 | {} | 4329 | {} |
4330 | }; | 4330 | }; |
4331 | static struct usb_action pas106b_60HZ[] = { | 4331 | static const struct usb_action pas106b_60HZ[] = { |
4332 | {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */ | 4332 | {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */ |
4333 | {0xa0, 0x06, 0x0191}, /* 01,91,06,cc */ | 4333 | {0xa0, 0x06, 0x0191}, /* 01,91,06,cc */ |
4334 | {0xa0, 0x2e, 0x0192}, /* 01,92,2e,cc */ | 4334 | {0xa0, 0x2e, 0x0192}, /* 01,92,2e,cc */ |
@@ -4344,7 +4344,7 @@ static struct usb_action pas106b_60HZ[] = { | |||
4344 | {0xa0, 0x04, 0x01a9}, /* 01,a9,04,cc */ | 4344 | {0xa0, 0x04, 0x01a9}, /* 01,a9,04,cc */ |
4345 | {} | 4345 | {} |
4346 | }; | 4346 | }; |
4347 | static struct usb_action pas106b_NoFliker[] = { | 4347 | static const struct usb_action pas106b_NoFliker[] = { |
4348 | {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */ | 4348 | {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */ |
4349 | {0xa0, 0x06, 0x0191}, /* 01,91,06,cc */ | 4349 | {0xa0, 0x06, 0x0191}, /* 01,91,06,cc */ |
4350 | {0xa0, 0x50, 0x0192}, /* 01,92,50,cc */ | 4350 | {0xa0, 0x50, 0x0192}, /* 01,92,50,cc */ |
@@ -4361,7 +4361,7 @@ static struct usb_action pas106b_NoFliker[] = { | |||
4361 | {} | 4361 | {} |
4362 | }; | 4362 | }; |
4363 | 4363 | ||
4364 | static struct usb_action pb03303x_Initial[] = { | 4364 | static const struct usb_action pb03303x_Initial[] = { |
4365 | {0xa0, 0x01, 0x0000}, | 4365 | {0xa0, 0x01, 0x0000}, |
4366 | {0xa0, 0x03, 0x0008}, | 4366 | {0xa0, 0x03, 0x0008}, |
4367 | {0xa0, 0x0a, 0x0010}, | 4367 | {0xa0, 0x0a, 0x0010}, |
@@ -4507,7 +4507,7 @@ static struct usb_action pb03303x_Initial[] = { | |||
4507 | {} | 4507 | {} |
4508 | }; | 4508 | }; |
4509 | 4509 | ||
4510 | static struct usb_action pb03303x_InitialScale[] = { | 4510 | static const struct usb_action pb03303x_InitialScale[] = { |
4511 | {0xa0, 0x01, 0x0000}, | 4511 | {0xa0, 0x01, 0x0000}, |
4512 | {0xa0, 0x03, 0x0008}, | 4512 | {0xa0, 0x03, 0x0008}, |
4513 | {0xa0, 0x0a, 0x0010}, | 4513 | {0xa0, 0x0a, 0x0010}, |
@@ -4655,7 +4655,7 @@ static struct usb_action pb03303x_InitialScale[] = { | |||
4655 | {0xa0, 0x42, 0x0180}, | 4655 | {0xa0, 0x42, 0x0180}, |
4656 | {} | 4656 | {} |
4657 | }; | 4657 | }; |
4658 | static struct usb_action pb0330xx_Initial[] = { | 4658 | static const struct usb_action pb0330xx_Initial[] = { |
4659 | {0xa1, 0x01, 0x0008}, | 4659 | {0xa1, 0x01, 0x0008}, |
4660 | {0xa1, 0x01, 0x0008}, | 4660 | {0xa1, 0x01, 0x0008}, |
4661 | {0xa0, 0x01, 0x0000}, | 4661 | {0xa0, 0x01, 0x0000}, |
@@ -4770,7 +4770,7 @@ static struct usb_action pb0330xx_Initial[] = { | |||
4770 | {} | 4770 | {} |
4771 | }; | 4771 | }; |
4772 | 4772 | ||
4773 | static struct usb_action pb0330xx_InitialScale[] = { | 4773 | static const struct usb_action pb0330xx_InitialScale[] = { |
4774 | {0xa1, 0x01, 0x0008}, | 4774 | {0xa1, 0x01, 0x0008}, |
4775 | {0xa1, 0x01, 0x0008}, | 4775 | {0xa1, 0x01, 0x0008}, |
4776 | {0xa0, 0x01, 0x0000}, | 4776 | {0xa0, 0x01, 0x0000}, |
@@ -4883,7 +4883,7 @@ static struct usb_action pb0330xx_InitialScale[] = { | |||
4883 | /* {0xa0, 0x00, 0x0007}, */ | 4883 | /* {0xa0, 0x00, 0x0007}, */ |
4884 | {} | 4884 | {} |
4885 | }; | 4885 | }; |
4886 | static struct usb_action pb0330_50HZ[] = { | 4886 | static const struct usb_action pb0330_50HZ[] = { |
4887 | {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */ | 4887 | {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */ |
4888 | {0xa0, 0x07, 0x0191}, /* 01,91,07,cc */ | 4888 | {0xa0, 0x07, 0x0191}, /* 01,91,07,cc */ |
4889 | {0xa0, 0xee, 0x0192}, /* 01,92,ee,cc */ | 4889 | {0xa0, 0xee, 0x0192}, /* 01,92,ee,cc */ |
@@ -4899,7 +4899,7 @@ static struct usb_action pb0330_50HZ[] = { | |||
4899 | {0xa0, 0xc8, 0x001f}, /* 00,1f,c8,cc */ | 4899 | {0xa0, 0xc8, 0x001f}, /* 00,1f,c8,cc */ |
4900 | {} | 4900 | {} |
4901 | }; | 4901 | }; |
4902 | static struct usb_action pb0330_50HZScale[] = { | 4902 | static const struct usb_action pb0330_50HZScale[] = { |
4903 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 4903 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
4904 | {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */ | 4904 | {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */ |
4905 | {0xa0, 0x07, 0x0191}, /* 01,91,07,cc */ | 4905 | {0xa0, 0x07, 0x0191}, /* 01,91,07,cc */ |
@@ -4916,7 +4916,7 @@ static struct usb_action pb0330_50HZScale[] = { | |||
4916 | {0xa0, 0xf8, 0x001f}, /* 00,1f,f8,cc */ | 4916 | {0xa0, 0xf8, 0x001f}, /* 00,1f,f8,cc */ |
4917 | {} | 4917 | {} |
4918 | }; | 4918 | }; |
4919 | static struct usb_action pb0330_60HZ[] = { | 4919 | static const struct usb_action pb0330_60HZ[] = { |
4920 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 4920 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
4921 | {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */ | 4921 | {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */ |
4922 | {0xa0, 0x07, 0x0191}, /* 01,91,07,cc */ | 4922 | {0xa0, 0x07, 0x0191}, /* 01,91,07,cc */ |
@@ -4933,7 +4933,7 @@ static struct usb_action pb0330_60HZ[] = { | |||
4933 | {0xa0, 0x90, 0x001f}, /* 00,1f,90,cc */ | 4933 | {0xa0, 0x90, 0x001f}, /* 00,1f,90,cc */ |
4934 | {} | 4934 | {} |
4935 | }; | 4935 | }; |
4936 | static struct usb_action pb0330_60HZScale[] = { | 4936 | static const struct usb_action pb0330_60HZScale[] = { |
4937 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 4937 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
4938 | {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */ | 4938 | {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */ |
4939 | {0xa0, 0x07, 0x0191}, /* 01,91,07,cc */ | 4939 | {0xa0, 0x07, 0x0191}, /* 01,91,07,cc */ |
@@ -4950,7 +4950,7 @@ static struct usb_action pb0330_60HZScale[] = { | |||
4950 | {0xa0, 0x90, 0x001f}, /* 00,1f,90,cc */ | 4950 | {0xa0, 0x90, 0x001f}, /* 00,1f,90,cc */ |
4951 | {} | 4951 | {} |
4952 | }; | 4952 | }; |
4953 | static struct usb_action pb0330_NoFliker[] = { | 4953 | static const struct usb_action pb0330_NoFliker[] = { |
4954 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 4954 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
4955 | {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */ | 4955 | {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */ |
4956 | {0xa0, 0x07, 0x0191}, /* 01,91,07,cc */ | 4956 | {0xa0, 0x07, 0x0191}, /* 01,91,07,cc */ |
@@ -4967,7 +4967,7 @@ static struct usb_action pb0330_NoFliker[] = { | |||
4967 | {0xa0, 0x90, 0x001f}, /* 00,1f,90,cc */ | 4967 | {0xa0, 0x90, 0x001f}, /* 00,1f,90,cc */ |
4968 | {} | 4968 | {} |
4969 | }; | 4969 | }; |
4970 | static struct usb_action pb0330_NoFlikerScale[] = { | 4970 | static const struct usb_action pb0330_NoFlikerScale[] = { |
4971 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 4971 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
4972 | {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */ | 4972 | {0xa0, 0x00, 0x0190}, /* 01,90,00,cc */ |
4973 | {0xa0, 0x07, 0x0191}, /* 01,91,07,cc */ | 4973 | {0xa0, 0x07, 0x0191}, /* 01,91,07,cc */ |
@@ -4986,7 +4986,7 @@ static struct usb_action pb0330_NoFlikerScale[] = { | |||
4986 | }; | 4986 | }; |
4987 | 4987 | ||
4988 | /* from oem9.inf - HKR,%PO2030%,Initial - 640x480 - (close to CS2102) */ | 4988 | /* from oem9.inf - HKR,%PO2030%,Initial - 640x480 - (close to CS2102) */ |
4989 | static struct usb_action PO2030_mode0[] = { | 4989 | static const struct usb_action PO2030_mode0[] = { |
4990 | {0xa0, 0x01, 0x0000}, /* 00,00,01,cc */ | 4990 | {0xa0, 0x01, 0x0000}, /* 00,00,01,cc */ |
4991 | {0xa0, 0x04, 0x0002}, /* 00,02,04,cc */ | 4991 | {0xa0, 0x04, 0x0002}, /* 00,02,04,cc */ |
4992 | {0xa0, 0x01, 0x0010}, /* 00,10,01,cc */ | 4992 | {0xa0, 0x01, 0x0010}, /* 00,10,01,cc */ |
@@ -5063,7 +5063,7 @@ static struct usb_action PO2030_mode0[] = { | |||
5063 | }; | 5063 | }; |
5064 | 5064 | ||
5065 | /* from oem9.inf - HKR,%PO2030%,InitialScale - 320x240 */ | 5065 | /* from oem9.inf - HKR,%PO2030%,InitialScale - 320x240 */ |
5066 | static struct usb_action PO2030_mode1[] = { | 5066 | static const struct usb_action PO2030_mode1[] = { |
5067 | {0xa0, 0x01, 0x0000}, /* 00,00,01,cc */ | 5067 | {0xa0, 0x01, 0x0000}, /* 00,00,01,cc */ |
5068 | {0xa0, 0x10, 0x0002}, /* 00,02,10,cc */ | 5068 | {0xa0, 0x10, 0x0002}, /* 00,02,10,cc */ |
5069 | {0xa0, 0x01, 0x0010}, /* 00,10,01,cc */ | 5069 | {0xa0, 0x01, 0x0010}, /* 00,10,01,cc */ |
@@ -5139,7 +5139,7 @@ static struct usb_action PO2030_mode1[] = { | |||
5139 | {} | 5139 | {} |
5140 | }; | 5140 | }; |
5141 | 5141 | ||
5142 | static struct usb_action PO2030_50HZ[] = { | 5142 | static const struct usb_action PO2030_50HZ[] = { |
5143 | {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */ | 5143 | {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */ |
5144 | {0xaa, 0x1a, 0x0001}, /* 00,1a,01,aa */ | 5144 | {0xaa, 0x1a, 0x0001}, /* 00,1a,01,aa */ |
5145 | {0xaa, 0x1b, 0x000a}, /* 00,1b,0a,aa */ | 5145 | {0xaa, 0x1b, 0x000a}, /* 00,1b,0a,aa */ |
@@ -5161,7 +5161,7 @@ static struct usb_action PO2030_50HZ[] = { | |||
5161 | {} | 5161 | {} |
5162 | }; | 5162 | }; |
5163 | 5163 | ||
5164 | static struct usb_action PO2030_60HZ[] = { | 5164 | static const struct usb_action PO2030_60HZ[] = { |
5165 | {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */ | 5165 | {0xaa, 0x8d, 0x0008}, /* 00,8d,08,aa */ |
5166 | {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */ | 5166 | {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */ |
5167 | {0xaa, 0x1b, 0x00de}, /* 00,1b,de,aa */ | 5167 | {0xaa, 0x1b, 0x00de}, /* 00,1b,de,aa */ |
@@ -5183,7 +5183,7 @@ static struct usb_action PO2030_60HZ[] = { | |||
5183 | {} | 5183 | {} |
5184 | }; | 5184 | }; |
5185 | 5185 | ||
5186 | static struct usb_action PO2030_NoFliker[] = { | 5186 | static const struct usb_action PO2030_NoFliker[] = { |
5187 | {0xa0, 0x02, 0x0180}, /* 01,80,02,cc */ | 5187 | {0xa0, 0x02, 0x0180}, /* 01,80,02,cc */ |
5188 | {0xaa, 0x8d, 0x000d}, /* 00,8d,0d,aa */ | 5188 | {0xaa, 0x8d, 0x000d}, /* 00,8d,0d,aa */ |
5189 | {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */ | 5189 | {0xaa, 0x1a, 0x0000}, /* 00,1a,00,aa */ |
@@ -5195,7 +5195,7 @@ static struct usb_action PO2030_NoFliker[] = { | |||
5195 | }; | 5195 | }; |
5196 | 5196 | ||
5197 | /* TEST */ | 5197 | /* TEST */ |
5198 | static struct usb_action tas5130CK_Initial[] = { | 5198 | static const struct usb_action tas5130CK_Initial[] = { |
5199 | {0xa0, 0x01, 0x0000}, | 5199 | {0xa0, 0x01, 0x0000}, |
5200 | {0xa0, 0x01, 0x003b}, | 5200 | {0xa0, 0x01, 0x003b}, |
5201 | {0xa0, 0x0e, 0x003a}, | 5201 | {0xa0, 0x0e, 0x003a}, |
@@ -5398,7 +5398,7 @@ static struct usb_action tas5130CK_Initial[] = { | |||
5398 | {} | 5398 | {} |
5399 | }; | 5399 | }; |
5400 | 5400 | ||
5401 | static struct usb_action tas5130CK_InitialScale[] = { | 5401 | static const struct usb_action tas5130CK_InitialScale[] = { |
5402 | {0xa0, 0x01, 0x0000}, | 5402 | {0xa0, 0x01, 0x0000}, |
5403 | {0xa0, 0x01, 0x003b}, | 5403 | {0xa0, 0x01, 0x003b}, |
5404 | {0xa0, 0x0e, 0x003a}, | 5404 | {0xa0, 0x0e, 0x003a}, |
@@ -5606,7 +5606,7 @@ static struct usb_action tas5130CK_InitialScale[] = { | |||
5606 | {} | 5606 | {} |
5607 | }; | 5607 | }; |
5608 | 5608 | ||
5609 | static struct usb_action tas5130cxx_Initial[] = { | 5609 | static const struct usb_action tas5130cxx_Initial[] = { |
5610 | {0xa0, 0x01, 0x0000}, | 5610 | {0xa0, 0x01, 0x0000}, |
5611 | {0xa0, 0x50, 0x0002}, | 5611 | {0xa0, 0x50, 0x0002}, |
5612 | {0xa0, 0x03, 0x0008}, | 5612 | {0xa0, 0x03, 0x0008}, |
@@ -5695,7 +5695,7 @@ static struct usb_action tas5130cxx_Initial[] = { | |||
5695 | {0xa0, 0x42, 0x0180}, | 5695 | {0xa0, 0x42, 0x0180}, |
5696 | {} | 5696 | {} |
5697 | }; | 5697 | }; |
5698 | static struct usb_action tas5130cxx_InitialScale[] = { | 5698 | static const struct usb_action tas5130cxx_InitialScale[] = { |
5699 | {0xa0, 0x01, 0x0000}, | 5699 | {0xa0, 0x01, 0x0000}, |
5700 | {0xa0, 0x01, 0x0000}, | 5700 | {0xa0, 0x01, 0x0000}, |
5701 | {0xa0, 0x40, 0x0002}, | 5701 | {0xa0, 0x40, 0x0002}, |
@@ -5785,7 +5785,7 @@ static struct usb_action tas5130cxx_InitialScale[] = { | |||
5785 | {0xa0, 0x42, 0x0180}, | 5785 | {0xa0, 0x42, 0x0180}, |
5786 | {} | 5786 | {} |
5787 | }; | 5787 | }; |
5788 | static struct usb_action tas5130cxx_50HZ[] = { | 5788 | static const struct usb_action tas5130cxx_50HZ[] = { |
5789 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 5789 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
5790 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ | 5790 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ |
5791 | {0xaa, 0xa4, 0x0063}, /* 00,a4,63,aa */ | 5791 | {0xaa, 0xa4, 0x0063}, /* 00,a4,63,aa */ |
@@ -5808,7 +5808,7 @@ static struct usb_action tas5130cxx_50HZ[] = { | |||
5808 | {0xa0, 0x03, 0x009f}, /* 00,9f,03,cc */ | 5808 | {0xa0, 0x03, 0x009f}, /* 00,9f,03,cc */ |
5809 | {} | 5809 | {} |
5810 | }; | 5810 | }; |
5811 | static struct usb_action tas5130cxx_50HZScale[] = { | 5811 | static const struct usb_action tas5130cxx_50HZScale[] = { |
5812 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 5812 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
5813 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ | 5813 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ |
5814 | {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */ | 5814 | {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */ |
@@ -5831,7 +5831,7 @@ static struct usb_action tas5130cxx_50HZScale[] = { | |||
5831 | {0xa0, 0x03, 0x009f}, /* 00,9f,03,cc */ | 5831 | {0xa0, 0x03, 0x009f}, /* 00,9f,03,cc */ |
5832 | {} | 5832 | {} |
5833 | }; | 5833 | }; |
5834 | static struct usb_action tas5130cxx_60HZ[] = { | 5834 | static const struct usb_action tas5130cxx_60HZ[] = { |
5835 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 5835 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
5836 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ | 5836 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ |
5837 | {0xaa, 0xa4, 0x0036}, /* 00,a4,36,aa */ | 5837 | {0xaa, 0xa4, 0x0036}, /* 00,a4,36,aa */ |
@@ -5854,7 +5854,7 @@ static struct usb_action tas5130cxx_60HZ[] = { | |||
5854 | {0xa0, 0x03, 0x009f}, /* 00,9f,03,cc */ | 5854 | {0xa0, 0x03, 0x009f}, /* 00,9f,03,cc */ |
5855 | {} | 5855 | {} |
5856 | }; | 5856 | }; |
5857 | static struct usb_action tas5130cxx_60HZScale[] = { | 5857 | static const struct usb_action tas5130cxx_60HZScale[] = { |
5858 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 5858 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
5859 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ | 5859 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ |
5860 | {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */ | 5860 | {0xaa, 0xa4, 0x0077}, /* 00,a4,77,aa */ |
@@ -5877,7 +5877,7 @@ static struct usb_action tas5130cxx_60HZScale[] = { | |||
5877 | {0xa0, 0x03, 0x009f}, /* 00,9f,03,cc */ | 5877 | {0xa0, 0x03, 0x009f}, /* 00,9f,03,cc */ |
5878 | {} | 5878 | {} |
5879 | }; | 5879 | }; |
5880 | static struct usb_action tas5130cxx_NoFliker[] = { | 5880 | static const struct usb_action tas5130cxx_NoFliker[] = { |
5881 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 5881 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
5882 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ | 5882 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ |
5883 | {0xaa, 0xa4, 0x0040}, /* 00,a4,40,aa */ | 5883 | {0xaa, 0xa4, 0x0040}, /* 00,a4,40,aa */ |
@@ -5901,7 +5901,7 @@ static struct usb_action tas5130cxx_NoFliker[] = { | |||
5901 | {} | 5901 | {} |
5902 | }; | 5902 | }; |
5903 | 5903 | ||
5904 | static struct usb_action tas5130cxx_NoFlikerScale[] = { | 5904 | static const struct usb_action tas5130cxx_NoFlikerScale[] = { |
5905 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ | 5905 | {0xa0, 0x00, 0x0019}, /* 00,19,00,cc */ |
5906 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ | 5906 | {0xaa, 0xa3, 0x0001}, /* 00,a3,01,aa */ |
5907 | {0xaa, 0xa4, 0x0090}, /* 00,a4,90,aa */ | 5907 | {0xaa, 0xa4, 0x0090}, /* 00,a4,90,aa */ |
@@ -5925,7 +5925,7 @@ static struct usb_action tas5130cxx_NoFlikerScale[] = { | |||
5925 | {} | 5925 | {} |
5926 | }; | 5926 | }; |
5927 | 5927 | ||
5928 | static struct usb_action tas5130c_vf0250_Initial[] = { | 5928 | static const struct usb_action tas5130c_vf0250_Initial[] = { |
5929 | {0xa0, 0x01, 0x0000}, /* 00,00,01,cc, */ | 5929 | {0xa0, 0x01, 0x0000}, /* 00,00,01,cc, */ |
5930 | {0xa0, 0x02, 0x0008}, /* 00,08,02,cc, */ | 5930 | {0xa0, 0x02, 0x0008}, /* 00,08,02,cc, */ |
5931 | {0xa0, 0x01, 0x0010}, /* 00,10,01,cc, */ | 5931 | {0xa0, 0x01, 0x0010}, /* 00,10,01,cc, */ |
@@ -5989,7 +5989,7 @@ static struct usb_action tas5130c_vf0250_Initial[] = { | |||
5989 | {} | 5989 | {} |
5990 | }; | 5990 | }; |
5991 | 5991 | ||
5992 | static struct usb_action tas5130c_vf0250_InitialScale[] = { | 5992 | static const struct usb_action tas5130c_vf0250_InitialScale[] = { |
5993 | {0xa0, 0x01, 0x0000}, /* 00,00,01,cc, */ | 5993 | {0xa0, 0x01, 0x0000}, /* 00,00,01,cc, */ |
5994 | {0xa0, 0x02, 0x0008}, /* 00,08,02,cc, */ | 5994 | {0xa0, 0x02, 0x0008}, /* 00,08,02,cc, */ |
5995 | {0xa0, 0x01, 0x0010}, /* 00,10,01,cc, */ | 5995 | {0xa0, 0x01, 0x0010}, /* 00,10,01,cc, */ |
@@ -6053,7 +6053,7 @@ static struct usb_action tas5130c_vf0250_InitialScale[] = { | |||
6053 | {} | 6053 | {} |
6054 | }; | 6054 | }; |
6055 | /* "50HZ" light frequency banding filter */ | 6055 | /* "50HZ" light frequency banding filter */ |
6056 | static struct usb_action tas5130c_vf0250_50HZ[] = { | 6056 | static const struct usb_action tas5130c_vf0250_50HZ[] = { |
6057 | {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */ | 6057 | {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */ |
6058 | {0xaa, 0x83, 0x0001}, /* 00,83,01,aa */ | 6058 | {0xaa, 0x83, 0x0001}, /* 00,83,01,aa */ |
6059 | {0xaa, 0x84, 0x00aa}, /* 00,84,aa,aa */ | 6059 | {0xaa, 0x84, 0x00aa}, /* 00,84,aa,aa */ |
@@ -6078,7 +6078,7 @@ static struct usb_action tas5130c_vf0250_50HZ[] = { | |||
6078 | }; | 6078 | }; |
6079 | 6079 | ||
6080 | /* "50HZScale" light frequency banding filter */ | 6080 | /* "50HZScale" light frequency banding filter */ |
6081 | static struct usb_action tas5130c_vf0250_50HZScale[] = { | 6081 | static const struct usb_action tas5130c_vf0250_50HZScale[] = { |
6082 | {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */ | 6082 | {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */ |
6083 | {0xaa, 0x83, 0x0003}, /* 00,83,03,aa */ | 6083 | {0xaa, 0x83, 0x0003}, /* 00,83,03,aa */ |
6084 | {0xaa, 0x84, 0x0054}, /* 00,84,54,aa */ | 6084 | {0xaa, 0x84, 0x0054}, /* 00,84,54,aa */ |
@@ -6103,7 +6103,7 @@ static struct usb_action tas5130c_vf0250_50HZScale[] = { | |||
6103 | }; | 6103 | }; |
6104 | 6104 | ||
6105 | /* "60HZ" light frequency banding filter */ | 6105 | /* "60HZ" light frequency banding filter */ |
6106 | static struct usb_action tas5130c_vf0250_60HZ[] = { | 6106 | static const struct usb_action tas5130c_vf0250_60HZ[] = { |
6107 | {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */ | 6107 | {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */ |
6108 | {0xaa, 0x83, 0x0001}, /* 00,83,01,aa */ | 6108 | {0xaa, 0x83, 0x0001}, /* 00,83,01,aa */ |
6109 | {0xaa, 0x84, 0x0062}, /* 00,84,62,aa */ | 6109 | {0xaa, 0x84, 0x0062}, /* 00,84,62,aa */ |
@@ -6128,7 +6128,7 @@ static struct usb_action tas5130c_vf0250_60HZ[] = { | |||
6128 | }; | 6128 | }; |
6129 | 6129 | ||
6130 | /* "60HZScale" light frequency banding ilter */ | 6130 | /* "60HZScale" light frequency banding ilter */ |
6131 | static struct usb_action tas5130c_vf0250_60HZScale[] = { | 6131 | static const struct usb_action tas5130c_vf0250_60HZScale[] = { |
6132 | {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */ | 6132 | {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */ |
6133 | {0xaa, 0x83, 0x0002}, /* 00,83,02,aa */ | 6133 | {0xaa, 0x83, 0x0002}, /* 00,83,02,aa */ |
6134 | {0xaa, 0x84, 0x00c4}, /* 00,84,c4,aa */ | 6134 | {0xaa, 0x84, 0x00c4}, /* 00,84,c4,aa */ |
@@ -6153,7 +6153,7 @@ static struct usb_action tas5130c_vf0250_60HZScale[] = { | |||
6153 | }; | 6153 | }; |
6154 | 6154 | ||
6155 | /* "NoFliker" light frequency banding flter */ | 6155 | /* "NoFliker" light frequency banding flter */ |
6156 | static struct usb_action tas5130c_vf0250_NoFliker[] = { | 6156 | static const struct usb_action tas5130c_vf0250_NoFliker[] = { |
6157 | {0xa0, 0x0c, 0x0100}, /* 01,00,0c,cc, */ | 6157 | {0xa0, 0x0c, 0x0100}, /* 01,00,0c,cc, */ |
6158 | {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */ | 6158 | {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */ |
6159 | {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */ | 6159 | {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */ |
@@ -6176,7 +6176,7 @@ static struct usb_action tas5130c_vf0250_NoFliker[] = { | |||
6176 | }; | 6176 | }; |
6177 | 6177 | ||
6178 | /* "NoFlikerScale" light frequency banding filter */ | 6178 | /* "NoFlikerScale" light frequency banding filter */ |
6179 | static struct usb_action tas5130c_vf0250_NoFlikerScale[] = { | 6179 | static const struct usb_action tas5130c_vf0250_NoFlikerScale[] = { |
6180 | {0xa0, 0x0c, 0x0100}, /* 01,00,0c,cc, */ | 6180 | {0xa0, 0x0c, 0x0100}, /* 01,00,0c,cc, */ |
6181 | {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */ | 6181 | {0xaa, 0x82, 0x0000}, /* 00,82,00,aa */ |
6182 | {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */ | 6182 | {0xaa, 0x83, 0x0000}, /* 00,83,00,aa */ |
@@ -6272,7 +6272,7 @@ static __u8 i2c_write(struct usb_device *dev, | |||
6272 | } | 6272 | } |
6273 | 6273 | ||
6274 | static void usb_exchange(struct usb_device *dev, | 6274 | static void usb_exchange(struct usb_device *dev, |
6275 | struct usb_action *action) | 6275 | const struct usb_action *action) |
6276 | { | 6276 | { |
6277 | __u8 buffread; | 6277 | __u8 buffread; |
6278 | 6278 | ||
@@ -6304,12 +6304,12 @@ static void setmatrix(struct gspca_dev *gspca_dev) | |||
6304 | { | 6304 | { |
6305 | struct sd *sd = (struct sd *) gspca_dev; | 6305 | struct sd *sd = (struct sd *) gspca_dev; |
6306 | int i; | 6306 | int i; |
6307 | __u8 *matrix; | 6307 | const __u8 *matrix; |
6308 | static __u8 gc0305_matrix[9] = | 6308 | static const __u8 gc0305_matrix[9] = |
6309 | {0x50, 0xf8, 0xf8, 0xf8, 0x50, 0xf8, 0xf8, 0xf8, 0x50}; | 6309 | {0x50, 0xf8, 0xf8, 0xf8, 0x50, 0xf8, 0xf8, 0xf8, 0x50}; |
6310 | static __u8 ov7620_matrix[9] = | 6310 | static const __u8 ov7620_matrix[9] = |
6311 | {0x58, 0xf4, 0xf4, 0xf4, 0x58, 0xf4, 0xf4, 0xf4, 0x58}; | 6311 | {0x58, 0xf4, 0xf4, 0xf4, 0x58, 0xf4, 0xf4, 0xf4, 0x58}; |
6312 | static __u8 po2030_matrix[9] = | 6312 | static const __u8 po2030_matrix[9] = |
6313 | {0x60, 0xf0, 0xf0, 0xf0, 0x60, 0xf0, 0xf0, 0xf0, 0x60}; | 6313 | {0x60, 0xf0, 0xf0, 0xf0, 0x60, 0xf0, 0xf0, 0xf0, 0x60}; |
6314 | 6314 | ||
6315 | switch (sd->sensor) { | 6315 | switch (sd->sensor) { |
@@ -6361,7 +6361,7 @@ static void setsharpness(struct gspca_dev *gspca_dev) | |||
6361 | struct usb_device *dev = gspca_dev->dev; | 6361 | struct usb_device *dev = gspca_dev->dev; |
6362 | int sharpness; | 6362 | int sharpness; |
6363 | __u8 retbyte; | 6363 | __u8 retbyte; |
6364 | static __u8 sharpness_tb[][2] = { | 6364 | static const __u8 sharpness_tb[][2] = { |
6365 | {0x02, 0x03}, | 6365 | {0x02, 0x03}, |
6366 | {0x04, 0x07}, | 6366 | {0x04, 0x07}, |
6367 | {0x08, 0x0f}, | 6367 | {0x08, 0x0f}, |
@@ -6380,55 +6380,55 @@ static void setcontrast(struct gspca_dev *gspca_dev) | |||
6380 | { | 6380 | { |
6381 | struct sd *sd = (struct sd *) gspca_dev; | 6381 | struct sd *sd = (struct sd *) gspca_dev; |
6382 | struct usb_device *dev = gspca_dev->dev; | 6382 | struct usb_device *dev = gspca_dev->dev; |
6383 | __u8 *Tgamma, *Tgradient; | 6383 | const __u8 *Tgamma, *Tgradient; |
6384 | int g, i, k; | 6384 | int g, i, k; |
6385 | static __u8 kgamma_tb[16] = /* delta for contrast */ | 6385 | static const __u8 kgamma_tb[16] = /* delta for contrast */ |
6386 | {0x15, 0x0d, 0x0a, 0x09, 0x08, 0x08, 0x08, 0x08, | 6386 | {0x15, 0x0d, 0x0a, 0x09, 0x08, 0x08, 0x08, 0x08, |
6387 | 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}; | 6387 | 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}; |
6388 | static __u8 kgrad_tb[16] = | 6388 | static const __u8 kgrad_tb[16] = |
6389 | {0x1b, 0x06, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, | 6389 | {0x1b, 0x06, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, |
6390 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x04}; | 6390 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x04}; |
6391 | static __u8 Tgamma_1[16] = | 6391 | static const __u8 Tgamma_1[16] = |
6392 | {0x00, 0x00, 0x03, 0x0d, 0x1b, 0x2e, 0x45, 0x5f, | 6392 | {0x00, 0x00, 0x03, 0x0d, 0x1b, 0x2e, 0x45, 0x5f, |
6393 | 0x79, 0x93, 0xab, 0xc1, 0xd4, 0xe5, 0xf3, 0xff}; | 6393 | 0x79, 0x93, 0xab, 0xc1, 0xd4, 0xe5, 0xf3, 0xff}; |
6394 | static __u8 Tgradient_1[16] = | 6394 | static const __u8 Tgradient_1[16] = |
6395 | {0x00, 0x01, 0x05, 0x0b, 0x10, 0x15, 0x18, 0x1a, | 6395 | {0x00, 0x01, 0x05, 0x0b, 0x10, 0x15, 0x18, 0x1a, |
6396 | 0x1a, 0x18, 0x16, 0x14, 0x12, 0x0f, 0x0d, 0x06}; | 6396 | 0x1a, 0x18, 0x16, 0x14, 0x12, 0x0f, 0x0d, 0x06}; |
6397 | static __u8 Tgamma_2[16] = | 6397 | static const __u8 Tgamma_2[16] = |
6398 | {0x01, 0x0c, 0x1f, 0x3a, 0x53, 0x6d, 0x85, 0x9c, | 6398 | {0x01, 0x0c, 0x1f, 0x3a, 0x53, 0x6d, 0x85, 0x9c, |
6399 | 0xb0, 0xc2, 0xd1, 0xde, 0xe9, 0xf2, 0xf9, 0xff}; | 6399 | 0xb0, 0xc2, 0xd1, 0xde, 0xe9, 0xf2, 0xf9, 0xff}; |
6400 | static __u8 Tgradient_2[16] = | 6400 | static const __u8 Tgradient_2[16] = |
6401 | {0x05, 0x0f, 0x16, 0x1a, 0x19, 0x19, 0x17, 0x15, | 6401 | {0x05, 0x0f, 0x16, 0x1a, 0x19, 0x19, 0x17, 0x15, |
6402 | 0x12, 0x10, 0x0e, 0x0b, 0x09, 0x08, 0x06, 0x03}; | 6402 | 0x12, 0x10, 0x0e, 0x0b, 0x09, 0x08, 0x06, 0x03}; |
6403 | static __u8 Tgamma_3[16] = | 6403 | static const __u8 Tgamma_3[16] = |
6404 | {0x04, 0x16, 0x30, 0x4e, 0x68, 0x81, 0x98, 0xac, | 6404 | {0x04, 0x16, 0x30, 0x4e, 0x68, 0x81, 0x98, 0xac, |
6405 | 0xbe, 0xcd, 0xda, 0xe4, 0xed, 0xf5, 0xfb, 0xff}; | 6405 | 0xbe, 0xcd, 0xda, 0xe4, 0xed, 0xf5, 0xfb, 0xff}; |
6406 | static __u8 Tgradient_3[16] = | 6406 | static const __u8 Tgradient_3[16] = |
6407 | {0x0c, 0x16, 0x1b, 0x1c, 0x19, 0x18, 0x15, 0x12, | 6407 | {0x0c, 0x16, 0x1b, 0x1c, 0x19, 0x18, 0x15, 0x12, |
6408 | 0x10, 0x0d, 0x0b, 0x09, 0x08, 0x06, 0x05, 0x03}; | 6408 | 0x10, 0x0d, 0x0b, 0x09, 0x08, 0x06, 0x05, 0x03}; |
6409 | static __u8 Tgamma_4[16] = | 6409 | static const __u8 Tgamma_4[16] = |
6410 | {0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8, | 6410 | {0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8, |
6411 | 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff}; | 6411 | 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff}; |
6412 | static __u8 Tgradient_4[16] = | 6412 | static const __u8 Tgradient_4[16] = |
6413 | {0x26, 0x22, 0x20, 0x1c, 0x16, 0x13, 0x10, 0x0d, | 6413 | {0x26, 0x22, 0x20, 0x1c, 0x16, 0x13, 0x10, 0x0d, |
6414 | 0x0b, 0x09, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02}; | 6414 | 0x0b, 0x09, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02}; |
6415 | static __u8 Tgamma_5[16] = | 6415 | static const __u8 Tgamma_5[16] = |
6416 | {0x20, 0x4b, 0x6e, 0x8d, 0xa3, 0xb5, 0xc5, 0xd2, | 6416 | {0x20, 0x4b, 0x6e, 0x8d, 0xa3, 0xb5, 0xc5, 0xd2, |
6417 | 0xdc, 0xe5, 0xec, 0xf2, 0xf6, 0xfa, 0xfd, 0xff}; | 6417 | 0xdc, 0xe5, 0xec, 0xf2, 0xf6, 0xfa, 0xfd, 0xff}; |
6418 | static __u8 Tgradient_5[16] = | 6418 | static const __u8 Tgradient_5[16] = |
6419 | {0x37, 0x26, 0x20, 0x1a, 0x14, 0x10, 0x0e, 0x0b, | 6419 | {0x37, 0x26, 0x20, 0x1a, 0x14, 0x10, 0x0e, 0x0b, |
6420 | 0x09, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x02}; | 6420 | 0x09, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x02}; |
6421 | static __u8 Tgamma_6[16] = /* ?? was gamma 5 */ | 6421 | static const __u8 Tgamma_6[16] = /* ?? was gamma 5 */ |
6422 | {0x24, 0x44, 0x64, 0x84, 0x9d, 0xb2, 0xc4, 0xd3, | 6422 | {0x24, 0x44, 0x64, 0x84, 0x9d, 0xb2, 0xc4, 0xd3, |
6423 | 0xe0, 0xeb, 0xf4, 0xff, 0xff, 0xff, 0xff, 0xff}; | 6423 | 0xe0, 0xeb, 0xf4, 0xff, 0xff, 0xff, 0xff, 0xff}; |
6424 | static __u8 Tgradient_6[16] = | 6424 | static const __u8 Tgradient_6[16] = |
6425 | {0x18, 0x20, 0x20, 0x1c, 0x16, 0x13, 0x10, 0x0e, | 6425 | {0x18, 0x20, 0x20, 0x1c, 0x16, 0x13, 0x10, 0x0e, |
6426 | 0x0b, 0x09, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01}; | 6426 | 0x0b, 0x09, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01}; |
6427 | static __u8 *gamma_tb[] = { | 6427 | static const __u8 *gamma_tb[] = { |
6428 | 0, Tgamma_1, Tgamma_2, | 6428 | 0, Tgamma_1, Tgamma_2, |
6429 | Tgamma_3, Tgamma_4, Tgamma_5, Tgamma_6 | 6429 | Tgamma_3, Tgamma_4, Tgamma_5, Tgamma_6 |
6430 | }; | 6430 | }; |
6431 | static __u8 *gradient_tb[] = { | 6431 | static const __u8 *gradient_tb[] = { |
6432 | 0, Tgradient_1, Tgradient_2, | 6432 | 0, Tgradient_1, Tgradient_2, |
6433 | Tgradient_3, Tgradient_4, Tgradient_5, Tgradient_6 | 6433 | Tgradient_3, Tgradient_4, Tgradient_5, Tgradient_6 |
6434 | }; | 6434 | }; |
@@ -6529,8 +6529,8 @@ static int setlightfreq(struct gspca_dev *gspca_dev) | |||
6529 | { | 6529 | { |
6530 | struct sd *sd = (struct sd *) gspca_dev; | 6530 | struct sd *sd = (struct sd *) gspca_dev; |
6531 | int i, mode; | 6531 | int i, mode; |
6532 | struct usb_action *zc3_freq; | 6532 | const struct usb_action *zc3_freq; |
6533 | static struct usb_action *freq_tb[SENSOR_MAX][6] = { | 6533 | static const struct usb_action *freq_tb[SENSOR_MAX][6] = { |
6534 | /* SENSOR_CS2102 0 */ | 6534 | /* SENSOR_CS2102 0 */ |
6535 | {cs2102_NoFliker, cs2102_NoFlikerScale, | 6535 | {cs2102_NoFliker, cs2102_NoFlikerScale, |
6536 | cs2102_50HZ, cs2102_50HZScale, | 6536 | cs2102_50HZ, cs2102_50HZScale, |
@@ -6952,7 +6952,7 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
6952 | int sensor; | 6952 | int sensor; |
6953 | __u8 bsensor; | 6953 | __u8 bsensor; |
6954 | int vga = 1; /* 1: vga, 0: sif */ | 6954 | int vga = 1; /* 1: vga, 0: sif */ |
6955 | static __u8 gamma[SENSOR_MAX] = { | 6955 | static const __u8 gamma[SENSOR_MAX] = { |
6956 | 5, /* SENSOR_CS2102 0 */ | 6956 | 5, /* SENSOR_CS2102 0 */ |
6957 | 5, /* SENSOR_CS2102K 1 */ | 6957 | 5, /* SENSOR_CS2102K 1 */ |
6958 | 4, /* SENSOR_GC0305 2 */ | 6958 | 4, /* SENSOR_GC0305 2 */ |
@@ -7145,10 +7145,10 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
7145 | { | 7145 | { |
7146 | struct sd *sd = (struct sd *) gspca_dev; | 7146 | struct sd *sd = (struct sd *) gspca_dev; |
7147 | struct usb_device *dev = gspca_dev->dev; | 7147 | struct usb_device *dev = gspca_dev->dev; |
7148 | struct usb_action *zc3_init; | 7148 | const struct usb_action *zc3_init; |
7149 | int mode; | 7149 | int mode; |
7150 | __u8 retbyte; | 7150 | __u8 retbyte; |
7151 | static struct usb_action *init_tb[SENSOR_MAX][2] = { | 7151 | static const struct usb_action *init_tb[SENSOR_MAX][2] = { |
7152 | {cs2102_InitialScale, cs2102_Initial}, /* 0 */ | 7152 | {cs2102_InitialScale, cs2102_Initial}, /* 0 */ |
7153 | {cs2102K_InitialScale, cs2102K_Initial}, /* 1 */ | 7153 | {cs2102K_InitialScale, cs2102K_Initial}, /* 1 */ |
7154 | {gc0305_Initial, gc0305_InitialScale}, /* 2 */ | 7154 | {gc0305_Initial, gc0305_InitialScale}, /* 2 */ |
@@ -7451,13 +7451,13 @@ static int sd_querymenu(struct gspca_dev *gspca_dev, | |||
7451 | case V4L2_CID_POWER_LINE_FREQUENCY: | 7451 | case V4L2_CID_POWER_LINE_FREQUENCY: |
7452 | switch (menu->index) { | 7452 | switch (menu->index) { |
7453 | case 0: /* V4L2_CID_POWER_LINE_FREQUENCY_DISABLED */ | 7453 | case 0: /* V4L2_CID_POWER_LINE_FREQUENCY_DISABLED */ |
7454 | strcpy(menu->name, "NoFliker"); | 7454 | strcpy((char *) menu->name, "NoFliker"); |
7455 | return 0; | 7455 | return 0; |
7456 | case 1: /* V4L2_CID_POWER_LINE_FREQUENCY_50HZ */ | 7456 | case 1: /* V4L2_CID_POWER_LINE_FREQUENCY_50HZ */ |
7457 | strcpy(menu->name, "50 Hz"); | 7457 | strcpy((char *) menu->name, "50 Hz"); |
7458 | return 0; | 7458 | return 0; |
7459 | case 2: /* V4L2_CID_POWER_LINE_FREQUENCY_60HZ */ | 7459 | case 2: /* V4L2_CID_POWER_LINE_FREQUENCY_60HZ */ |
7460 | strcpy(menu->name, "60 Hz"); | 7460 | strcpy((char *) menu->name, "60 Hz"); |
7461 | return 0; | 7461 | return 0; |
7462 | } | 7462 | } |
7463 | break; | 7463 | break; |
@@ -7465,7 +7465,7 @@ static int sd_querymenu(struct gspca_dev *gspca_dev, | |||
7465 | return -EINVAL; | 7465 | return -EINVAL; |
7466 | } | 7466 | } |
7467 | 7467 | ||
7468 | static struct sd_desc sd_desc = { | 7468 | static const struct sd_desc sd_desc = { |
7469 | .name = MODULE_NAME, | 7469 | .name = MODULE_NAME, |
7470 | .ctrls = sd_ctrls, | 7470 | .ctrls = sd_ctrls, |
7471 | .nctrls = sizeof sd_ctrls / sizeof sd_ctrls[0], | 7471 | .nctrls = sizeof sd_ctrls / sizeof sd_ctrls[0], |
@@ -7480,7 +7480,7 @@ static struct sd_desc sd_desc = { | |||
7480 | }; | 7480 | }; |
7481 | 7481 | ||
7482 | #define DVNM(name) .driver_info = (kernel_ulong_t) name | 7482 | #define DVNM(name) .driver_info = (kernel_ulong_t) name |
7483 | static __devinitdata struct usb_device_id device_table[] = { | 7483 | static const __devinitdata struct usb_device_id device_table[] = { |
7484 | {USB_DEVICE(0x041e, 0x041e), DVNM("Creative WebCam Live!")}, | 7484 | {USB_DEVICE(0x041e, 0x041e), DVNM("Creative WebCam Live!")}, |
7485 | {USB_DEVICE(0x041e, 0x4017), DVNM("Creative Webcam Mobile PD1090")}, | 7485 | {USB_DEVICE(0x041e, 0x4017), DVNM("Creative Webcam Mobile PD1090")}, |
7486 | {USB_DEVICE(0x041e, 0x401c), DVNM("Creative NX")}, | 7486 | {USB_DEVICE(0x041e, 0x401c), DVNM("Creative NX")}, |