diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2010-01-10 12:39:24 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:10:31 -0500 |
commit | 6f081264f835467a3b69edc71753dac9d3ff770a (patch) | |
tree | 8375573e83033eac2850e7970aed7d3d5d4fce10 /drivers/media/video/gspca/sunplus.c | |
parent | 509245171ae76e08f657fe825b739d99f5701f09 (diff) |
V4L/DVB (13924): gspca - sunplus: Optimize and remove unused sequences.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/sunplus.c')
-rw-r--r-- | drivers/media/video/gspca/sunplus.c | 183 |
1 files changed, 19 insertions, 164 deletions
diff --git a/drivers/media/video/gspca/sunplus.c b/drivers/media/video/gspca/sunplus.c index 472f56883016..0c786e00ebcf 100644 --- a/drivers/media/video/gspca/sunplus.c +++ b/drivers/media/video/gspca/sunplus.c | |||
@@ -267,142 +267,6 @@ static const struct cmd spca504A_clicksmart420_open_data[] = { | |||
267 | {0x06, 0x0000, 0x0000}, | 267 | {0x06, 0x0000, 0x0000}, |
268 | {0x00, 0x0004, 0x2880}, | 268 | {0x00, 0x0004, 0x2880}, |
269 | {0x00, 0x0001, 0x2881}, | 269 | {0x00, 0x0001, 0x2881}, |
270 | /* look like setting a qTable */ | ||
271 | {0x00, 0x0006, 0x2800}, | ||
272 | {0x00, 0x0004, 0x2801}, | ||
273 | {0x00, 0x0004, 0x2802}, | ||
274 | {0x00, 0x0006, 0x2803}, | ||
275 | {0x00, 0x000a, 0x2804}, | ||
276 | {0x00, 0x0010, 0x2805}, | ||
277 | {0x00, 0x0014, 0x2806}, | ||
278 | {0x00, 0x0018, 0x2807}, | ||
279 | {0x00, 0x0005, 0x2808}, | ||
280 | {0x00, 0x0005, 0x2809}, | ||
281 | {0x00, 0x0006, 0x280a}, | ||
282 | {0x00, 0x0008, 0x280b}, | ||
283 | {0x00, 0x000a, 0x280c}, | ||
284 | {0x00, 0x0017, 0x280d}, | ||
285 | {0x00, 0x0018, 0x280e}, | ||
286 | {0x00, 0x0016, 0x280f}, | ||
287 | |||
288 | {0x00, 0x0006, 0x2810}, | ||
289 | {0x00, 0x0005, 0x2811}, | ||
290 | {0x00, 0x0006, 0x2812}, | ||
291 | {0x00, 0x000a, 0x2813}, | ||
292 | {0x00, 0x0010, 0x2814}, | ||
293 | {0x00, 0x0017, 0x2815}, | ||
294 | {0x00, 0x001c, 0x2816}, | ||
295 | {0x00, 0x0016, 0x2817}, | ||
296 | {0x00, 0x0006, 0x2818}, | ||
297 | {0x00, 0x0007, 0x2819}, | ||
298 | {0x00, 0x0009, 0x281a}, | ||
299 | {0x00, 0x000c, 0x281b}, | ||
300 | {0x00, 0x0014, 0x281c}, | ||
301 | {0x00, 0x0023, 0x281d}, | ||
302 | {0x00, 0x0020, 0x281e}, | ||
303 | {0x00, 0x0019, 0x281f}, | ||
304 | |||
305 | {0x00, 0x0007, 0x2820}, | ||
306 | {0x00, 0x0009, 0x2821}, | ||
307 | {0x00, 0x000f, 0x2822}, | ||
308 | {0x00, 0x0016, 0x2823}, | ||
309 | {0x00, 0x001b, 0x2824}, | ||
310 | {0x00, 0x002c, 0x2825}, | ||
311 | {0x00, 0x0029, 0x2826}, | ||
312 | {0x00, 0x001f, 0x2827}, | ||
313 | {0x00, 0x000a, 0x2828}, | ||
314 | {0x00, 0x000e, 0x2829}, | ||
315 | {0x00, 0x0016, 0x282a}, | ||
316 | {0x00, 0x001a, 0x282b}, | ||
317 | {0x00, 0x0020, 0x282c}, | ||
318 | {0x00, 0x002a, 0x282d}, | ||
319 | {0x00, 0x002d, 0x282e}, | ||
320 | {0x00, 0x0025, 0x282f}, | ||
321 | |||
322 | {0x00, 0x0014, 0x2830}, | ||
323 | {0x00, 0x001a, 0x2831}, | ||
324 | {0x00, 0x001f, 0x2832}, | ||
325 | {0x00, 0x0023, 0x2833}, | ||
326 | {0x00, 0x0029, 0x2834}, | ||
327 | {0x00, 0x0030, 0x2835}, | ||
328 | {0x00, 0x0030, 0x2836}, | ||
329 | {0x00, 0x0028, 0x2837}, | ||
330 | {0x00, 0x001d, 0x2838}, | ||
331 | {0x00, 0x0025, 0x2839}, | ||
332 | {0x00, 0x0026, 0x283a}, | ||
333 | {0x00, 0x0027, 0x283b}, | ||
334 | {0x00, 0x002d, 0x283c}, | ||
335 | {0x00, 0x0028, 0x283d}, | ||
336 | {0x00, 0x0029, 0x283e}, | ||
337 | {0x00, 0x0028, 0x283f}, | ||
338 | |||
339 | {0x00, 0x0007, 0x2840}, | ||
340 | {0x00, 0x0007, 0x2841}, | ||
341 | {0x00, 0x000a, 0x2842}, | ||
342 | {0x00, 0x0013, 0x2843}, | ||
343 | {0x00, 0x0028, 0x2844}, | ||
344 | {0x00, 0x0028, 0x2845}, | ||
345 | {0x00, 0x0028, 0x2846}, | ||
346 | {0x00, 0x0028, 0x2847}, | ||
347 | {0x00, 0x0007, 0x2848}, | ||
348 | {0x00, 0x0008, 0x2849}, | ||
349 | {0x00, 0x000a, 0x284a}, | ||
350 | {0x00, 0x001a, 0x284b}, | ||
351 | {0x00, 0x0028, 0x284c}, | ||
352 | {0x00, 0x0028, 0x284d}, | ||
353 | {0x00, 0x0028, 0x284e}, | ||
354 | {0x00, 0x0028, 0x284f}, | ||
355 | |||
356 | {0x00, 0x000a, 0x2850}, | ||
357 | {0x00, 0x000a, 0x2851}, | ||
358 | {0x00, 0x0016, 0x2852}, | ||
359 | {0x00, 0x0028, 0x2853}, | ||
360 | {0x00, 0x0028, 0x2854}, | ||
361 | {0x00, 0x0028, 0x2855}, | ||
362 | {0x00, 0x0028, 0x2856}, | ||
363 | {0x00, 0x0028, 0x2857}, | ||
364 | {0x00, 0x0013, 0x2858}, | ||
365 | {0x00, 0x001a, 0x2859}, | ||
366 | {0x00, 0x0028, 0x285a}, | ||
367 | {0x00, 0x0028, 0x285b}, | ||
368 | {0x00, 0x0028, 0x285c}, | ||
369 | {0x00, 0x0028, 0x285d}, | ||
370 | {0x00, 0x0028, 0x285e}, | ||
371 | {0x00, 0x0028, 0x285f}, | ||
372 | |||
373 | {0x00, 0x0028, 0x2860}, | ||
374 | {0x00, 0x0028, 0x2861}, | ||
375 | {0x00, 0x0028, 0x2862}, | ||
376 | {0x00, 0x0028, 0x2863}, | ||
377 | {0x00, 0x0028, 0x2864}, | ||
378 | {0x00, 0x0028, 0x2865}, | ||
379 | {0x00, 0x0028, 0x2866}, | ||
380 | {0x00, 0x0028, 0x2867}, | ||
381 | {0x00, 0x0028, 0x2868}, | ||
382 | {0x00, 0x0028, 0x2869}, | ||
383 | {0x00, 0x0028, 0x286a}, | ||
384 | {0x00, 0x0028, 0x286b}, | ||
385 | {0x00, 0x0028, 0x286c}, | ||
386 | {0x00, 0x0028, 0x286d}, | ||
387 | {0x00, 0x0028, 0x286e}, | ||
388 | {0x00, 0x0028, 0x286f}, | ||
389 | |||
390 | {0x00, 0x0028, 0x2870}, | ||
391 | {0x00, 0x0028, 0x2871}, | ||
392 | {0x00, 0x0028, 0x2872}, | ||
393 | {0x00, 0x0028, 0x2873}, | ||
394 | {0x00, 0x0028, 0x2874}, | ||
395 | {0x00, 0x0028, 0x2875}, | ||
396 | {0x00, 0x0028, 0x2876}, | ||
397 | {0x00, 0x0028, 0x2877}, | ||
398 | {0x00, 0x0028, 0x2878}, | ||
399 | {0x00, 0x0028, 0x2879}, | ||
400 | {0x00, 0x0028, 0x287a}, | ||
401 | {0x00, 0x0028, 0x287b}, | ||
402 | {0x00, 0x0028, 0x287c}, | ||
403 | {0x00, 0x0028, 0x287d}, | ||
404 | {0x00, 0x0028, 0x287e}, | ||
405 | {0x00, 0x0028, 0x287f}, | ||
406 | 270 | ||
407 | {0xa0, 0x0000, 0x0503}, | 271 | {0xa0, 0x0000, 0x0503}, |
408 | }; | 272 | }; |
@@ -622,6 +486,20 @@ static void spca504_acknowledged_command(struct gspca_dev *gspca_dev, | |||
622 | PDEBUG(D_FRAM, "after wait 0x%04x", notdone); | 486 | PDEBUG(D_FRAM, "after wait 0x%04x", notdone); |
623 | } | 487 | } |
624 | 488 | ||
489 | static void spca504_read_info(struct gspca_dev *gspca_dev) | ||
490 | { | ||
491 | int i; | ||
492 | u8 info[6]; | ||
493 | |||
494 | for (i = 0; i < 6; i++) | ||
495 | info[i] = reg_r_1(gspca_dev, i); | ||
496 | PDEBUG(D_STREAM, | ||
497 | "Read info: %d %d %d %d %d %d." | ||
498 | " Should be 1,0,2,2,0,0", | ||
499 | info[0], info[1], info[2], | ||
500 | info[3], info[4], info[5]); | ||
501 | } | ||
502 | |||
625 | static void spca504A_acknowledged_command(struct gspca_dev *gspca_dev, | 503 | static void spca504A_acknowledged_command(struct gspca_dev *gspca_dev, |
626 | u8 req, | 504 | u8 req, |
627 | u16 idx, u16 val, u16 endcode, u8 count) | 505 | u16 idx, u16 val, u16 endcode, u8 count) |
@@ -881,8 +759,6 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
881 | static int sd_init(struct gspca_dev *gspca_dev) | 759 | static int sd_init(struct gspca_dev *gspca_dev) |
882 | { | 760 | { |
883 | struct sd *sd = (struct sd *) gspca_dev; | 761 | struct sd *sd = (struct sd *) gspca_dev; |
884 | int i; | ||
885 | u8 info[6]; | ||
886 | 762 | ||
887 | switch (sd->bridge) { | 763 | switch (sd->bridge) { |
888 | case BRIDGE_SPCA504B: | 764 | case BRIDGE_SPCA504B: |
@@ -924,15 +800,8 @@ static int sd_init(struct gspca_dev *gspca_dev) | |||
924 | /* case BRIDGE_SPCA504: */ | 800 | /* case BRIDGE_SPCA504: */ |
925 | PDEBUG(D_STREAM, "Opening SPCA504"); | 801 | PDEBUG(D_STREAM, "Opening SPCA504"); |
926 | if (sd->subtype == AiptekMiniPenCam13) { | 802 | if (sd->subtype == AiptekMiniPenCam13) { |
927 | /*****************************/ | 803 | spca504_read_info(gspca_dev); |
928 | for (i = 0; i < 6; i++) | 804 | |
929 | info[i] = reg_r_1(gspca_dev, i); | ||
930 | PDEBUG(D_STREAM, | ||
931 | "Read info: %d %d %d %d %d %d." | ||
932 | " Should be 1,0,2,2,0,0", | ||
933 | info[0], info[1], info[2], | ||
934 | info[3], info[4], info[5]); | ||
935 | /* spca504a aiptek */ | ||
936 | /* Set AE AWB Banding Type 3-> 50Hz 2-> 60Hz */ | 805 | /* Set AE AWB Banding Type 3-> 50Hz 2-> 60Hz */ |
937 | spca504A_acknowledged_command(gspca_dev, 0x24, | 806 | spca504A_acknowledged_command(gspca_dev, 0x24, |
938 | 8, 3, 0x9e, 1); | 807 | 8, 3, 0x9e, 1); |
@@ -971,8 +840,6 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
971 | { | 840 | { |
972 | struct sd *sd = (struct sd *) gspca_dev; | 841 | struct sd *sd = (struct sd *) gspca_dev; |
973 | int enable; | 842 | int enable; |
974 | int i; | ||
975 | u8 info[6]; | ||
976 | 843 | ||
977 | /* create the JPEG header */ | 844 | /* create the JPEG header */ |
978 | sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL); | 845 | sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL); |
@@ -1008,14 +875,8 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
1008 | break; | 875 | break; |
1009 | case BRIDGE_SPCA504: | 876 | case BRIDGE_SPCA504: |
1010 | if (sd->subtype == AiptekMiniPenCam13) { | 877 | if (sd->subtype == AiptekMiniPenCam13) { |
1011 | for (i = 0; i < 6; i++) | 878 | spca504_read_info(gspca_dev); |
1012 | info[i] = reg_r_1(gspca_dev, i); | 879 | |
1013 | PDEBUG(D_STREAM, | ||
1014 | "Read info: %d %d %d %d %d %d." | ||
1015 | " Should be 1,0,2,2,0,0", | ||
1016 | info[0], info[1], info[2], | ||
1017 | info[3], info[4], info[5]); | ||
1018 | /* spca504a aiptek */ | ||
1019 | /* Set AE AWB Banding Type 3-> 50Hz 2-> 60Hz */ | 880 | /* Set AE AWB Banding Type 3-> 50Hz 2-> 60Hz */ |
1020 | spca504A_acknowledged_command(gspca_dev, 0x24, | 881 | spca504A_acknowledged_command(gspca_dev, 0x24, |
1021 | 8, 3, 0x9e, 1); | 882 | 8, 3, 0x9e, 1); |
@@ -1026,13 +887,7 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
1026 | 0, 0, 0x9d, 1); | 887 | 0, 0, 0x9d, 1); |
1027 | } else { | 888 | } else { |
1028 | spca504_acknowledged_command(gspca_dev, 0x24, 8, 3); | 889 | spca504_acknowledged_command(gspca_dev, 0x24, 8, 3); |
1029 | for (i = 0; i < 6; i++) | 890 | spca504_read_info(gspca_dev); |
1030 | info[i] = reg_r_1(gspca_dev, i); | ||
1031 | PDEBUG(D_STREAM, | ||
1032 | "Read info: %d %d %d %d %d %d." | ||
1033 | " Should be 1,0,2,2,0,0", | ||
1034 | info[0], info[1], info[2], | ||
1035 | info[3], info[4], info[5]); | ||
1036 | spca504_acknowledged_command(gspca_dev, 0x24, 8, 3); | 891 | spca504_acknowledged_command(gspca_dev, 0x24, 8, 3); |
1037 | spca504_acknowledged_command(gspca_dev, 0x24, 0, 0); | 892 | spca504_acknowledged_command(gspca_dev, 0x24, 0, 0); |
1038 | } | 893 | } |