diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2009-01-10 13:54:44 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:42:31 -0400 |
commit | b3f5dbd0e1d4a1f9ed17cb40b9f789c606c44206 (patch) | |
tree | c33dde43526351f4634c74ac182acf8dad8474df /drivers | |
parent | ca5e578f503133a580fbd5bed39cecf1e3c6e3a2 (diff) |
V4L/DVB (10352): gspca - spca508: Cleanup code.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/gspca/spca508.c | 113 |
1 files changed, 56 insertions, 57 deletions
diff --git a/drivers/media/video/gspca/spca508.c b/drivers/media/video/gspca/spca508.c index 34e74004774b..bf7979da664a 100644 --- a/drivers/media/video/gspca/spca508.c +++ b/drivers/media/video/gspca/spca508.c | |||
@@ -101,8 +101,7 @@ static const struct v4l2_pix_format sif_mode[] = { | |||
101 | * Initialization data: this is the first set-up data written to the | 101 | * Initialization data: this is the first set-up data written to the |
102 | * device (before the open data). | 102 | * device (before the open data). |
103 | */ | 103 | */ |
104 | static const __u16 spca508_init_data[][3] = | 104 | static const u16 spca508_init_data[][2] = |
105 | #define IGN(x) /* nothing */ | ||
106 | { | 105 | { |
107 | /* line URB value, index */ | 106 | /* line URB value, index */ |
108 | /* 44274 1804 */ {0x0000, 0x870b}, | 107 | /* 44274 1804 */ {0x0000, 0x870b}, |
@@ -589,11 +588,10 @@ static const __u16 spca508_init_data[][3] = | |||
589 | {} | 588 | {} |
590 | }; | 589 | }; |
591 | 590 | ||
592 | |||
593 | /* | 591 | /* |
594 | * Initialization data for Intel EasyPC Camera CS110 | 592 | * Initialization data for Intel EasyPC Camera CS110 |
595 | */ | 593 | */ |
596 | static const __u16 spca508cs110_init_data[][3] = { | 594 | static const u16 spca508cs110_init_data[][2] = { |
597 | {0x0000, 0x870b}, /* Reset CTL3 */ | 595 | {0x0000, 0x870b}, /* Reset CTL3 */ |
598 | {0x0003, 0x8111}, /* Soft Reset compression, memory, TG & CDSP */ | 596 | {0x0003, 0x8111}, /* Soft Reset compression, memory, TG & CDSP */ |
599 | {0x0000, 0x8111}, /* Normal operation on reset */ | 597 | {0x0000, 0x8111}, /* Normal operation on reset */ |
@@ -677,7 +675,7 @@ static const __u16 spca508cs110_init_data[][3] = { | |||
677 | {} | 675 | {} |
678 | }; | 676 | }; |
679 | 677 | ||
680 | static const __u16 spca508_sightcam_init_data[][3] = { | 678 | static const u16 spca508_sightcam_init_data[][2] = { |
681 | /* This line seems to setup the frame/canvas */ | 679 | /* This line seems to setup the frame/canvas */ |
682 | /*368 */ {0x000f, 0x8402}, | 680 | /*368 */ {0x000f, 0x8402}, |
683 | 681 | ||
@@ -760,7 +758,7 @@ static const __u16 spca508_sightcam_init_data[][3] = { | |||
760 | {} | 758 | {} |
761 | }; | 759 | }; |
762 | 760 | ||
763 | static const __u16 spca508_sightcam2_init_data[][3] = { | 761 | static const u16 spca508_sightcam2_init_data[][2] = { |
764 | /* 35 */ {0x0020, 0x8112}, | 762 | /* 35 */ {0x0020, 0x8112}, |
765 | 763 | ||
766 | /* 36 */ {0x000f, 0x8402}, | 764 | /* 36 */ {0x000f, 0x8402}, |
@@ -1107,7 +1105,7 @@ static const __u16 spca508_sightcam2_init_data[][3] = { | |||
1107 | /* | 1105 | /* |
1108 | * Initialization data for Creative Webcam Vista | 1106 | * Initialization data for Creative Webcam Vista |
1109 | */ | 1107 | */ |
1110 | static const __u16 spca508_vista_init_data[][3] = { | 1108 | static const u16 spca508_vista_init_data[][2] = { |
1111 | {0x0008, 0x8200}, /* Clear register */ | 1109 | {0x0008, 0x8200}, /* Clear register */ |
1112 | {0x0000, 0x870b}, /* Reset CTL3 */ | 1110 | {0x0000, 0x870b}, /* Reset CTL3 */ |
1113 | {0x0020, 0x8112}, /* Video Drop packet enable */ | 1111 | {0x0020, 0x8112}, /* Video Drop packet enable */ |
@@ -1309,18 +1307,18 @@ static const __u16 spca508_vista_init_data[][3] = { | |||
1309 | 1307 | ||
1310 | {0x0050, 0x8703}, | 1308 | {0x0050, 0x8703}, |
1311 | {0x0002, 0x8704}, /* External input CKIx1 */ | 1309 | {0x0002, 0x8704}, /* External input CKIx1 */ |
1312 | {0x0001, 0x870C}, /* Select CKOx2 output */ | 1310 | {0x0001, 0x870c}, /* Select CKOx2 output */ |
1313 | {0x009A, 0x8600}, /* Line memory Read Counter (L) */ | 1311 | {0x009a, 0x8600}, /* Line memory Read Counter (L) */ |
1314 | {0x0001, 0x8606}, /* 1 Line memory Read Counter (H) Result: (d)410 */ | 1312 | {0x0001, 0x8606}, /* 1 Line memory Read Counter (H) Result: (d)410 */ |
1315 | {0x0023, 0x8601}, | 1313 | {0x0023, 0x8601}, |
1316 | {0x0010, 0x8602}, | 1314 | {0x0010, 0x8602}, |
1317 | {0x000A, 0x8603}, | 1315 | {0x000a, 0x8603}, |
1318 | {0x009A, 0x8600}, | 1316 | {0x009A, 0x8600}, |
1319 | {0x0001, 0x865B}, /* 1 Horizontal Offset for Valid Pixel(L) */ | 1317 | {0x0001, 0x865b}, /* 1 Horizontal Offset for Valid Pixel(L) */ |
1320 | {0x0003, 0x865C}, /* Vertical offset for valid lines (L) */ | 1318 | {0x0003, 0x865c}, /* Vertical offset for valid lines (L) */ |
1321 | {0x0058, 0x865D}, /* Horizontal valid pixels window (L) */ | 1319 | {0x0058, 0x865d}, /* Horizontal valid pixels window (L) */ |
1322 | {0x0048, 0x865E}, /* Vertical valid lines window (L) */ | 1320 | {0x0048, 0x865e}, /* Vertical valid lines window (L) */ |
1323 | {0x0000, 0x865F}, | 1321 | {0x0000, 0x865f}, |
1324 | 1322 | ||
1325 | {0x0006, 0x8660}, | 1323 | {0x0006, 0x8660}, |
1326 | /* Enable nibble data input, select nibble input order */ | 1324 | /* Enable nibble data input, select nibble input order */ |
@@ -1328,63 +1326,63 @@ static const __u16 spca508_vista_init_data[][3] = { | |||
1328 | {0x0013, 0x8608}, /* A11 Coeficients for color correction */ | 1326 | {0x0013, 0x8608}, /* A11 Coeficients for color correction */ |
1329 | {0x0028, 0x8609}, | 1327 | {0x0028, 0x8609}, |
1330 | /* Note: these values are confirmed at the end of array */ | 1328 | /* Note: these values are confirmed at the end of array */ |
1331 | {0x0005, 0x860A}, /* ... */ | 1329 | {0x0005, 0x860a}, /* ... */ |
1332 | {0x0025, 0x860B}, | 1330 | {0x0025, 0x860b}, |
1333 | {0x00E1, 0x860C}, | 1331 | {0x00e1, 0x860c}, |
1334 | {0x00FA, 0x860D}, | 1332 | {0x00fa, 0x860D}, |
1335 | {0x00F4, 0x860E}, | 1333 | {0x00f4, 0x860e}, |
1336 | {0x00E8, 0x860F}, | 1334 | {0x00e8, 0x860f}, |
1337 | {0x0025, 0x8610}, /* A33 Coef. */ | 1335 | {0x0025, 0x8610}, /* A33 Coef. */ |
1338 | {0x00FC, 0x8611}, /* White balance offset: R */ | 1336 | {0x00fc, 0x8611}, /* White balance offset: R */ |
1339 | {0x0001, 0x8612}, /* White balance offset: Gr */ | 1337 | {0x0001, 0x8612}, /* White balance offset: Gr */ |
1340 | {0x00FE, 0x8613}, /* White balance offset: B */ | 1338 | {0x00fe, 0x8613}, /* White balance offset: B */ |
1341 | {0x0000, 0x8614}, /* White balance offset: Gb */ | 1339 | {0x0000, 0x8614}, /* White balance offset: Gb */ |
1342 | 1340 | ||
1343 | {0x0064, 0x8651}, /* R gain for white balance (L) */ | 1341 | {0x0064, 0x8651}, /* R gain for white balance (L) */ |
1344 | {0x0040, 0x8652}, /* Gr gain for white balance (L) */ | 1342 | {0x0040, 0x8652}, /* Gr gain for white balance (L) */ |
1345 | {0x0066, 0x8653}, /* B gain for white balance (L) */ | 1343 | {0x0066, 0x8653}, /* B gain for white balance (L) */ |
1346 | {0x0040, 0x8654}, /* Gb gain for white balance (L) */ | 1344 | {0x0040, 0x8654}, /* Gb gain for white balance (L) */ |
1347 | {0x0001, 0x863F}, /* Enable fixed gamma correction */ | 1345 | {0x0001, 0x863f}, /* Enable fixed gamma correction */ |
1348 | 1346 | ||
1349 | {0x00A1, 0x8656}, /* Size - Window1: 256x256, Window2: 128x128 */ | 1347 | {0x00a1, 0x8656}, /* Size - Window1: 256x256, Window2: 128x128 */ |
1350 | /* UV division: UV no change, Enable New edge enhancement */ | 1348 | /* UV division: UV no change, Enable New edge enhancement */ |
1351 | {0x0018, 0x8657}, /* Edge gain high threshold */ | 1349 | {0x0018, 0x8657}, /* Edge gain high threshold */ |
1352 | {0x0020, 0x8658}, /* Edge gain low threshold */ | 1350 | {0x0020, 0x8658}, /* Edge gain low threshold */ |
1353 | {0x000A, 0x8659}, /* Edge bandwidth high threshold */ | 1351 | {0x000A, 0x8659}, /* Edge bandwidth high threshold */ |
1354 | {0x0005, 0x865A}, /* Edge bandwidth low threshold */ | 1352 | {0x0005, 0x865a}, /* Edge bandwidth low threshold */ |
1355 | {0x0064, 0x8607}, /* UV filter enable */ | 1353 | {0x0064, 0x8607}, /* UV filter enable */ |
1356 | 1354 | ||
1357 | {0x0016, 0x8660}, | 1355 | {0x0016, 0x8660}, |
1358 | {0x0000, 0x86B0}, /* Bad pixels compensation address */ | 1356 | {0x0000, 0x86b0}, /* Bad pixels compensation address */ |
1359 | {0x00DC, 0x86B1}, /* X coord for bad pixels compensation (L) */ | 1357 | {0x00dc, 0x86b1}, /* X coord for bad pixels compensation (L) */ |
1360 | {0x0000, 0x86B2}, | 1358 | {0x0000, 0x86b2}, |
1361 | {0x0009, 0x86B3}, /* Y coord for bad pixels compensation (L) */ | 1359 | {0x0009, 0x86b3}, /* Y coord for bad pixels compensation (L) */ |
1362 | {0x0000, 0x86B4}, | 1360 | {0x0000, 0x86b4}, |
1363 | 1361 | ||
1364 | {0x0001, 0x86B0}, | 1362 | {0x0001, 0x86b0}, |
1365 | {0x00F5, 0x86B1}, | 1363 | {0x00f5, 0x86b1}, |
1366 | {0x0000, 0x86B2}, | 1364 | {0x0000, 0x86b2}, |
1367 | {0x00C6, 0x86B3}, | 1365 | {0x00c6, 0x86b3}, |
1368 | {0x0000, 0x86B4}, | 1366 | {0x0000, 0x86b4}, |
1369 | 1367 | ||
1370 | {0x0002, 0x86B0}, | 1368 | {0x0002, 0x86b0}, |
1371 | {0x001C, 0x86B1}, | 1369 | {0x001c, 0x86b1}, |
1372 | {0x0001, 0x86B2}, | 1370 | {0x0001, 0x86b2}, |
1373 | {0x00D7, 0x86B3}, | 1371 | {0x00d7, 0x86b3}, |
1374 | {0x0000, 0x86B4}, | 1372 | {0x0000, 0x86b4}, |
1375 | 1373 | ||
1376 | {0x0003, 0x86B0}, | 1374 | {0x0003, 0x86b0}, |
1377 | {0x001C, 0x86B1}, | 1375 | {0x001c, 0x86b1}, |
1378 | {0x0001, 0x86B2}, | 1376 | {0x0001, 0x86b2}, |
1379 | {0x00D8, 0x86B3}, | 1377 | {0x00d8, 0x86b3}, |
1380 | {0x0000, 0x86B4}, | 1378 | {0x0000, 0x86b4}, |
1381 | 1379 | ||
1382 | {0x0004, 0x86B0}, | 1380 | {0x0004, 0x86b0}, |
1383 | {0x001D, 0x86B1}, | 1381 | {0x001d, 0x86b1}, |
1384 | {0x0001, 0x86B2}, | 1382 | {0x0001, 0x86b2}, |
1385 | {0x00D8, 0x86B3}, | 1383 | {0x00d8, 0x86b3}, |
1386 | {0x0000, 0x86B4}, | 1384 | {0x0000, 0x86b4}, |
1387 | {0x001E, 0x8660}, | 1385 | {0x001e, 0x8660}, |
1388 | 1386 | ||
1389 | /* READ { 0, 0x0000, 0x8608 } -> | 1387 | /* READ { 0, 0x0000, 0x8608 } -> |
1390 | 0000: 13 */ | 1388 | 0000: 13 */ |
@@ -1449,7 +1447,7 @@ static int reg_read(struct gspca_dev *gspca_dev, | |||
1449 | } | 1447 | } |
1450 | 1448 | ||
1451 | static int write_vector(struct gspca_dev *gspca_dev, | 1449 | static int write_vector(struct gspca_dev *gspca_dev, |
1452 | const __u16 data[][3]) | 1450 | const u16 data[][2]) |
1453 | { | 1451 | { |
1454 | struct usb_device *dev = gspca_dev->dev; | 1452 | struct usb_device *dev = gspca_dev->dev; |
1455 | int ret, i = 0; | 1453 | int ret, i = 0; |
@@ -1666,6 +1664,7 @@ static struct usb_driver sd_driver = { | |||
1666 | static int __init sd_mod_init(void) | 1664 | static int __init sd_mod_init(void) |
1667 | { | 1665 | { |
1668 | int ret; | 1666 | int ret; |
1667 | |||
1669 | ret = usb_register(&sd_driver); | 1668 | ret = usb_register(&sd_driver); |
1670 | if (ret < 0) | 1669 | if (ret < 0) |
1671 | return ret; | 1670 | return ret; |