aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca
diff options
context:
space:
mode:
authorOlivier Lorin <o.lorin@laposte.net>2009-10-15 03:13:45 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:40:50 -0500
commitbe9904bdde05137085af1df98de98a49ddce9ad8 (patch)
tree014c2c7d5925f8c4761c30d1b71f0af5de9cbadd /drivers/media/video/gspca
parent216f05aa2a704ab8dfbfb3ca36da1e04d2a9ee67 (diff)
V4L/DVB (13195): gspca - gl860: comment changes and naming scheme egalization
- small changes in comments - unified naming scheme for subdriver variables Signed-off-by: Olivier Lorin <o.lorin@laposte.net> 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')
-rw-r--r--drivers/media/video/gspca/gl860/gl860-mi1320.c55
-rw-r--r--drivers/media/video/gspca/gl860/gl860-mi2020.c69
-rw-r--r--drivers/media/video/gspca/gl860/gl860-ov2640.c57
-rw-r--r--drivers/media/video/gspca/gl860/gl860-ov9655.c43
-rw-r--r--drivers/media/video/gspca/gl860/gl860.c8
-rw-r--r--drivers/media/video/gspca/gl860/gl860.h7
6 files changed, 118 insertions, 121 deletions
diff --git a/drivers/media/video/gspca/gl860/gl860-mi1320.c b/drivers/media/video/gspca/gl860/gl860-mi1320.c
index 39f6261c1a0c..1355e526ee84 100644
--- a/drivers/media/video/gspca/gl860/gl860-mi1320.c
+++ b/drivers/media/video/gspca/gl860/gl860-mi1320.c
@@ -1,6 +1,5 @@
1/* @file gl860-mi1320.c 1/* Subdriver for the GL860 chip with the MI1320 sensor
2 * @author Olivier LORIN from my logs 2 * Author Olivier LORIN from own logs
3 * @date 2009-08-27
4 * 3 *
5 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 5 * it under the terms of the GNU General Public License as published by
@@ -127,49 +126,49 @@ static u8 dat_wbalBL[] =
127 126
128static u8 dat_hvflip1[] = {0xf0, 0x00, 0xf1, 0x00}; 127static u8 dat_hvflip1[] = {0xf0, 0x00, 0xf1, 0x00};
129 128
130static u8 s000[] = 129static u8 dat_common00[] =
131 "\x00\x01\x07\x6a\x06\x63\x0d\x6a" "\xc0\x00\x10\x10\xc1\x03\xc2\x42" 130 "\x00\x01\x07\x6a\x06\x63\x0d\x6a" "\xc0\x00\x10\x10\xc1\x03\xc2\x42"
132 "\xd8\x04\x58\x00\x04\x02"; 131 "\xd8\x04\x58\x00\x04\x02";
133static u8 s001[] = 132static u8 dat_common01[] =
134 "\x0d\x00\xf1\x0b\x0d\x00\xf1\x08" "\x35\x00\xf1\x22\x68\x00\xf1\x5d" 133 "\x0d\x00\xf1\x0b\x0d\x00\xf1\x08" "\x35\x00\xf1\x22\x68\x00\xf1\x5d"
135 "\xf0\x00\xf1\x01\x06\x70\xf1\x0e" "\xf0\x00\xf1\x02\xdd\x18\xf1\xe0"; 134 "\xf0\x00\xf1\x01\x06\x70\xf1\x0e" "\xf0\x00\xf1\x02\xdd\x18\xf1\xe0";
136static u8 s002[] = 135static u8 dat_common02[] =
137 "\x05\x01\xf1\x84\x06\x00\xf1\x44" "\x07\x00\xf1\xbe\x08\x00\xf1\x1e" 136 "\x05\x01\xf1\x84\x06\x00\xf1\x44" "\x07\x00\xf1\xbe\x08\x00\xf1\x1e"
138 "\x20\x01\xf1\x03\x21\x84\xf1\x00" "\x22\x0d\xf1\x0f\x24\x80\xf1\x00" 137 "\x20\x01\xf1\x03\x21\x84\xf1\x00" "\x22\x0d\xf1\x0f\x24\x80\xf1\x00"
139 "\x34\x18\xf1\x2d\x35\x00\xf1\x22" "\x43\x83\xf1\x83\x59\x00\xf1\xff"; 138 "\x34\x18\xf1\x2d\x35\x00\xf1\x22" "\x43\x83\xf1\x83\x59\x00\xf1\xff";
140static u8 s003[] = 139static u8 dat_common03[] =
141 "\xf0\x00\xf1\x02\x39\x06\xf1\x8c" "\x3a\x06\xf1\x8c\x3b\x03\xf1\xda" 140 "\xf0\x00\xf1\x02\x39\x06\xf1\x8c" "\x3a\x06\xf1\x8c\x3b\x03\xf1\xda"
142 "\x3c\x05\xf1\x30\x57\x01\xf1\x0c" "\x58\x01\xf1\x42\x59\x01\xf1\x0c" 141 "\x3c\x05\xf1\x30\x57\x01\xf1\x0c" "\x58\x01\xf1\x42\x59\x01\xf1\x0c"
143 "\x5a\x01\xf1\x42\x5c\x13\xf1\x0e" "\x5d\x17\xf1\x12\x64\x1e\xf1\x1c"; 142 "\x5a\x01\xf1\x42\x5c\x13\xf1\x0e" "\x5d\x17\xf1\x12\x64\x1e\xf1\x1c";
144static u8 s004[] = 143static u8 dat_common04[] =
145 "\xf0\x00\xf1\x02\x24\x5f\xf1\x20" "\x28\xea\xf1\x02\x5f\x41\xf1\x43"; 144 "\xf0\x00\xf1\x02\x24\x5f\xf1\x20" "\x28\xea\xf1\x02\x5f\x41\xf1\x43";
146static u8 s005[] = 145static u8 dat_common05[] =
147 "\x02\x00\xf1\xee\x03\x29\xf1\x1a" "\x04\x02\xf1\xa4\x09\x00\xf1\x68" 146 "\x02\x00\xf1\xee\x03\x29\xf1\x1a" "\x04\x02\xf1\xa4\x09\x00\xf1\x68"
148 "\x0a\x00\xf1\x2a\x0b\x00\xf1\x04" "\x0c\x00\xf1\x93\x0d\x00\xf1\x82" 147 "\x0a\x00\xf1\x2a\x0b\x00\xf1\x04" "\x0c\x00\xf1\x93\x0d\x00\xf1\x82"
149 "\x0e\x00\xf1\x40\x0f\x00\xf1\x5f" "\x10\x00\xf1\x4e\x11\x00\xf1\x5b"; 148 "\x0e\x00\xf1\x40\x0f\x00\xf1\x5f" "\x10\x00\xf1\x4e\x11\x00\xf1\x5b";
150static u8 s006[] = 149static u8 dat_common06[] =
151 "\x15\x00\xf1\xc9\x16\x00\xf1\x5e" "\x17\x00\xf1\x9d\x18\x00\xf1\x06" 150 "\x15\x00\xf1\xc9\x16\x00\xf1\x5e" "\x17\x00\xf1\x9d\x18\x00\xf1\x06"
152 "\x19\x00\xf1\x89\x1a\x00\xf1\x12" "\x1b\x00\xf1\xa1\x1c\x00\xf1\xe4" 151 "\x19\x00\xf1\x89\x1a\x00\xf1\x12" "\x1b\x00\xf1\xa1\x1c\x00\xf1\xe4"
153 "\x1d\x00\xf1\x7a\x1e\x00\xf1\x64" "\xf6\x00\xf1\x5f"; 152 "\x1d\x00\xf1\x7a\x1e\x00\xf1\x64" "\xf6\x00\xf1\x5f";
154static u8 s007[] = 153static u8 dat_common07[] =
155 "\xf0\x00\xf1\x01\x53\x09\xf1\x03" "\x54\x3d\xf1\x1c\x55\x99\xf1\x72" 154 "\xf0\x00\xf1\x01\x53\x09\xf1\x03" "\x54\x3d\xf1\x1c\x55\x99\xf1\x72"
156 "\x56\xc1\xf1\xb1\x57\xd8\xf1\xce" "\x58\xe0\xf1\x00\xdc\x0a\xf1\x03" 155 "\x56\xc1\xf1\xb1\x57\xd8\xf1\xce" "\x58\xe0\xf1\x00\xdc\x0a\xf1\x03"
157 "\xdd\x45\xf1\x20\xde\xae\xf1\x82" "\xdf\xdc\xf1\xc9\xe0\xf6\xf1\xea" 156 "\xdd\x45\xf1\x20\xde\xae\xf1\x82" "\xdf\xdc\xf1\xc9\xe0\xf6\xf1\xea"
158 "\xe1\xff\xf1\x00"; 157 "\xe1\xff\xf1\x00";
159static u8 s008[] = 158static u8 dat_common08[] =
160 "\xf0\x00\xf1\x01\x80\x00\xf1\x06" "\x81\xf6\xf1\x08\x82\xfb\xf1\xf7" 159 "\xf0\x00\xf1\x01\x80\x00\xf1\x06" "\x81\xf6\xf1\x08\x82\xfb\xf1\xf7"
161 "\x83\x00\xf1\xfe\xb6\x07\xf1\x03" "\xb7\x18\xf1\x0c\x84\xfb\xf1\x06" 160 "\x83\x00\xf1\xfe\xb6\x07\xf1\x03" "\xb7\x18\xf1\x0c\x84\xfb\xf1\x06"
162 "\x85\xfb\xf1\xf9\x86\x00\xf1\xff" "\xb8\x07\xf1\x04\xb9\x16\xf1\x0a"; 161 "\x85\xfb\xf1\xf9\x86\x00\xf1\xff" "\xb8\x07\xf1\x04\xb9\x16\xf1\x0a";
163static u8 s009[] = 162static u8 dat_common09[] =
164 "\x87\xfa\xf1\x05\x88\xfc\xf1\xf9" "\x89\x00\xf1\xff\xba\x06\xf1\x03" 163 "\x87\xfa\xf1\x05\x88\xfc\xf1\xf9" "\x89\x00\xf1\xff\xba\x06\xf1\x03"
165 "\xbb\x17\xf1\x09\x8a\xe8\xf1\x14" "\x8b\xf7\xf1\xf0\x8c\xfd\xf1\xfa" 164 "\xbb\x17\xf1\x09\x8a\xe8\xf1\x14" "\x8b\xf7\xf1\xf0\x8c\xfd\xf1\xfa"
166 "\x8d\x00\xf1\x00\xbc\x05\xf1\x01" "\xbd\x0c\xf1\x08\xbe\x00\xf1\x14"; 165 "\x8d\x00\xf1\x00\xbc\x05\xf1\x01" "\xbd\x0c\xf1\x08\xbe\x00\xf1\x14";
167static u8 s010[] = 166static u8 dat_common10[] =
168 "\x8e\xea\xf1\x13\x8f\xf7\xf1\xf2" "\x90\xfd\xf1\xfa\x91\x00\xf1\x00" 167 "\x8e\xea\xf1\x13\x8f\xf7\xf1\xf2" "\x90\xfd\xf1\xfa\x91\x00\xf1\x00"
169 "\xbf\x05\xf1\x01\xc0\x0a\xf1\x08" "\xc1\x00\xf1\x0c\x92\xed\xf1\x0f" 168 "\xbf\x05\xf1\x01\xc0\x0a\xf1\x08" "\xc1\x00\xf1\x0c\x92\xed\xf1\x0f"
170 "\x93\xf9\xf1\xf4\x94\xfe\xf1\xfb" "\x95\x00\xf1\x00\xc2\x04\xf1\x01" 169 "\x93\xf9\xf1\xf4\x94\xfe\xf1\xfb" "\x95\x00\xf1\x00\xc2\x04\xf1\x01"
171 "\xc3\x0a\xf1\x07\xc4\x00\xf1\x10"; 170 "\xc3\x0a\xf1\x07\xc4\x00\xf1\x10";
172static u8 s011[] = 171static u8 dat_common11[] =
173 "\xf0\x00\xf1\x01\x05\x00\xf1\x06" "\x25\x00\xf1\x55\x34\x10\xf1\x10" 172 "\xf0\x00\xf1\x01\x05\x00\xf1\x06" "\x25\x00\xf1\x55\x34\x10\xf1\x10"
174 "\x35\xf0\xf1\x10\x3a\x02\xf1\x03" "\x3b\x04\xf1\x2a\x9b\x43\xf1\x00" 173 "\x35\xf0\xf1\x10\x3a\x02\xf1\x03" "\x3b\x04\xf1\x2a\x9b\x43\xf1\x00"
175 "\xa4\x03\xf1\xc0\xa7\x02\xf1\x81"; 174 "\xa4\x03\xf1\xc0\xa7\x02\xf1\x81";
@@ -222,26 +221,26 @@ void mi1320_init_settings(struct gspca_dev *gspca_dev)
222 221
223static void common(struct gspca_dev *gspca_dev) 222static void common(struct gspca_dev *gspca_dev)
224{ 223{
225 s32 n; /* reserved for FETCH macros */ 224 s32 n; /* reserved for FETCH functions */
226 225
227 ctrl_out(gspca_dev, 0x40, 3, 0x0000, 0x0200, 22, s000); 226 ctrl_out(gspca_dev, 0x40, 3, 0x0000, 0x0200, 22, dat_common00);
228 ctrl_out(gspca_dev, 0x40, 1, 0x0041, 0x0000, 0, NULL); 227 ctrl_out(gspca_dev, 0x40, 1, 0x0041, 0x0000, 0, NULL);
229 ctrl_out(gspca_dev, 0x40, 3, 0xba00, 0x0200, 32, s001); 228 ctrl_out(gspca_dev, 0x40, 3, 0xba00, 0x0200, 32, dat_common01);
230 n = fetch_validx(gspca_dev, tbl_common, ARRAY_SIZE(tbl_common)); 229 n = fetch_validx(gspca_dev, tbl_common, ARRAY_SIZE(tbl_common));
231 ctrl_out(gspca_dev, 0x40, 3, 0xba00, 0x0200, 48, s002); 230 ctrl_out(gspca_dev, 0x40, 3, 0xba00, 0x0200, 48, dat_common02);
232 ctrl_out(gspca_dev, 0x40, 3, 0xba00, 0x0200, 48, s003); 231 ctrl_out(gspca_dev, 0x40, 3, 0xba00, 0x0200, 48, dat_common03);
233 ctrl_out(gspca_dev, 0x40, 3, 0xba00, 0x0200, 16, s004); 232 ctrl_out(gspca_dev, 0x40, 3, 0xba00, 0x0200, 16, dat_common04);
234 ctrl_out(gspca_dev, 0x40, 3, 0xba00, 0x0200, 48, s005); 233 ctrl_out(gspca_dev, 0x40, 3, 0xba00, 0x0200, 48, dat_common05);
235 ctrl_out(gspca_dev, 0x40, 3, 0xba00, 0x0200, 44, s006); 234 ctrl_out(gspca_dev, 0x40, 3, 0xba00, 0x0200, 44, dat_common06);
236 keep_on_fetching_validx(gspca_dev, tbl_common, 235 keep_on_fetching_validx(gspca_dev, tbl_common,
237 ARRAY_SIZE(tbl_common), n); 236 ARRAY_SIZE(tbl_common), n);
238 ctrl_out(gspca_dev, 0x40, 3, 0xba00, 0x0200, 52, s007); 237 ctrl_out(gspca_dev, 0x40, 3, 0xba00, 0x0200, 52, dat_common07);
239 ctrl_out(gspca_dev, 0x40, 3, 0xba00, 0x0200, 48, s008); 238 ctrl_out(gspca_dev, 0x40, 3, 0xba00, 0x0200, 48, dat_common08);
240 ctrl_out(gspca_dev, 0x40, 3, 0xba00, 0x0200, 48, s009); 239 ctrl_out(gspca_dev, 0x40, 3, 0xba00, 0x0200, 48, dat_common09);
241 ctrl_out(gspca_dev, 0x40, 3, 0xba00, 0x0200, 56, s010); 240 ctrl_out(gspca_dev, 0x40, 3, 0xba00, 0x0200, 56, dat_common10);
242 keep_on_fetching_validx(gspca_dev, tbl_common, 241 keep_on_fetching_validx(gspca_dev, tbl_common,
243 ARRAY_SIZE(tbl_common), n); 242 ARRAY_SIZE(tbl_common), n);
244 ctrl_out(gspca_dev, 0x40, 3, 0xba00, 0x0200, 40, s011); 243 ctrl_out(gspca_dev, 0x40, 3, 0xba00, 0x0200, 40, dat_common11);
245 keep_on_fetching_validx(gspca_dev, tbl_common, 244 keep_on_fetching_validx(gspca_dev, tbl_common,
246 ARRAY_SIZE(tbl_common), n); 245 ARRAY_SIZE(tbl_common), n);
247} 246}
diff --git a/drivers/media/video/gspca/gl860/gl860-mi2020.c b/drivers/media/video/gspca/gl860/gl860-mi2020.c
index ffb09fed3e8c..80cb3f1b36f7 100644
--- a/drivers/media/video/gspca/gl860/gl860-mi2020.c
+++ b/drivers/media/video/gspca/gl860/gl860-mi2020.c
@@ -1,7 +1,6 @@
1/* @file gl860-mi2020.c 1/* Subdriver for the GL860 chip with the MI2020 sensor
2 * @author Olivier LORIN, from Ice/Soro2005's logs(A), Fret_saw/Hulkie's 2 * Author Olivier LORIN, from Ice/Soro2005's logs(A), Fret_saw/Hulkie's
3 * logs(B) and Tricid"s logs(C). With the help of Kytrix/BUGabundo/Blazercist. 3 * logs(B) and Tricid"s logs(C). With the help of Kytrix/BUGabundo/Blazercist.
4 * @date 2009-08-27
5 * 4 *
6 * This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
@@ -41,7 +40,7 @@ static u8 dat_freq1[] = { 0x8c, 0xa4, 0x04 };
41static u8 dat_multi5[] = { 0x8c, 0xa1, 0x03 }; 40static u8 dat_multi5[] = { 0x8c, 0xa1, 0x03 };
42static u8 dat_multi6[] = { 0x90, 0x00, 0x05 }; 41static u8 dat_multi6[] = { 0x90, 0x00, 0x05 };
43 42
44static struct validx tbl_common_a[] = { 43static struct validx tbl_common1[] = {
45 {0x0000, 0x0000}, 44 {0x0000, 0x0000},
46 {1, 0xffff}, /* msleep(35); */ 45 {1, 0xffff}, /* msleep(35); */
47 {0x006a, 0x0007}, {0x0063, 0x0006}, {0x006a, 0x000d}, {0x0000, 0x00c0}, 46 {0x006a, 0x0007}, {0x0063, 0x0006}, {0x006a, 0x000d}, {0x0000, 0x00c0},
@@ -49,7 +48,7 @@ static struct validx tbl_common_a[] = {
49 {0x0000, 0x0058}, {0x0002, 0x0004}, {0x0041, 0x0000}, 48 {0x0000, 0x0058}, {0x0002, 0x0004}, {0x0041, 0x0000},
50}; 49};
51 50
52static struct validx tbl_common_b[] = { 51static struct validx tbl_common2[] = {
53 {0x006a, 0x0007}, 52 {0x006a, 0x0007},
54 {35, 0xffff}, 53 {35, 0xffff},
55 {0x00ef, 0x0006}, 54 {0x00ef, 0x0006},
@@ -60,7 +59,7 @@ static struct validx tbl_common_b[] = {
60 {0x0004, 0x00d8}, {0x0000, 0x0058}, {0x0041, 0x0000}, 59 {0x0004, 0x00d8}, {0x0000, 0x0058}, {0x0041, 0x0000},
61}; 60};
62 61
63static struct idxdata tbl_common_c[] = { 62static struct idxdata tbl_common3[] = {
64 {0x32, "\x02\x00\x08"}, {0x33, "\xf4\x03\x1d"}, 63 {0x32, "\x02\x00\x08"}, {0x33, "\xf4\x03\x1d"},
65 {6, "\xff\xff\xff"}, /* 12 */ 64 {6, "\xff\xff\xff"}, /* 12 */
66 {0x34, "\x1e\x8f\x09"}, {0x34, "\x1c\x01\x28"}, {0x34, "\x1e\x8f\x09"}, 65 {0x34, "\x1e\x8f\x09"}, {0x34, "\x1c\x01\x28"}, {0x34, "\x1e\x8f\x09"},
@@ -109,7 +108,7 @@ static struct idxdata tbl_common_c[] = {
109 {0x33, "\x8c\xa2\x03"}, {0x33, "\x90\x00\xbb"}, 108 {0x33, "\x8c\xa2\x03"}, {0x33, "\x90\x00\xbb"},
110}; 109};
111 110
112static struct idxdata tbl_common_d[] = { 111static struct idxdata tbl_common4[] = {
113 {0x33, "\x8c\x22\x2e"}, {0x33, "\x90\x00\xa0"}, {0x33, "\x8c\xa4\x08"}, 112 {0x33, "\x8c\x22\x2e"}, {0x33, "\x90\x00\xa0"}, {0x33, "\x8c\xa4\x08"},
114 {0x33, "\x90\x00\x1f"}, {0x33, "\x8c\xa4\x09"}, {0x33, "\x90\x00\x21"}, 113 {0x33, "\x90\x00\x1f"}, {0x33, "\x8c\xa4\x09"}, {0x33, "\x90\x00\x21"},
115 {0x33, "\x8c\xa4\x0a"}, {0x33, "\x90\x00\x25"}, {0x33, "\x8c\xa4\x0b"}, 114 {0x33, "\x8c\xa4\x0a"}, {0x33, "\x90\x00\x25"}, {0x33, "\x8c\xa4\x0b"},
@@ -118,7 +117,7 @@ static struct idxdata tbl_common_d[] = {
118 {0x33, "\x90\x00\xa0"}, {0x33, "\x8c\x24\x17"}, {0x33, "\x90\x00\xc0"}, 117 {0x33, "\x90\x00\xa0"}, {0x33, "\x8c\x24\x17"}, {0x33, "\x90\x00\xc0"},
119}; 118};
120 119
121static struct idxdata tbl_common_e[] = { 120static struct idxdata tbl_common5[] = {
122 {0x33, "\x8c\xa4\x04"}, {0x33, "\x90\x00\x80"}, {0x33, "\x8c\xa7\x9d"}, 121 {0x33, "\x8c\xa4\x04"}, {0x33, "\x90\x00\x80"}, {0x33, "\x8c\xa7\x9d"},
123 {0x33, "\x90\x00\x00"}, {0x33, "\x8c\xa7\x9e"}, {0x33, "\x90\x00\x00"}, 122 {0x33, "\x90\x00\x00"}, {0x33, "\x8c\xa7\x9e"}, {0x33, "\x90\x00\x00"},
124 {0x33, "\x8c\xa2\x0c"}, {0x33, "\x90\x00\x17"}, {0x33, "\x8c\xa2\x15"}, 123 {0x33, "\x8c\xa2\x0c"}, {0x33, "\x90\x00\x17"}, {0x33, "\x8c\xa2\x15"},
@@ -180,7 +179,7 @@ static struct validx tbl_init_at_startup[] = {
180 {53, 0xffff}, 179 {53, 0xffff},
181}; 180};
182 181
183static struct idxdata tbl_init_post_alt_low_a[] = { 182static struct idxdata tbl_init_post_alt_low1[] = {
184 {0x33, "\x8c\x27\x15"}, {0x33, "\x90\x00\x25"}, {0x33, "\x8c\x22\x2e"}, 183 {0x33, "\x8c\x27\x15"}, {0x33, "\x90\x00\x25"}, {0x33, "\x8c\x22\x2e"},
185 {0x33, "\x90\x00\x81"}, {0x33, "\x8c\xa4\x08"}, {0x33, "\x90\x00\x17"}, 184 {0x33, "\x90\x00\x81"}, {0x33, "\x8c\xa4\x08"}, {0x33, "\x90\x00\x17"},
186 {0x33, "\x8c\xa4\x09"}, {0x33, "\x90\x00\x1a"}, {0x33, "\x8c\xa4\x0a"}, 185 {0x33, "\x8c\xa4\x09"}, {0x33, "\x90\x00\x1a"}, {0x33, "\x8c\xa4\x0a"},
@@ -189,7 +188,7 @@ static struct idxdata tbl_init_post_alt_low_a[] = {
189 {0x33, "\x90\x00\x9b"}, 188 {0x33, "\x90\x00\x9b"},
190}; 189};
191 190
192static struct idxdata tbl_init_post_alt_low_b[] = { 191static struct idxdata tbl_init_post_alt_low2[] = {
193 {0x33, "\x8c\x27\x03"}, {0x33, "\x90\x03\x24"}, {0x33, "\x8c\x27\x05"}, 192 {0x33, "\x8c\x27\x03"}, {0x33, "\x90\x03\x24"}, {0x33, "\x8c\x27\x05"},
194 {0x33, "\x90\x02\x58"}, {0x33, "\x8c\xa1\x03"}, {0x33, "\x90\x00\x05"}, 193 {0x33, "\x90\x02\x58"}, {0x33, "\x8c\xa1\x03"}, {0x33, "\x90\x00\x05"},
195 {2, "\xff\xff\xff"}, 194 {2, "\xff\xff\xff"},
@@ -197,7 +196,7 @@ static struct idxdata tbl_init_post_alt_low_b[] = {
197 {2, "\xff\xff\xff"}, 196 {2, "\xff\xff\xff"},
198}; 197};
199 198
200static struct idxdata tbl_init_post_alt_low_c[] = { 199static struct idxdata tbl_init_post_alt_low3[] = {
201 {0x34, "\x1e\x8f\x09"}, {0x34, "\x1c\x01\x28"}, {0x34, "\x1e\x8f\x09"}, 200 {0x34, "\x1e\x8f\x09"}, {0x34, "\x1c\x01\x28"}, {0x34, "\x1e\x8f\x09"},
202 {2, "\xff\xff\xff"}, 201 {2, "\xff\xff\xff"},
203 {0x34, "\x1e\x8f\x09"}, {0x32, "\x14\x06\xe6"}, {0x33, "\x8c\xa1\x20"}, 202 {0x34, "\x1e\x8f\x09"}, {0x32, "\x14\x06\xe6"}, {0x33, "\x8c\xa1\x20"},
@@ -221,7 +220,7 @@ static struct idxdata tbl_init_post_alt_low_c[] = {
221 {1, "\xff\xff\xff"}, 220 {1, "\xff\xff\xff"},
222}; 221};
223 222
224static struct idxdata tbl_init_post_alt_low_d[] = { 223static struct idxdata tbl_init_post_alt_low4[] = {
225 {0x32, "\x10\x01\xf8"}, {0x34, "\xce\x01\xa8"}, {0x34, "\xd0\x66\x33"}, 224 {0x32, "\x10\x01\xf8"}, {0x34, "\xce\x01\xa8"}, {0x34, "\xd0\x66\x33"},
226 {0x34, "\xd2\x31\x9a"}, {0x34, "\xd4\x94\x63"}, {0x34, "\xd6\x4b\x25"}, 225 {0x34, "\xd2\x31\x9a"}, {0x34, "\xd4\x94\x63"}, {0x34, "\xd6\x4b\x25"},
227 {0x34, "\xd8\x26\x70"}, {0x34, "\xda\x72\x4c"}, {0x34, "\xdc\xff\x04"}, 226 {0x34, "\xd8\x26\x70"}, {0x34, "\xda\x72\x4c"}, {0x34, "\xdc\xff\x04"},
@@ -267,7 +266,7 @@ static struct idxdata tbl_init_post_alt_low_d[] = {
267 {0x32, "\x6c\x14\x08"}, 266 {0x32, "\x6c\x14\x08"},
268}; 267};
269 268
270static struct idxdata tbl_init_post_alt_big_a[] = { 269static struct idxdata tbl_init_post_alt_big1[] = {
271 {0x33, "\x8c\xa1\x03"}, {0x33, "\x90\x00\x05"}, 270 {0x33, "\x8c\xa1\x03"}, {0x33, "\x90\x00\x05"},
272 {2, "\xff\xff\xff"}, 271 {2, "\xff\xff\xff"},
273 {0x33, "\x8c\xa1\x03"}, {0x33, "\x90\x00\x06"}, 272 {0x33, "\x8c\xa1\x03"}, {0x33, "\x90\x00\x06"},
@@ -288,7 +287,7 @@ static struct idxdata tbl_init_post_alt_big_a[] = {
288 {0x34, "\x04\x00\x2a"}, {0x33, "\x8c\xa7\x02"}, {0x33, "\x90\x00\x01"}, 287 {0x34, "\x04\x00\x2a"}, {0x33, "\x8c\xa7\x02"}, {0x33, "\x90\x00\x01"},
289}; 288};
290 289
291static struct idxdata tbl_init_post_alt_big_b[] = { 290static struct idxdata tbl_init_post_alt_big2[] = {
292 {0x32, "\x10\x01\xf8"}, {0x34, "\xce\x01\xa8"}, {0x34, "\xd0\x66\x33"}, 291 {0x32, "\x10\x01\xf8"}, {0x34, "\xce\x01\xa8"}, {0x34, "\xd0\x66\x33"},
293 {0x34, "\xd2\x31\x9a"}, {0x34, "\xd4\x94\x63"}, {0x34, "\xd6\x4b\x25"}, 292 {0x34, "\xd2\x31\x9a"}, {0x34, "\xd4\x94\x63"}, {0x34, "\xd6\x4b\x25"},
294 {0x34, "\xd8\x26\x70"}, {0x34, "\xda\x72\x4c"}, {0x34, "\xdc\xff\x04"}, 293 {0x34, "\xd8\x26\x70"}, {0x34, "\xda\x72\x4c"}, {0x34, "\xdc\xff\x04"},
@@ -317,7 +316,7 @@ static struct idxdata tbl_init_post_alt_big_b[] = {
317 {0x32, "\x10\x01\xfc"}, {0x33, "\x8c\xa1\x18"}, {0x33, "\x90\x00\x3c"}, 316 {0x32, "\x10\x01\xfc"}, {0x33, "\x8c\xa1\x18"}, {0x33, "\x90\x00\x3c"},
318}; 317};
319 318
320static struct idxdata tbl_init_post_alt_big_c[] = { 319static struct idxdata tbl_init_post_alt_big3[] = {
321 {0x33, "\x8c\xa1\x02"}, 320 {0x33, "\x8c\xa1\x02"},
322 {0x33, "\x90\x00\x1f"}, 321 {0x33, "\x90\x00\x1f"},
323 {0x33, "\x8c\xa1\x02"}, 322 {0x33, "\x8c\xa1\x02"},
@@ -388,14 +387,14 @@ static void common(struct gspca_dev *gspca_dev)
388 s32 reso = gspca_dev->cam.cam_mode[(s32) gspca_dev->curr_mode].priv; 387 s32 reso = gspca_dev->cam.cam_mode[(s32) gspca_dev->curr_mode].priv;
389 388
390 if (_MI2020b_) { 389 if (_MI2020b_) {
391 fetch_validx(gspca_dev, tbl_common_a, ARRAY_SIZE(tbl_common_a)); 390 fetch_validx(gspca_dev, tbl_common1, ARRAY_SIZE(tbl_common1));
392 } else { 391 } else {
393 if (_MI2020_) 392 if (_MI2020_)
394 ctrl_out(gspca_dev, 0x40, 1, 0x0008, 0x0004, 0, NULL); 393 ctrl_out(gspca_dev, 0x40, 1, 0x0008, 0x0004, 0, NULL);
395 else 394 else
396 ctrl_out(gspca_dev, 0x40, 1, 0x0002, 0x0004, 0, NULL); 395 ctrl_out(gspca_dev, 0x40, 1, 0x0002, 0x0004, 0, NULL);
397 msleep(35); 396 msleep(35);
398 fetch_validx(gspca_dev, tbl_common_b, ARRAY_SIZE(tbl_common_b)); 397 fetch_validx(gspca_dev, tbl_common2, ARRAY_SIZE(tbl_common2));
399 } 398 }
400 ctrl_out(gspca_dev, 0x40, 3, 0x7a00, 0x0033, 3, "\x86\x25\x01"); 399 ctrl_out(gspca_dev, 0x40, 3, 0x7a00, 0x0033, 3, "\x86\x25\x01");
401 ctrl_out(gspca_dev, 0x40, 3, 0x7a00, 0x0033, 3, "\x86\x25\x00"); 400 ctrl_out(gspca_dev, 0x40, 3, 0x7a00, 0x0033, 3, "\x86\x25\x00");
@@ -403,13 +402,13 @@ static void common(struct gspca_dev *gspca_dev)
403 ctrl_out(gspca_dev, 0x40, 3, 0x7a00, 0x0030, 3, "\x1a\x0a\xcc"); 402 ctrl_out(gspca_dev, 0x40, 3, 0x7a00, 0x0030, 3, "\x1a\x0a\xcc");
404 if (reso == IMAGE_1600) 403 if (reso == IMAGE_1600)
405 msleep(2); /* 1600 */ 404 msleep(2); /* 1600 */
406 fetch_idxdata(gspca_dev, tbl_common_c, ARRAY_SIZE(tbl_common_c)); 405 fetch_idxdata(gspca_dev, tbl_common3, ARRAY_SIZE(tbl_common3));
407 406
408 if (_MI2020b_ || _MI2020_) 407 if (_MI2020b_ || _MI2020_)
409 fetch_idxdata(gspca_dev, tbl_common_d, 408 fetch_idxdata(gspca_dev, tbl_common4,
410 ARRAY_SIZE(tbl_common_d)); 409 ARRAY_SIZE(tbl_common4));
411 410
412 fetch_idxdata(gspca_dev, tbl_common_e, ARRAY_SIZE(tbl_common_e)); 411 fetch_idxdata(gspca_dev, tbl_common5, ARRAY_SIZE(tbl_common5));
413 if (_MI2020b_ || _MI2020_) { 412 if (_MI2020b_ || _MI2020_) {
414 /* Different from fret */ 413 /* Different from fret */
415 ctrl_out(gspca_dev, 0x40, 3, 0x7a00, 0x0033, 3, "\x90\x00\x78"); 414 ctrl_out(gspca_dev, 0x40, 3, 0x7a00, 0x0033, 3, "\x90\x00\x78");
@@ -525,15 +524,15 @@ static int mi2020_init_post_alt(struct gspca_dev *gspca_dev)
525 12, dat_800); 524 12, dat_800);
526 525
527 if (_MI2020c_) 526 if (_MI2020c_)
528 fetch_idxdata(gspca_dev, tbl_init_post_alt_low_a, 527 fetch_idxdata(gspca_dev, tbl_init_post_alt_low1,
529 ARRAY_SIZE(tbl_init_post_alt_low_a)); 528 ARRAY_SIZE(tbl_init_post_alt_low1));
530 529
531 if (reso == IMAGE_800) 530 if (reso == IMAGE_800)
532 fetch_idxdata(gspca_dev, tbl_init_post_alt_low_b, 531 fetch_idxdata(gspca_dev, tbl_init_post_alt_low2,
533 ARRAY_SIZE(tbl_init_post_alt_low_b)); 532 ARRAY_SIZE(tbl_init_post_alt_low2));
534 533
535 fetch_idxdata(gspca_dev, tbl_init_post_alt_low_c, 534 fetch_idxdata(gspca_dev, tbl_init_post_alt_low3,
536 ARRAY_SIZE(tbl_init_post_alt_low_c)); 535 ARRAY_SIZE(tbl_init_post_alt_low3));
537 536
538 if (_MI2020b_) { 537 if (_MI2020b_) {
539 ctrl_out(gspca_dev, 0x40, 1, 0x0001, 0x0010, 0, NULL); 538 ctrl_out(gspca_dev, 0x40, 1, 0x0001, 0x0010, 0, NULL);
@@ -574,8 +573,8 @@ static int mi2020_init_post_alt(struct gspca_dev *gspca_dev)
574 msleep(5);/* " */ 573 msleep(5);/* " */
575 574
576 if (_MI2020c_) { 575 if (_MI2020c_) {
577 fetch_idxdata(gspca_dev, tbl_init_post_alt_low_d, 576 fetch_idxdata(gspca_dev, tbl_init_post_alt_low4,
578 ARRAY_SIZE(tbl_init_post_alt_low_d)); 577 ARRAY_SIZE(tbl_init_post_alt_low4));
579 } else { 578 } else {
580 ctrl_in(gspca_dev, 0xc0, 2, 0x0000, 0x0000, 1, &c); 579 ctrl_in(gspca_dev, 0xc0, 2, 0x0000, 0x0000, 1, &c);
581 msleep(14); /* 0xd8 */ 580 msleep(14); /* 0xd8 */
@@ -644,8 +643,8 @@ static int mi2020_init_post_alt(struct gspca_dev *gspca_dev)
644 3, "\x90\x04\xb0"); 643 3, "\x90\x04\xb0");
645 } 644 }
646 645
647 fetch_idxdata(gspca_dev, tbl_init_post_alt_big_a, 646 fetch_idxdata(gspca_dev, tbl_init_post_alt_big1,
648 ARRAY_SIZE(tbl_init_post_alt_big_a)); 647 ARRAY_SIZE(tbl_init_post_alt_big1));
649 648
650 if (reso == IMAGE_1600) 649 if (reso == IMAGE_1600)
651 msleep(13); /* 1600 */ 650 msleep(13); /* 1600 */
@@ -708,8 +707,8 @@ static int mi2020_init_post_alt(struct gspca_dev *gspca_dev)
708 msleep(14); 707 msleep(14);
709 708
710 if (_MI2020c_) 709 if (_MI2020c_)
711 fetch_idxdata(gspca_dev, tbl_init_post_alt_big_b, 710 fetch_idxdata(gspca_dev, tbl_init_post_alt_big2,
712 ARRAY_SIZE(tbl_init_post_alt_big_b)); 711 ARRAY_SIZE(tbl_init_post_alt_big2));
713 712
714 /* flip/mirror */ 713 /* flip/mirror */
715 ctrl_out(gspca_dev, 0x40, 3, 0x7a00, 0x0033, 3, dat_hvflip1); 714 ctrl_out(gspca_dev, 0x40, 3, 0x7a00, 0x0033, 3, dat_hvflip1);
@@ -738,8 +737,8 @@ static int mi2020_init_post_alt(struct gspca_dev *gspca_dev)
738 sd->nbIm = 0; 737 sd->nbIm = 0;
739 738
740 if (_MI2020c_) 739 if (_MI2020c_)
741 fetch_idxdata(gspca_dev, tbl_init_post_alt_big_c, 740 fetch_idxdata(gspca_dev, tbl_init_post_alt_big3,
742 ARRAY_SIZE(tbl_init_post_alt_big_c)); 741 ARRAY_SIZE(tbl_init_post_alt_big3));
743 } 742 }
744 743
745 sd->vold.mirror = mirror; 744 sd->vold.mirror = mirror;
diff --git a/drivers/media/video/gspca/gl860/gl860-ov2640.c b/drivers/media/video/gspca/gl860/gl860-ov2640.c
index 14b9c373f9f7..e0837432d394 100644
--- a/drivers/media/video/gspca/gl860/gl860-ov2640.c
+++ b/drivers/media/video/gspca/gl860/gl860-ov2640.c
@@ -1,6 +1,5 @@
1/* @file gl860-ov2640.c 1/* Subdriver for the GL860 chip with the OV2640 sensor
2 * @author Olivier LORIN, from Malmostoso's logs 2 * Author Olivier LORIN, from Malmostoso's logs
3 * @date 2009-08-27
4 * 3 *
5 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 5 * it under the terms of the GNU General Public License as published by
@@ -92,7 +91,7 @@ static struct validx tbl_common[] = {
92 {0x6000, 0x0010}, 91 {0x6000, 0x0010},
93}; 92};
94 93
95static struct validx tbl_sensor_settings_common_a[] = { 94static struct validx tbl_sensor_settings_common1[] = {
96 {0x0041, 0x0000}, {0x006a, 0x0007}, {0x00ef, 0x0006}, {0x006a, 0x000d}, 95 {0x0041, 0x0000}, {0x006a, 0x0007}, {0x00ef, 0x0006}, {0x006a, 0x000d},
97 {0x0000, 0x00c0}, {0x0010, 0x0010}, {0x0001, 0x00c1}, {0x0041, 0x00c2}, 96 {0x0000, 0x00c0}, {0x0010, 0x0010}, {0x0001, 0x00c1}, {0x0041, 0x00c2},
98 {0x0004, 0x00d8}, {0x0012, 0x0004}, {0x0000, 0x0058}, {0x0041, 0x0000}, 97 {0x0004, 0x00d8}, {0x0012, 0x0004}, {0x0000, 0x0058}, {0x0041, 0x0000},
@@ -104,7 +103,7 @@ static struct validx tbl_sensor_settings_common_a[] = {
104 {0x0040, 0x0000}, 103 {0x0040, 0x0000},
105}; 104};
106 105
107static struct validx tbl_sensor_settings_common_b[] = { 106static struct validx tbl_sensor_settings_common2[] = {
108 {0x6001, 0x00ff}, {0x6038, 0x000c}, 107 {0x6001, 0x00ff}, {0x6038, 0x000c},
109 {10, 0xffff}, 108 {10, 0xffff},
110 {0x6000, 0x0011}, 109 {0x6000, 0x0011},
@@ -166,7 +165,7 @@ static struct validx tbl_800[] = {
166 {0x60ff, 0x00dd}, {0x6020, 0x008c}, {0x6001, 0x00ff}, {0x6044, 0x0018}, 165 {0x60ff, 0x00dd}, {0x6020, 0x008c}, {0x6001, 0x00ff}, {0x6044, 0x0018},
167}; 166};
168 167
169static struct validx tbl_big_a[] = { 168static struct validx tbl_big1[] = {
170 {0x0002, 0x00c1}, {0x6000, 0x00ff}, {0x60f1, 0x00dd}, {0x6004, 0x00e0}, 169 {0x0002, 0x00c1}, {0x6000, 0x00ff}, {0x60f1, 0x00dd}, {0x6004, 0x00e0},
171 {0x6001, 0x00ff}, {0x6000, 0x0012}, {0x6000, 0x0000}, {0x6000, 0x0045}, 170 {0x6001, 0x00ff}, {0x6000, 0x0012}, {0x6000, 0x0000}, {0x6000, 0x0045},
172 {0x6000, 0x0010}, {0x6000, 0x0011}, {0x6011, 0x0017}, {0x6075, 0x0018}, 171 {0x6000, 0x0010}, {0x6000, 0x0011}, {0x6011, 0x0017}, {0x6075, 0x0018},
@@ -176,14 +175,14 @@ static struct validx tbl_big_a[] = {
176 {0x60c8, 0x00c0}, {0x6096, 0x00c1}, {0x6000, 0x008c}, 175 {0x60c8, 0x00c0}, {0x6096, 0x00c1}, {0x6000, 0x008c},
177}; 176};
178 177
179static struct validx tbl_big_b[] = { 178static struct validx tbl_big2[] = {
180 {0x603d, 0x0086}, {0x6000, 0x0050}, {0x6090, 0x0051}, {0x602c, 0x0052}, 179 {0x603d, 0x0086}, {0x6000, 0x0050}, {0x6090, 0x0051}, {0x602c, 0x0052},
181 {0x6000, 0x0053}, {0x6000, 0x0054}, {0x6088, 0x0055}, {0x6000, 0x0057}, 180 {0x6000, 0x0053}, {0x6000, 0x0054}, {0x6088, 0x0055}, {0x6000, 0x0057},
182 {0x6040, 0x005a}, {0x60f0, 0x005b}, {0x6001, 0x005c}, {0x6082, 0x00d3}, 181 {0x6040, 0x005a}, {0x60f0, 0x005b}, {0x6001, 0x005c}, {0x6082, 0x00d3},
183 {0x6000, 0x008e}, 182 {0x6000, 0x008e},
184}; 183};
185 184
186static struct validx tbl_big_c[] = { 185static struct validx tbl_big3[] = {
187 {0x6004, 0x00da}, {0x6000, 0x00e0}, {0x6067, 0x00e1}, {0x60ff, 0x00dd}, 186 {0x6004, 0x00da}, {0x6000, 0x00e0}, {0x6067, 0x00e1}, {0x60ff, 0x00dd},
188 {0x6001, 0x00ff}, {0x6000, 0x00ff}, {0x60f1, 0x00dd}, {0x6004, 0x00e0}, 187 {0x6001, 0x00ff}, {0x6000, 0x00ff}, {0x60f1, 0x00dd}, {0x6004, 0x00e0},
189 {0x6001, 0x00ff}, {0x6000, 0x0011}, {0x6000, 0x00ff}, {0x6010, 0x00c7}, 188 {0x6001, 0x00ff}, {0x6000, 0x0011}, {0x6000, 0x00ff}, {0x6010, 0x00c7},
@@ -275,6 +274,8 @@ static int ov2640_init_pre_alt(struct gspca_dev *gspca_dev)
275{ 274{
276 struct sd *sd = (struct sd *) gspca_dev; 275 struct sd *sd = (struct sd *) gspca_dev;
277 276
277 sd->mirrorMask = 0;
278
278 sd->vold.backlight = -1; 279 sd->vold.backlight = -1;
279 sd->vold.brightness = -1; 280 sd->vold.brightness = -1;
280 sd->vold.sharpness = -1; 281 sd->vold.sharpness = -1;
@@ -292,16 +293,16 @@ static int ov2640_init_pre_alt(struct gspca_dev *gspca_dev)
292static int ov2640_init_post_alt(struct gspca_dev *gspca_dev) 293static int ov2640_init_post_alt(struct gspca_dev *gspca_dev)
293{ 294{
294 s32 reso = gspca_dev->cam.cam_mode[(s32) gspca_dev->curr_mode].priv; 295 s32 reso = gspca_dev->cam.cam_mode[(s32) gspca_dev->curr_mode].priv;
295 s32 n; /* reserved for FETCH macros */ 296 s32 n; /* reserved for FETCH functions */
296 297
297 ctrl_out(gspca_dev, 0x40, 5, 0x0001, 0x0000, 0, NULL); 298 ctrl_out(gspca_dev, 0x40, 5, 0x0001, 0x0000, 0, NULL);
298 299
299 n = fetch_validx(gspca_dev, tbl_sensor_settings_common_a, 300 n = fetch_validx(gspca_dev, tbl_sensor_settings_common1,
300 ARRAY_SIZE(tbl_sensor_settings_common_a)); 301 ARRAY_SIZE(tbl_sensor_settings_common1));
301 ctrl_out(gspca_dev, 0x40, 3, 0x0000, 0x0200, 12, dat_post); 302 ctrl_out(gspca_dev, 0x40, 3, 0x0000, 0x0200, 12, dat_post);
302 common(gspca_dev); 303 common(gspca_dev);
303 keep_on_fetching_validx(gspca_dev, tbl_sensor_settings_common_a, 304 keep_on_fetching_validx(gspca_dev, tbl_sensor_settings_common1,
304 ARRAY_SIZE(tbl_sensor_settings_common_a), n); 305 ARRAY_SIZE(tbl_sensor_settings_common1), n);
305 306
306 switch (reso) { 307 switch (reso) {
307 case IMAGE_640: 308 case IMAGE_640:
@@ -316,18 +317,18 @@ static int ov2640_init_post_alt(struct gspca_dev *gspca_dev)
316 317
317 case IMAGE_1600: 318 case IMAGE_1600:
318 case IMAGE_1280: 319 case IMAGE_1280:
319 n = fetch_validx(gspca_dev, tbl_big_a, ARRAY_SIZE(tbl_big_a)); 320 n = fetch_validx(gspca_dev, tbl_big1, ARRAY_SIZE(tbl_big1));
320 321
321 if (reso == IMAGE_1280) { 322 if (reso == IMAGE_1280) {
322 n = fetch_validx(gspca_dev, tbl_big_b, 323 n = fetch_validx(gspca_dev, tbl_big2,
323 ARRAY_SIZE(tbl_big_b)); 324 ARRAY_SIZE(tbl_big2));
324 } else { 325 } else {
325 ctrl_out(gspca_dev, 0x40, 1, 0x601d, 0x0086, 0, NULL); 326 ctrl_out(gspca_dev, 0x40, 1, 0x601d, 0x0086, 0, NULL);
326 ctrl_out(gspca_dev, 0x40, 1, 0x6001, 0x00d7, 0, NULL); 327 ctrl_out(gspca_dev, 0x40, 1, 0x6001, 0x00d7, 0, NULL);
327 ctrl_out(gspca_dev, 0x40, 1, 0x6082, 0x00d3, 0, NULL); 328 ctrl_out(gspca_dev, 0x40, 1, 0x6082, 0x00d3, 0, NULL);
328 } 329 }
329 330
330 n = fetch_validx(gspca_dev, tbl_big_c, ARRAY_SIZE(tbl_big_c)); 331 n = fetch_validx(gspca_dev, tbl_big3, ARRAY_SIZE(tbl_big3));
331 332
332 if (reso == IMAGE_1280) { 333 if (reso == IMAGE_1280) {
333 ctrl_out(gspca_dev, 0x40, 1, 0x6001, 0x00ff, 0, NULL); 334 ctrl_out(gspca_dev, 0x40, 1, 0x6001, 0x00ff, 0, NULL);
@@ -343,20 +344,20 @@ static int ov2640_init_post_alt(struct gspca_dev *gspca_dev)
343 break; 344 break;
344 } 345 }
345 346
346 n = fetch_validx(gspca_dev, tbl_sensor_settings_common_b, 347 n = fetch_validx(gspca_dev, tbl_sensor_settings_common2,
347 ARRAY_SIZE(tbl_sensor_settings_common_b)); 348 ARRAY_SIZE(tbl_sensor_settings_common2));
348 ctrl_in(gspca_dev, 0xc0, 2, 0x0000, 0x0000, 1, c50); 349 ctrl_in(gspca_dev, 0xc0, 2, 0x0000, 0x0000, 1, c50);
349 keep_on_fetching_validx(gspca_dev, tbl_sensor_settings_common_b, 350 keep_on_fetching_validx(gspca_dev, tbl_sensor_settings_common2,
350 ARRAY_SIZE(tbl_sensor_settings_common_b), n); 351 ARRAY_SIZE(tbl_sensor_settings_common2), n);
351 ctrl_in(gspca_dev, 0xc0, 2, 0x6000, 0x8004, 1, c28); 352 ctrl_in(gspca_dev, 0xc0, 2, 0x6000, 0x8004, 1, c28);
352 keep_on_fetching_validx(gspca_dev, tbl_sensor_settings_common_b, 353 keep_on_fetching_validx(gspca_dev, tbl_sensor_settings_common2,
353 ARRAY_SIZE(tbl_sensor_settings_common_b), n); 354 ARRAY_SIZE(tbl_sensor_settings_common2), n);
354 ctrl_in(gspca_dev, 0xc0, 2, 0x6000, 0x8004, 1, ca8); 355 ctrl_in(gspca_dev, 0xc0, 2, 0x6000, 0x8004, 1, ca8);
355 keep_on_fetching_validx(gspca_dev, tbl_sensor_settings_common_b, 356 keep_on_fetching_validx(gspca_dev, tbl_sensor_settings_common2,
356 ARRAY_SIZE(tbl_sensor_settings_common_b), n); 357 ARRAY_SIZE(tbl_sensor_settings_common2), n);
357 ctrl_in(gspca_dev, 0xc0, 2, 0x0000, 0x0000, 1, c50); 358 ctrl_in(gspca_dev, 0xc0, 2, 0x0000, 0x0000, 1, c50);
358 keep_on_fetching_validx(gspca_dev, tbl_sensor_settings_common_b, 359 keep_on_fetching_validx(gspca_dev, tbl_sensor_settings_common2,
359 ARRAY_SIZE(tbl_sensor_settings_common_b), n); 360 ARRAY_SIZE(tbl_sensor_settings_common2), n);
360 361
361 ov2640_camera_settings(gspca_dev); 362 ov2640_camera_settings(gspca_dev);
362 363
@@ -395,6 +396,7 @@ static int ov2640_camera_settings(struct gspca_dev *gspca_dev)
395 s32 wbal = sd->vcur.whitebal; 396 s32 wbal = sd->vcur.whitebal;
396 397
397 if (backlight != sd->vold.backlight) { 398 if (backlight != sd->vold.backlight) {
399 /* No sd->vold.backlight=backlight; (to be done again later) */
398 if (backlight < 0 || backlight > sd->vmax.backlight) 400 if (backlight < 0 || backlight > sd->vmax.backlight)
399 backlight = 0; 401 backlight = 0;
400 402
@@ -404,7 +406,6 @@ static int ov2640_camera_settings(struct gspca_dev *gspca_dev)
404 0, NULL); 406 0, NULL);
405 ctrl_out(gspca_dev, 0x40, 1, 0x601f + backlight - 10, 0x0025, 407 ctrl_out(gspca_dev, 0x40, 1, 0x601f + backlight - 10, 0x0025,
406 0, NULL); 408 0, NULL);
407 /* No sd->vold.backlight=backlight; (to be done again later) */
408 } 409 }
409 410
410 if (bright != sd->vold.brightness) { 411 if (bright != sd->vold.brightness) {
diff --git a/drivers/media/video/gspca/gl860/gl860-ov9655.c b/drivers/media/video/gspca/gl860/gl860-ov9655.c
index eda3346f939c..d412694c50af 100644
--- a/drivers/media/video/gspca/gl860/gl860-ov9655.c
+++ b/drivers/media/video/gspca/gl860/gl860-ov9655.c
@@ -1,7 +1,6 @@
1/* @file gl860-ov9655.c 1/* Subdriver for the GL860 chip with the OV9655 sensor
2 * @author Olivier LORIN, from logs done by Simon (Sur3) and Almighurt 2 * Author Olivier LORIN, from logs done by Simon (Sur3) and Almighurt
3 * on dsd's weblog 3 * on dsd's weblog
4 * @date 2009-08-27
5 * 4 *
6 * This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
@@ -104,14 +103,14 @@ static u8 *tbl_800[] = {
104}; 103};
105 104
106static u8 c04[] = {0x04}; 105static u8 c04[] = {0x04};
107static u8 dat_post_1[] = "\x04\x00\x10\x20\xa1\x00\x00\x02"; 106static u8 dat_post1[] = "\x04\x00\x10\x20\xa1\x00\x00\x02";
108static u8 dat_post_2[] = "\x10\x10\xc1\x02"; 107static u8 dat_post2[] = "\x10\x10\xc1\x02";
109static u8 dat_post_3[] = "\x04\x00\x10\x7c\xa1\x00\x00\x04"; 108static u8 dat_post3[] = "\x04\x00\x10\x7c\xa1\x00\x00\x04";
110static u8 dat_post_4[] = "\x10\x02\xc1\x06"; 109static u8 dat_post4[] = "\x10\x02\xc1\x06";
111static u8 dat_post_5[] = "\x04\x00\x10\x7b\xa1\x00\x00\x08"; 110static u8 dat_post5[] = "\x04\x00\x10\x7b\xa1\x00\x00\x08";
112static u8 dat_post_6[] = "\x10\x10\xc1\x05"; 111static u8 dat_post6[] = "\x10\x10\xc1\x05";
113static u8 dat_post_7[] = "\x04\x00\x10\x7c\xa1\x00\x00\x08"; 112static u8 dat_post7[] = "\x04\x00\x10\x7c\xa1\x00\x00\x08";
114static u8 dat_post_8[] = "\x04\x00\x10\x7c\xa1\x00\x00\x09"; 113static u8 dat_post8[] = "\x04\x00\x10\x7c\xa1\x00\x00\x09";
115 114
116static struct validx tbl_init_post_alt[] = { 115static struct validx tbl_init_post_alt[] = {
117 {0x6032, 0x00ff}, {0x6032, 0x00ff}, {0x6032, 0x00ff}, {0x603c, 0x00ff}, 116 {0x6032, 0x00ff}, {0x6032, 0x00ff}, {0x6032, 0x00ff}, {0x603c, 0x00ff},
@@ -212,7 +211,7 @@ static int ov9655_init_pre_alt(struct gspca_dev *gspca_dev)
212static int ov9655_init_post_alt(struct gspca_dev *gspca_dev) 211static int ov9655_init_post_alt(struct gspca_dev *gspca_dev)
213{ 212{
214 s32 reso = gspca_dev->cam.cam_mode[(s32) gspca_dev->curr_mode].priv; 213 s32 reso = gspca_dev->cam.cam_mode[(s32) gspca_dev->curr_mode].priv;
215 s32 n; /* reserved for FETCH macros */ 214 s32 n; /* reserved for FETCH functions */
216 s32 i; 215 s32 i;
217 u8 **tbl; 216 u8 **tbl;
218 217
@@ -243,7 +242,7 @@ static int ov9655_init_post_alt(struct gspca_dev *gspca_dev)
243 ctrl_in(gspca_dev, 0xc0, 2, 0x6000, 0x801e, 1, c04); 242 ctrl_in(gspca_dev, 0xc0, 2, 0x6000, 0x801e, 1, c04);
244 keep_on_fetching_validx(gspca_dev, tbl_init_post_alt, 243 keep_on_fetching_validx(gspca_dev, tbl_init_post_alt,
245 ARRAY_SIZE(tbl_init_post_alt), n); 244 ARRAY_SIZE(tbl_init_post_alt), n);
246 ctrl_out(gspca_dev, 0x40, 3, 0x6000, 0x0200, 8, dat_post_1); 245 ctrl_out(gspca_dev, 0x40, 3, 0x6000, 0x0200, 8, dat_post1);
247 keep_on_fetching_validx(gspca_dev, tbl_init_post_alt, 246 keep_on_fetching_validx(gspca_dev, tbl_init_post_alt,
248 ARRAY_SIZE(tbl_init_post_alt), n); 247 ARRAY_SIZE(tbl_init_post_alt), n);
249 248
@@ -259,7 +258,7 @@ static int ov9655_init_post_alt(struct gspca_dev *gspca_dev)
259 ctrl_in(gspca_dev, 0xc0, 2, 0x6000, 0x801e, 1, c04); 258 ctrl_in(gspca_dev, 0xc0, 2, 0x6000, 0x801e, 1, c04);
260 keep_on_fetching_validx(gspca_dev, tbl_init_post_alt, 259 keep_on_fetching_validx(gspca_dev, tbl_init_post_alt,
261 ARRAY_SIZE(tbl_init_post_alt), n); 260 ARRAY_SIZE(tbl_init_post_alt), n);
262 ctrl_out(gspca_dev, 0x40, 3, 0x6000, 0x0200, 8, dat_post_1); 261 ctrl_out(gspca_dev, 0x40, 3, 0x6000, 0x0200, 8, dat_post1);
263 keep_on_fetching_validx(gspca_dev, tbl_init_post_alt, 262 keep_on_fetching_validx(gspca_dev, tbl_init_post_alt,
264 ARRAY_SIZE(tbl_init_post_alt), n); 263 ARRAY_SIZE(tbl_init_post_alt), n);
265 264
@@ -270,18 +269,18 @@ static int ov9655_init_post_alt(struct gspca_dev *gspca_dev)
270 keep_on_fetching_validx(gspca_dev, tbl_init_post_alt, 269 keep_on_fetching_validx(gspca_dev, tbl_init_post_alt,
271 ARRAY_SIZE(tbl_init_post_alt), n); 270 ARRAY_SIZE(tbl_init_post_alt), n);
272 271
273 ctrl_out(gspca_dev, 0x40, 3, 0x6000, 0x0200, 8, dat_post_1); 272 ctrl_out(gspca_dev, 0x40, 3, 0x6000, 0x0200, 8, dat_post1);
274 273
275 ctrl_out(gspca_dev, 0x40, 3, 0x0000, 0x0200, 4, dat_post_2); 274 ctrl_out(gspca_dev, 0x40, 3, 0x0000, 0x0200, 4, dat_post2);
276 ctrl_out(gspca_dev, 0x40, 3, 0x6000, 0x0200, 8, dat_post_3); 275 ctrl_out(gspca_dev, 0x40, 3, 0x6000, 0x0200, 8, dat_post3);
277 276
278 ctrl_out(gspca_dev, 0x40, 3, 0x0000, 0x0200, 4, dat_post_4); 277 ctrl_out(gspca_dev, 0x40, 3, 0x0000, 0x0200, 4, dat_post4);
279 ctrl_out(gspca_dev, 0x40, 3, 0x6000, 0x0200, 8, dat_post_5); 278 ctrl_out(gspca_dev, 0x40, 3, 0x6000, 0x0200, 8, dat_post5);
280 279
281 ctrl_out(gspca_dev, 0x40, 3, 0x0000, 0x0200, 4, dat_post_6); 280 ctrl_out(gspca_dev, 0x40, 3, 0x0000, 0x0200, 4, dat_post6);
282 ctrl_out(gspca_dev, 0x40, 3, 0x6000, 0x0200, 8, dat_post_7); 281 ctrl_out(gspca_dev, 0x40, 3, 0x6000, 0x0200, 8, dat_post7);
283 282
284 ctrl_out(gspca_dev, 0x40, 3, 0x6000, 0x0200, 8, dat_post_8); 283 ctrl_out(gspca_dev, 0x40, 3, 0x6000, 0x0200, 8, dat_post8);
285 284
286 ov9655_camera_settings(gspca_dev); 285 ov9655_camera_settings(gspca_dev);
287 286
diff --git a/drivers/media/video/gspca/gl860/gl860.c b/drivers/media/video/gspca/gl860/gl860.c
index 1c3ec0242c32..a2108dd71053 100644
--- a/drivers/media/video/gspca/gl860/gl860.c
+++ b/drivers/media/video/gspca/gl860/gl860.c
@@ -1,9 +1,7 @@
1/* @file gl860.c 1/* GSPCA subdrivers for Genesys Logic webcams with the GL860 chip
2 * @date 2009-08-27 2 * Subdriver core
3 * 3 *
4 * Genesys Logic webcam with gl860 subdrivers 4 * 2009/09/24 Olivier Lorin <o.lorin@laposte.net>
5 *
6 * Driver by Olivier Lorin <o.lorin@laposte.net>
7 * GSPCA by Jean-Francois Moine <http://moinejf.free.fr> 5 * GSPCA by Jean-Francois Moine <http://moinejf.free.fr>
8 * Thanks BUGabundo and Malmostoso for your amazing help! 6 * Thanks BUGabundo and Malmostoso for your amazing help!
9 * 7 *
diff --git a/drivers/media/video/gspca/gl860/gl860.h b/drivers/media/video/gspca/gl860/gl860.h
index cef4e24c1e61..305061ff8387 100644
--- a/drivers/media/video/gspca/gl860/gl860.h
+++ b/drivers/media/video/gspca/gl860/gl860.h
@@ -1,6 +1,7 @@
1/* @file gl860.h 1/* GSPCA subdrivers for Genesys Logic webcams with the GL860 chip
2 * @author Olivier LORIN, tiré du pilote Syntek par Nicolas VIVIEN 2 * Subdriver declarations
3 * @date 2009-08-27 3 *
4 * 2009/10/14 Olivier LORIN <o.lorin@laposte.net>
4 * 5 *
5 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by