aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/zc3xx.c
diff options
context:
space:
mode:
authorJean-François Moine <moinejf@free.fr>2011-02-26 11:56:20 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 03:54:41 -0400
commit4e5144eef436720b08f7bdb1beba4960af23c737 (patch)
tree41b05fc20ab895e20a0b258cb11288ef9788b610 /drivers/media/video/gspca/zc3xx.c
parent170960fa9a4688299350ea356e4e5a3e76d15711 (diff)
[media] gspca - zc3xx: Cleanup source
- change some comments and copyright - change an erroneous register name - change hdcs2020b to hdcs2020 Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/zc3xx.c')
-rw-r--r--drivers/media/video/gspca/zc3xx.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c
index b2014915f9c..6dcb1cf11b5 100644
--- a/drivers/media/video/gspca/zc3xx.c
+++ b/drivers/media/video/gspca/zc3xx.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Z-Star/Vimicro zc301/zc302p/vc30x library 2 * Z-Star/Vimicro zc301/zc302p/vc30x library
3 * 3 *
4 * Copyright (C) 2009-2010 Jean-Francois Moine <http://moinejf.free.fr> 4 * Copyright (C) 2009-2011 Jean-Francois Moine <http://moinejf.free.fr>
5 * Copyright (C) 2004 2005 2006 Michel Xhaard mxhaard@magic.fr 5 * Copyright (C) 2004 2005 2006 Michel Xhaard mxhaard@magic.fr
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
@@ -73,7 +73,7 @@ enum sensors {
73 SENSOR_CS2102K, 73 SENSOR_CS2102K,
74 SENSOR_GC0303, 74 SENSOR_GC0303,
75 SENSOR_GC0305, 75 SENSOR_GC0305,
76 SENSOR_HDCS2020b, 76 SENSOR_HDCS2020,
77 SENSOR_HV7131B, 77 SENSOR_HV7131B,
78 SENSOR_HV7131R, 78 SENSOR_HV7131R,
79 SENSOR_ICM105A, 79 SENSOR_ICM105A,
@@ -1498,7 +1498,7 @@ static const struct usb_action gc0305_NoFliker[] = {
1498 {} 1498 {}
1499}; 1499};
1500 1500
1501static const struct usb_action hdcs2020b_InitialScale[] = { 1501static const struct usb_action hdcs2020_InitialScale[] = {
1502 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, 1502 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1503 {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT}, 1503 {0xa0, 0x11, ZC3XX_R002_CLOCKSELECT},
1504 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* qtable 0x05 */ 1504 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, /* qtable 0x05 */
@@ -1630,7 +1630,7 @@ static const struct usb_action hdcs2020b_InitialScale[] = {
1630 {0xa0, 0x40, ZC3XX_R118_BGAIN}, 1630 {0xa0, 0x40, ZC3XX_R118_BGAIN},
1631 {} 1631 {}
1632}; 1632};
1633static const struct usb_action hdcs2020b_Initial[] = { 1633static const struct usb_action hdcs2020_Initial[] = {
1634 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL}, 1634 {0xa0, 0x01, ZC3XX_R000_SYSTEMCONTROL},
1635 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT}, 1635 {0xa0, 0x00, ZC3XX_R002_CLOCKSELECT},
1636 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING}, 1636 {0xa0, 0x03, ZC3XX_R008_CLOCKSETTING},
@@ -1758,7 +1758,7 @@ static const struct usb_action hdcs2020b_Initial[] = {
1758 {0xa0, 0x40, ZC3XX_R118_BGAIN}, 1758 {0xa0, 0x40, ZC3XX_R118_BGAIN},
1759 {} 1759 {}
1760}; 1760};
1761static const struct usb_action hdcs2020b_50HZ[] = { 1761static const struct usb_action hdcs2020_50HZ[] = {
1762 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ 1762 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1763 {0xaa, 0x13, 0x0018}, /* 00,13,18,aa */ 1763 {0xaa, 0x13, 0x0018}, /* 00,13,18,aa */
1764 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */ 1764 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
@@ -1779,7 +1779,7 @@ static const struct usb_action hdcs2020b_50HZ[] = {
1779 {0xa0, 0x2f, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2f,cc */ 1779 {0xa0, 0x2f, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2f,cc */
1780 {} 1780 {}
1781}; 1781};
1782static const struct usb_action hdcs2020b_60HZ[] = { 1782static const struct usb_action hdcs2020_60HZ[] = {
1783 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ 1783 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1784 {0xaa, 0x13, 0x0031}, /* 00,13,31,aa */ 1784 {0xaa, 0x13, 0x0031}, /* 00,13,31,aa */
1785 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */ 1785 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
@@ -1800,7 +1800,7 @@ static const struct usb_action hdcs2020b_60HZ[] = {
1800 {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2c,cc */ 1800 {0xa0, 0x2c, ZC3XX_R01F_HSYNC_2}, /* 00,1f,2c,cc */
1801 {} 1801 {}
1802}; 1802};
1803static const struct usb_action hdcs2020b_NoFliker[] = { 1803static const struct usb_action hdcs2020_NoFliker[] = {
1804 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */ 1804 {0xa0, 0x00, ZC3XX_R019_AUTOADJUSTFPS}, /* 00,19,00,cc */
1805 {0xaa, 0x13, 0x0010}, /* 00,13,10,aa */ 1805 {0xaa, 0x13, 0x0010}, /* 00,13,10,aa */
1806 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */ 1806 {0xaa, 0x14, 0x0001}, /* 00,14,01,aa */
@@ -2126,7 +2126,6 @@ static const struct usb_action hv7131r_Initial[] = {
2126 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW}, 2126 {0xa0, 0x80, ZC3XX_R004_FRAMEWIDTHLOW},
2127 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH}, 2127 {0xa0, 0x01, ZC3XX_R005_FRAMEHEIGHTHIGH},
2128 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW}, 2128 {0xa0, 0xe0, ZC3XX_R006_FRAMEHEIGHTLOW},
2129
2130 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW}, 2129 {0xa0, 0x00, ZC3XX_R098_WINYSTARTLOW},
2131 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW}, 2130 {0xa0, 0x00, ZC3XX_R09A_WINXSTARTLOW},
2132 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH}, 2131 {0xa0, 0x01, ZC3XX_R09B_WINHEIGHTHIGH},
@@ -2878,7 +2877,7 @@ static const struct usb_action mc501cb_Initial[] = {
2878 {0xaa, 0x11, 0x0001}, /* 00,11,01,aa */ 2877 {0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
2879 {0xaa, 0x30, 0x0000}, /* 00,30,00,aa */ 2878 {0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
2880 {0xaa, 0x60, 0x0000}, /* 00,60,00,aa */ 2879 {0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
2881 {0xaa, 0xa0, ZC3XX_R01A_LASTFRAMESTATE}, /* 00,a0,1a,aa */ 2880 {0xaa, 0xa0, 0x001a}, /* 00,a0,1a,aa */
2882 {0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */ 2881 {0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
2883 {0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */ 2882 {0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
2884 {0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */ 2883 {0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
@@ -2998,7 +2997,7 @@ static const struct usb_action mc501cb_InitialScale[] = { /* 320x240 */
2998 {0xaa, 0x11, 0x0001}, /* 00,11,01,aa */ 2997 {0xaa, 0x11, 0x0001}, /* 00,11,01,aa */
2999 {0xaa, 0x30, 0x0000}, /* 00,30,00,aa */ 2998 {0xaa, 0x30, 0x0000}, /* 00,30,00,aa */
3000 {0xaa, 0x60, 0x0000}, /* 00,60,00,aa */ 2999 {0xaa, 0x60, 0x0000}, /* 00,60,00,aa */
3001 {0xaa, 0xa0, ZC3XX_R01A_LASTFRAMESTATE}, /* 00,a0,1a,aa */ 3000 {0xaa, 0xa0, 0x001a}, /* 00,a0,1a,aa */
3002 {0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */ 3001 {0xaa, 0xa1, 0x0000}, /* 00,a1,00,aa */
3003 {0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */ 3002 {0xaa, 0xa2, 0x003f}, /* 00,a2,3f,aa */
3004 {0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */ 3003 {0xaa, 0xa3, 0x0028}, /* 00,a3,28,aa */
@@ -3310,7 +3309,7 @@ static const struct usb_action ov7620_50HZ[] = {
3310 {0xaa, 0x10, 0x0082}, /* 00,10,82,aa */ 3309 {0xaa, 0x10, 0x0082}, /* 00,10,82,aa */
3311 {0xaa, 0x76, 0x0003}, /* 00,76,03,aa */ 3310 {0xaa, 0x76, 0x0003}, /* 00,76,03,aa */
3312/* {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, * 00,02,40,cc 3311/* {0xa0, 0x40, ZC3XX_R002_CLOCKSELECT}, * 00,02,40,cc
3313 if mode0 (640x480) */ 3312 * if mode0 (640x480) */
3314 {} 3313 {}
3315}; 3314};
3316static const struct usb_action ov7620_60HZ[] = { 3315static const struct usb_action ov7620_60HZ[] = {
@@ -5828,7 +5827,7 @@ static void setmatrix(struct gspca_dev *gspca_dev)
5828 [SENSOR_CS2102K] = NULL, 5827 [SENSOR_CS2102K] = NULL,
5829 [SENSOR_GC0303] = gc0303_matrix, 5828 [SENSOR_GC0303] = gc0303_matrix,
5830 [SENSOR_GC0305] = gc0305_matrix, 5829 [SENSOR_GC0305] = gc0305_matrix,
5831 [SENSOR_HDCS2020b] = NULL, 5830 [SENSOR_HDCS2020] = NULL,
5832 [SENSOR_HV7131B] = NULL, 5831 [SENSOR_HV7131B] = NULL,
5833 [SENSOR_HV7131R] = po2030_matrix, 5832 [SENSOR_HV7131R] = po2030_matrix,
5834 [SENSOR_ICM105A] = po2030_matrix, 5833 [SENSOR_ICM105A] = po2030_matrix,
@@ -5990,10 +5989,10 @@ static void setlightfreq(struct gspca_dev *gspca_dev)
5990 {gc0305_NoFliker, gc0305_NoFliker, 5989 {gc0305_NoFliker, gc0305_NoFliker,
5991 gc0305_50HZ, gc0305_50HZ, 5990 gc0305_50HZ, gc0305_50HZ,
5992 gc0305_60HZ, gc0305_60HZ}, 5991 gc0305_60HZ, gc0305_60HZ},
5993 [SENSOR_HDCS2020b] = 5992 [SENSOR_HDCS2020] =
5994 {hdcs2020b_NoFliker, hdcs2020b_NoFliker, 5993 {hdcs2020_NoFliker, hdcs2020_NoFliker,
5995 hdcs2020b_50HZ, hdcs2020b_50HZ, 5994 hdcs2020_50HZ, hdcs2020_50HZ,
5996 hdcs2020b_60HZ, hdcs2020b_60HZ}, 5995 hdcs2020_60HZ, hdcs2020_60HZ},
5997 [SENSOR_HV7131B] = 5996 [SENSOR_HV7131B] =
5998 {hv7131b_NoFliker, hv7131b_NoFlikerScale, 5997 {hv7131b_NoFliker, hv7131b_NoFlikerScale,
5999 hv7131b_50HZ, hv7131b_50HZScale, 5998 hv7131b_50HZ, hv7131b_50HZScale,
@@ -6091,7 +6090,7 @@ static void setautogain(struct gspca_dev *gspca_dev)
6091 6090
6092static void send_unknown(struct gspca_dev *gspca_dev, int sensor) 6091static void send_unknown(struct gspca_dev *gspca_dev, int sensor)
6093{ 6092{
6094 reg_w(gspca_dev, 0x01, 0x0000); /* led off */ 6093 reg_w(gspca_dev, 0x01, 0x0000); /* bridge reset */
6095 switch (sensor) { 6094 switch (sensor) {
6096 case SENSOR_PAS106: 6095 case SENSOR_PAS106:
6097 reg_w(gspca_dev, 0x03, 0x003a); 6096 reg_w(gspca_dev, 0x03, 0x003a);
@@ -6310,6 +6309,7 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev)
6310 return 0x0a; /* PB0330 */ 6309 return 0x0a; /* PB0330 */
6311 } 6310 }
6312 6311
6312 /* probe gc0303 / gc0305 */
6313 reg_w(gspca_dev, 0x01, 0x0000); 6313 reg_w(gspca_dev, 0x01, 0x0000);
6314 reg_w(gspca_dev, 0x01, 0x0001); 6314 reg_w(gspca_dev, 0x01, 0x0001);
6315 reg_w(gspca_dev, 0x98, 0x008b); 6315 reg_w(gspca_dev, 0x98, 0x008b);
@@ -6433,7 +6433,7 @@ static int sd_init(struct gspca_dev *gspca_dev)
6433 [SENSOR_CS2102K] = 5, 6433 [SENSOR_CS2102K] = 5,
6434 [SENSOR_GC0303] = 3, 6434 [SENSOR_GC0303] = 3,
6435 [SENSOR_GC0305] = 4, 6435 [SENSOR_GC0305] = 4,
6436 [SENSOR_HDCS2020b] = 4, 6436 [SENSOR_HDCS2020] = 4,
6437 [SENSOR_HV7131B] = 4, 6437 [SENSOR_HV7131B] = 4,
6438 [SENSOR_HV7131R] = 4, 6438 [SENSOR_HV7131R] = 4,
6439 [SENSOR_ICM105A] = 4, 6439 [SENSOR_ICM105A] = 4,
@@ -6454,7 +6454,7 @@ static int sd_init(struct gspca_dev *gspca_dev)
6454 [SENSOR_CS2102K] = 1, 6454 [SENSOR_CS2102K] = 1,
6455 [SENSOR_GC0303] = 1, 6455 [SENSOR_GC0303] = 1,
6456 [SENSOR_GC0305] = 1, 6456 [SENSOR_GC0305] = 1,
6457 [SENSOR_HDCS2020b] = 1, 6457 [SENSOR_HDCS2020] = 1,
6458 [SENSOR_HV7131B] = 1, 6458 [SENSOR_HV7131B] = 1,
6459 [SENSOR_HV7131R] = 1, 6459 [SENSOR_HV7131R] = 1,
6460 [SENSOR_ICM105A] = 1, 6460 [SENSOR_ICM105A] = 1,
@@ -6517,8 +6517,8 @@ static int sd_init(struct gspca_dev *gspca_dev)
6517 sd->sensor = SENSOR_CS2102; 6517 sd->sensor = SENSOR_CS2102;
6518 break; 6518 break;
6519 case 0x08: 6519 case 0x08:
6520 PDEBUG(D_PROBE, "Find Sensor HDCS2020(b)"); 6520 PDEBUG(D_PROBE, "Find Sensor HDCS2020");
6521 sd->sensor = SENSOR_HDCS2020b; 6521 sd->sensor = SENSOR_HDCS2020;
6522 break; 6522 break;
6523 case 0x0a: 6523 case 0x0a:
6524 PDEBUG(D_PROBE, 6524 PDEBUG(D_PROBE,
@@ -6648,8 +6648,8 @@ static int sd_start(struct gspca_dev *gspca_dev)
6648 {gc0303_Initial, gc0303_InitialScale}, 6648 {gc0303_Initial, gc0303_InitialScale},
6649 [SENSOR_GC0305] = 6649 [SENSOR_GC0305] =
6650 {gc0305_Initial, gc0305_InitialScale}, 6650 {gc0305_Initial, gc0305_InitialScale},
6651 [SENSOR_HDCS2020b] = 6651 [SENSOR_HDCS2020] =
6652 {hdcs2020b_Initial, hdcs2020b_InitialScale}, 6652 {hdcs2020_Initial, hdcs2020_InitialScale},
6653 [SENSOR_HV7131B] = 6653 [SENSOR_HV7131B] =
6654 {hv7131b_Initial, hv7131b_InitialScale}, 6654 {hv7131b_Initial, hv7131b_InitialScale},
6655 [SENSOR_HV7131R] = 6655 [SENSOR_HV7131R] =
@@ -6743,7 +6743,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
6743 /* set the gamma tables when not set */ 6743 /* set the gamma tables when not set */
6744 switch (sd->sensor) { 6744 switch (sd->sensor) {
6745 case SENSOR_CS2102K: /* gamma set in xxx_Initial */ 6745 case SENSOR_CS2102K: /* gamma set in xxx_Initial */
6746 case SENSOR_HDCS2020b: 6746 case SENSOR_HDCS2020:
6747 case SENSOR_OV7630C: 6747 case SENSOR_OV7630C:
6748 break; 6748 break;
6749 default: 6749 default: