aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2008-07-06 06:04:39 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:17:24 -0400
commit814429501f65e3482adb8e7678660ceb7a2fc2e6 (patch)
treebae79121e8010f52c374c6ca68bac913ba8fce6f /drivers/media/video
parent80544d3c7a7ce32084c9137c96488704053772e3 (diff)
V4L/DVB (8204): gspca: Cleanup code.
spca508: Cleanup code. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/gspca/spca508.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/media/video/gspca/spca508.c b/drivers/media/video/gspca/spca508.c
index 169238d40c97..7f262f23841e 100644
--- a/drivers/media/video/gspca/spca508.c
+++ b/drivers/media/video/gspca/spca508.c
@@ -53,16 +53,16 @@ static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val);
53static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val); 53static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val);
54 54
55static struct ctrl sd_ctrls[] = { 55static struct ctrl sd_ctrls[] = {
56#define SD_BRIGHTNESS 0
57 { 56 {
58 { 57 {
59 .id = V4L2_CID_BRIGHTNESS, 58 .id = V4L2_CID_BRIGHTNESS,
60 .type = V4L2_CTRL_TYPE_INTEGER, 59 .type = V4L2_CTRL_TYPE_INTEGER,
61 .name = "Brightness", 60 .name = "Brightness",
62 .minimum = 0, 61 .minimum = 0,
63 .maximum = 0xff, 62 .maximum = 255,
64 .step = 1, 63 .step = 1,
65 .default_value = 0x80, 64#define BRIGHTNESS_DEF 128
65 .default_value = BRIGHTNESS_DEF,
66 }, 66 },
67 .set = sd_setbrightness, 67 .set = sd_setbrightness,
68 .get = sd_getbrightness, 68 .get = sd_getbrightness,
@@ -593,7 +593,7 @@ static const __u16 spca508_init_data[][3] =
593 /* Video drop enable, ISO streaming disable */ 593 /* Video drop enable, ISO streaming disable */
594 /* 53252 2165 */ 594 /* 53252 2165 */
595 /* UNKNOWN DIRECTION (URB_FUNCTION_SELECT_INTERFACE: (ALT=0) ) */ 595 /* UNKNOWN DIRECTION (URB_FUNCTION_SELECT_INTERFACE: (ALT=0) ) */
596 {0, 0} 596 {}
597}; 597};
598 598
599 599
@@ -764,8 +764,7 @@ static const __u16 spca508_sightcam_init_data[][3] = {
764 /*542 */ {0x0040, 0x8652}, 764 /*542 */ {0x0040, 0x8652},
765 /*543 */ {0x004c, 0x8653}, 765 /*543 */ {0x004c, 0x8653},
766 /*544 */ {0x0040, 0x8654}, 766 /*544 */ {0x0040, 0x8654},
767 767 {}
768 {0, 0}
769}; 768};
770 769
771static const __u16 spca508_sightcam2_init_data[][3] = { 770static const __u16 spca508_sightcam2_init_data[][3] = {
@@ -1485,6 +1484,13 @@ static int sd_config(struct gspca_dev *gspca_dev,
1485 vendor = id->idVendor; 1484 vendor = id->idVendor;
1486 product = id->idProduct; 1485 product = id->idProduct;
1487 switch (vendor) { 1486 switch (vendor) {
1487 case 0x0130: /* Clone webcam */
1488/* switch (product) { */
1489/* case 0x0130: */
1490 sd->subtype = HamaUSBSightcam; /* same as Hama 0010 */
1491/* break; */
1492/* } */
1493 break;
1488 case 0x041e: /* Creative cameras */ 1494 case 0x041e: /* Creative cameras */
1489/* switch (product) { */ 1495/* switch (product) { */
1490/* case 0x4018: */ 1496/* case 0x4018: */
@@ -1506,10 +1512,8 @@ static int sd_config(struct gspca_dev *gspca_dev,
1506/* break; */ 1512/* break; */
1507/* } */ 1513/* } */
1508 break; 1514 break;
1509 case 0x0130: /* Clone webcam */
1510 case 0x0af9: /* Hama cameras */ 1515 case 0x0af9: /* Hama cameras */
1511 switch (product) { 1516 switch (product) {
1512 case 0x0130:
1513 case 0x0010: 1517 case 0x0010:
1514 sd->subtype = HamaUSBSightcam; 1518 sd->subtype = HamaUSBSightcam;
1515 break; 1519 break;
@@ -1527,30 +1531,27 @@ static int sd_config(struct gspca_dev *gspca_dev,
1527 break; 1531 break;
1528 } 1532 }
1529 1533
1530 /* Read from global register the USB product and vendor IDs, just to */ 1534 /* Read from global register the USB product and vendor IDs, just to
1531 /* prove that we can communicate with the device. This works, which */ 1535 * prove that we can communicate with the device. This works, which
1532 /* confirms at we are communicating properly and that the device */ 1536 * confirms at we are communicating properly and that the device
1533 /* is a 508. */ 1537 * is a 508. */
1534 data1 = reg_read(dev, 0x8104); 1538 data1 = reg_read(dev, 0x8104);
1535 data2 = reg_read(dev, 0x8105); 1539 data2 = reg_read(dev, 0x8105);
1536 PDEBUG(D_PROBE, 1540 PDEBUG(D_PROBE, "Webcam Vendor ID: 0x%02x%02x", data2, data1);
1537 "Read from GLOBAL: USB Vendor ID 0x%02x%02x", data2, data1);
1538 1541
1539 data1 = reg_read(dev, 0x8106); 1542 data1 = reg_read(dev, 0x8106);
1540 data2 = reg_read(dev, 0x8107); 1543 data2 = reg_read(dev, 0x8107);
1541 PDEBUG(D_PROBE, 1544 PDEBUG(D_PROBE, "Webcam Product ID: 0x%02x%02x", data2, data1);
1542 "Read from GLOBAL: USB Product ID 0x%02x%02x", data2, data1);
1543 1545
1544 data1 = reg_read(dev, 0x8621); 1546 data1 = reg_read(dev, 0x8621);
1545 PDEBUG(D_PROBE, 1547 PDEBUG(D_PROBE, "Window 1 average luminance: %d", data1);
1546 "Read from GLOBAL: Window 1 average luminance %d", data1);
1547 1548
1548 cam = &gspca_dev->cam; 1549 cam = &gspca_dev->cam;
1549 cam->dev_name = (char *) id->driver_info; 1550 cam->dev_name = (char *) id->driver_info;
1550 cam->epaddr = 0x01; 1551 cam->epaddr = 0x01;
1551 cam->cam_mode = sif_mode; 1552 cam->cam_mode = sif_mode;
1552 cam->nmodes = sizeof sif_mode / sizeof sif_mode[0]; 1553 cam->nmodes = ARRAY_SIZE(sif_mode);
1553 sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value; 1554 sd->brightness = BRIGHTNESS_DEF;
1554 1555
1555 switch (sd->subtype) { 1556 switch (sd->subtype) {
1556 case ViewQuestVQ110: 1557 case ViewQuestVQ110:
@@ -1699,7 +1700,7 @@ static void setbrightness(struct gspca_dev *gspca_dev)
1699 struct sd *sd = (struct sd *) gspca_dev; 1700 struct sd *sd = (struct sd *) gspca_dev;
1700 __u8 brightness = sd->brightness; 1701 __u8 brightness = sd->brightness;
1701 1702
1702/* MX seem contrast */ 1703 /* MX seem contrast */
1703 reg_write(gspca_dev->dev, 0x8651, brightness); 1704 reg_write(gspca_dev->dev, 0x8651, brightness);
1704 reg_write(gspca_dev->dev, 0x8652, brightness); 1705 reg_write(gspca_dev->dev, 0x8652, brightness);
1705 reg_write(gspca_dev->dev, 0x8653, brightness); 1706 reg_write(gspca_dev->dev, 0x8653, brightness);
@@ -1749,14 +1750,13 @@ static const struct sd_desc sd_desc = {
1749/* -- module initialisation -- */ 1750/* -- module initialisation -- */
1750#define DVNM(name) .driver_info = (kernel_ulong_t) name 1751#define DVNM(name) .driver_info = (kernel_ulong_t) name
1751static const __devinitdata struct usb_device_id device_table[] = { 1752static const __devinitdata struct usb_device_id device_table[] = {
1753 {USB_DEVICE(0x0130, 0x0130), DVNM("Clone Digital Webcam 11043")},
1752 {USB_DEVICE(0x041e, 0x4018), DVNM("Creative Webcam Vista (PD1100)")}, 1754 {USB_DEVICE(0x041e, 0x4018), DVNM("Creative Webcam Vista (PD1100)")},
1753 {USB_DEVICE(0x0461, 0x0815), DVNM("Micro Innovation IC200")}, 1755 {USB_DEVICE(0x0461, 0x0815), DVNM("Micro Innovation IC200")},
1754 {USB_DEVICE(0x0733, 0x0110), DVNM("ViewQuest VQ110")}, 1756 {USB_DEVICE(0x0733, 0x0110), DVNM("ViewQuest VQ110")},
1755 {USB_DEVICE(0x0af9, 0x0010), DVNM("Hama USB Sightcam 100")}, 1757 {USB_DEVICE(0x0af9, 0x0010), DVNM("Hama USB Sightcam 100")},
1756 {USB_DEVICE(0x0af9, 0x0011), DVNM("Hama USB Sightcam 100")}, 1758 {USB_DEVICE(0x0af9, 0x0011), DVNM("Hama USB Sightcam 100")},
1757 {USB_DEVICE(0x8086, 0x0110), DVNM("Intel Easy PC Camera")}, 1759 {USB_DEVICE(0x8086, 0x0110), DVNM("Intel Easy PC Camera")},
1758 {USB_DEVICE(0x0130, 0x0130),
1759 DVNM("Clone Digital Webcam 11043 (spca508a)")},
1760 {} 1760 {}
1761}; 1761};
1762MODULE_DEVICE_TABLE(usb, device_table); 1762MODULE_DEVICE_TABLE(usb, device_table);