aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c76
-rw-r--r--drivers/media/video/gspca/stv06xx/stv06xx_hdcs.h65
-rw-r--r--drivers/media/video/gspca/stv06xx/stv06xx_pb0100.c141
-rw-r--r--drivers/media/video/gspca/stv06xx/stv06xx_pb0100.h128
-rw-r--r--drivers/media/video/gspca/stv06xx/stv06xx_sensor.h8
-rw-r--r--drivers/media/video/gspca/stv06xx/stv06xx_vv6410.c61
-rw-r--r--drivers/media/video/gspca/stv06xx/stv06xx_vv6410.h56
7 files changed, 258 insertions, 277 deletions
diff --git a/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c b/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c
index 14335a9e4bb5..b16903814203 100644
--- a/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c
+++ b/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c
@@ -30,6 +30,66 @@
30 30
31#include "stv06xx_hdcs.h" 31#include "stv06xx_hdcs.h"
32 32
33static const struct ctrl hdcs1x00_ctrl[] = {
34 {
35 {
36 .id = V4L2_CID_EXPOSURE,
37 .type = V4L2_CTRL_TYPE_INTEGER,
38 .name = "exposure",
39 .minimum = 0x00,
40 .maximum = 0xffff,
41 .step = 0x1,
42 .default_value = HDCS_DEFAULT_EXPOSURE,
43 .flags = V4L2_CTRL_FLAG_SLIDER
44 },
45 .set = hdcs_set_exposure,
46 .get = hdcs_get_exposure
47 }, {
48 {
49 .id = V4L2_CID_GAIN,
50 .type = V4L2_CTRL_TYPE_INTEGER,
51 .name = "gain",
52 .minimum = 0x00,
53 .maximum = 0xff,
54 .step = 0x1,
55 .default_value = HDCS_DEFAULT_GAIN,
56 .flags = V4L2_CTRL_FLAG_SLIDER
57 },
58 .set = hdcs_set_gain,
59 .get = hdcs_get_gain
60 }
61};
62
63static struct v4l2_pix_format hdcs1x00_mode[] = {
64 {
65 HDCS_1X00_DEF_WIDTH,
66 HDCS_1X00_DEF_HEIGHT,
67 V4L2_PIX_FMT_SBGGR8,
68 V4L2_FIELD_NONE,
69 .sizeimage =
70 HDCS_1X00_DEF_WIDTH * HDCS_1X00_DEF_HEIGHT,
71 .bytesperline = HDCS_1X00_DEF_WIDTH,
72 .colorspace = V4L2_COLORSPACE_SRGB,
73 .priv = 1
74 }
75};
76
77static const struct ctrl hdcs1020_ctrl[] = {};
78
79static struct v4l2_pix_format hdcs1020_mode[] = {
80 {
81 HDCS_1020_DEF_WIDTH,
82 HDCS_1020_DEF_HEIGHT,
83 V4L2_PIX_FMT_SBGGR8,
84 V4L2_FIELD_NONE,
85 .sizeimage =
86 HDCS_1020_DEF_WIDTH * HDCS_1020_DEF_HEIGHT,
87 .bytesperline = HDCS_1020_DEF_WIDTH,
88 .colorspace = V4L2_COLORSPACE_SRGB,
89 .priv = 1
90 }
91};
92
33enum hdcs_power_state { 93enum hdcs_power_state {
34 HDCS_STATE_SLEEP, 94 HDCS_STATE_SLEEP,
35 HDCS_STATE_IDLE, 95 HDCS_STATE_IDLE,
@@ -353,10 +413,10 @@ static int hdcs_probe_1x00(struct sd *sd)
353 413
354 info("HDCS-1000/1100 sensor detected"); 414 info("HDCS-1000/1100 sensor detected");
355 415
356 sd->gspca_dev.cam.cam_mode = stv06xx_sensor_hdcs1x00.modes; 416 sd->gspca_dev.cam.cam_mode = hdcs1x00_mode;
357 sd->gspca_dev.cam.nmodes = stv06xx_sensor_hdcs1x00.nmodes; 417 sd->gspca_dev.cam.nmodes = ARRAY_SIZE(hdcs1x00_mode);
358 sd->desc.ctrls = stv06xx_sensor_hdcs1x00.ctrls; 418 sd->desc.ctrls = hdcs1x00_ctrl;
359 sd->desc.nctrls = stv06xx_sensor_hdcs1x00.nctrls; 419 sd->desc.nctrls = ARRAY_SIZE(hdcs1x00_ctrl);
360 420
361 hdcs = kmalloc(sizeof(struct hdcs), GFP_KERNEL); 421 hdcs = kmalloc(sizeof(struct hdcs), GFP_KERNEL);
362 if (!hdcs) 422 if (!hdcs)
@@ -412,10 +472,10 @@ static int hdcs_probe_1020(struct sd *sd)
412 472
413 info("HDCS-1020 sensor detected"); 473 info("HDCS-1020 sensor detected");
414 474
415 sd->gspca_dev.cam.cam_mode = stv06xx_sensor_hdcs1020.modes; 475 sd->gspca_dev.cam.cam_mode = hdcs1020_mode;
416 sd->gspca_dev.cam.nmodes = stv06xx_sensor_hdcs1020.nmodes; 476 sd->gspca_dev.cam.nmodes = ARRAY_SIZE(hdcs1020_mode);
417 sd->desc.ctrls = stv06xx_sensor_hdcs1020.ctrls; 477 sd->desc.ctrls = hdcs1020_ctrl;
418 sd->desc.nctrls = stv06xx_sensor_hdcs1020.nctrls; 478 sd->desc.nctrls = ARRAY_SIZE(hdcs1020_ctrl);
419 479
420 hdcs = kmalloc(sizeof(struct hdcs), GFP_KERNEL); 480 hdcs = kmalloc(sizeof(struct hdcs), GFP_KERNEL);
421 if (!hdcs) 481 if (!hdcs)
diff --git a/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.h b/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.h
index 9c7279a4cd88..412f06cf3d5c 100644
--- a/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.h
+++ b/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.h
@@ -152,53 +152,6 @@ const struct stv06xx_sensor stv06xx_sensor_hdcs1x00 = {
152 .stop = hdcs_stop, 152 .stop = hdcs_stop,
153 .disconnect = hdcs_disconnect, 153 .disconnect = hdcs_disconnect,
154 .dump = hdcs_dump, 154 .dump = hdcs_dump,
155
156 .nctrls = 2,
157 .ctrls = {
158 {
159 {
160 .id = V4L2_CID_EXPOSURE,
161 .type = V4L2_CTRL_TYPE_INTEGER,
162 .name = "exposure",
163 .minimum = 0x00,
164 .maximum = 0xffff,
165 .step = 0x1,
166 .default_value = HDCS_DEFAULT_EXPOSURE,
167 .flags = V4L2_CTRL_FLAG_SLIDER
168 },
169 .set = hdcs_set_exposure,
170 .get = hdcs_get_exposure
171 },
172 {
173 {
174 .id = V4L2_CID_GAIN,
175 .type = V4L2_CTRL_TYPE_INTEGER,
176 .name = "gain",
177 .minimum = 0x00,
178 .maximum = 0xff,
179 .step = 0x1,
180 .default_value = HDCS_DEFAULT_GAIN,
181 .flags = V4L2_CTRL_FLAG_SLIDER
182 },
183 .set = hdcs_set_gain,
184 .get = hdcs_get_gain
185 }
186 },
187
188 .nmodes = 1,
189 .modes = {
190 {
191 HDCS_1X00_DEF_WIDTH,
192 HDCS_1X00_DEF_HEIGHT,
193 V4L2_PIX_FMT_SBGGR8,
194 V4L2_FIELD_NONE,
195 .sizeimage =
196 HDCS_1X00_DEF_WIDTH * HDCS_1X00_DEF_HEIGHT,
197 .bytesperline = HDCS_1X00_DEF_WIDTH,
198 .colorspace = V4L2_COLORSPACE_SRGB,
199 .priv = 1
200 }
201 }
202}; 155};
203 156
204const struct stv06xx_sensor stv06xx_sensor_hdcs1020 = { 157const struct stv06xx_sensor stv06xx_sensor_hdcs1020 = {
@@ -207,29 +160,11 @@ const struct stv06xx_sensor stv06xx_sensor_hdcs1020 = {
207 .i2c_addr = (0x55 << 1), 160 .i2c_addr = (0x55 << 1),
208 .i2c_len = 1, 161 .i2c_len = 1,
209 162
210 .nctrls = 0,
211 .ctrls = {},
212
213 .init = hdcs_init, 163 .init = hdcs_init,
214 .probe = hdcs_probe_1020, 164 .probe = hdcs_probe_1020,
215 .start = hdcs_start, 165 .start = hdcs_start,
216 .stop = hdcs_stop, 166 .stop = hdcs_stop,
217 .dump = hdcs_dump, 167 .dump = hdcs_dump,
218
219 .nmodes = 1,
220 .modes = {
221 {
222 HDCS_1020_DEF_WIDTH,
223 HDCS_1020_DEF_HEIGHT,
224 V4L2_PIX_FMT_SBGGR8,
225 V4L2_FIELD_NONE,
226 .sizeimage =
227 HDCS_1020_DEF_WIDTH * HDCS_1020_DEF_HEIGHT,
228 .bytesperline = HDCS_1020_DEF_WIDTH,
229 .colorspace = V4L2_COLORSPACE_SRGB,
230 .priv = 1
231 }
232 }
233}; 168};
234 169
235static const u16 stv_bridge_init[][2] = { 170static const u16 stv_bridge_init[][2] = {
diff --git a/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.c b/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.c
index d0a0f8596454..ae2d04b85604 100644
--- a/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.c
+++ b/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.c
@@ -46,6 +46,132 @@
46 46
47#include "stv06xx_pb0100.h" 47#include "stv06xx_pb0100.h"
48 48
49static const struct ctrl pb0100_ctrl[] = {
50#define GAIN_IDX 0
51 {
52 {
53 .id = V4L2_CID_GAIN,
54 .type = V4L2_CTRL_TYPE_INTEGER,
55 .name = "Gain",
56 .minimum = 0,
57 .maximum = 255,
58 .step = 1,
59 .default_value = 128
60 },
61 .set = pb0100_set_gain,
62 .get = pb0100_get_gain
63 },
64#define RED_BALANCE_IDX 1
65 {
66 {
67 .id = V4L2_CID_RED_BALANCE,
68 .type = V4L2_CTRL_TYPE_INTEGER,
69 .name = "Red Balance",
70 .minimum = -255,
71 .maximum = 255,
72 .step = 1,
73 .default_value = 0
74 },
75 .set = pb0100_set_red_balance,
76 .get = pb0100_get_red_balance
77 },
78#define BLUE_BALANCE_IDX 2
79 {
80 {
81 .id = V4L2_CID_BLUE_BALANCE,
82 .type = V4L2_CTRL_TYPE_INTEGER,
83 .name = "Blue Balance",
84 .minimum = -255,
85 .maximum = 255,
86 .step = 1,
87 .default_value = 0
88 },
89 .set = pb0100_set_blue_balance,
90 .get = pb0100_get_blue_balance
91 },
92#define EXPOSURE_IDX 3
93 {
94 {
95 .id = V4L2_CID_EXPOSURE,
96 .type = V4L2_CTRL_TYPE_INTEGER,
97 .name = "Exposure",
98 .minimum = 0,
99 .maximum = 511,
100 .step = 1,
101 .default_value = 12
102 },
103 .set = pb0100_set_exposure,
104 .get = pb0100_get_exposure
105 },
106#define AUTOGAIN_IDX 4
107 {
108 {
109 .id = V4L2_CID_AUTOGAIN,
110 .type = V4L2_CTRL_TYPE_BOOLEAN,
111 .name = "Automatic Gain and Exposure",
112 .minimum = 0,
113 .maximum = 1,
114 .step = 1,
115 .default_value = 1
116 },
117 .set = pb0100_set_autogain,
118 .get = pb0100_get_autogain
119 },
120#define AUTOGAIN_TARGET_IDX 5
121 {
122 {
123 .id = V4L2_CTRL_CLASS_USER + 0x1000,
124 .type = V4L2_CTRL_TYPE_INTEGER,
125 .name = "Automatic Gain Target",
126 .minimum = 0,
127 .maximum = 255,
128 .step = 1,
129 .default_value = 128
130 },
131 .set = pb0100_set_autogain_target,
132 .get = pb0100_get_autogain_target
133 },
134#define NATURAL_IDX 6
135 {
136 {
137 .id = V4L2_CTRL_CLASS_USER + 0x1001,
138 .type = V4L2_CTRL_TYPE_BOOLEAN,
139 .name = "Natural Light Source",
140 .minimum = 0,
141 .maximum = 1,
142 .step = 1,
143 .default_value = 1
144 },
145 .set = pb0100_set_natural,
146 .get = pb0100_get_natural
147 }
148};
149
150static struct v4l2_pix_format pb0100_mode[] = {
151/* low res / subsample modes disabled as they are only half res horizontal,
152 halving the vertical resolution does not seem to work */
153 {
154 320,
155 240,
156 V4L2_PIX_FMT_SGRBG8,
157 V4L2_FIELD_NONE,
158 .sizeimage = 320 * 240,
159 .bytesperline = 320,
160 .colorspace = V4L2_COLORSPACE_SRGB,
161 .priv = PB0100_CROP_TO_VGA
162 },
163 {
164 352,
165 288,
166 V4L2_PIX_FMT_SGRBG8,
167 V4L2_FIELD_NONE,
168 .sizeimage = 352 * 288,
169 .bytesperline = 352,
170 .colorspace = V4L2_COLORSPACE_SRGB,
171 .priv = 0
172 }
173};
174
49static int pb0100_probe(struct sd *sd) 175static int pb0100_probe(struct sd *sd)
50{ 176{
51 u16 sensor; 177 u16 sensor;
@@ -59,20 +185,19 @@ static int pb0100_probe(struct sd *sd)
59 185
60 if ((sensor >> 8) == 0x64) { 186 if ((sensor >> 8) == 0x64) {
61 sensor_settings = kmalloc( 187 sensor_settings = kmalloc(
62 stv06xx_sensor_pb0100.nctrls * sizeof(s32), 188 ARRAY_SIZE(pb0100_ctrl) * sizeof(s32),
63 GFP_KERNEL); 189 GFP_KERNEL);
64 if (!sensor_settings) 190 if (!sensor_settings)
65 return -ENOMEM; 191 return -ENOMEM;
66 192
67 info("Photobit pb0100 sensor detected"); 193 info("Photobit pb0100 sensor detected");
68 194
69 sd->gspca_dev.cam.cam_mode = stv06xx_sensor_pb0100.modes; 195 sd->gspca_dev.cam.cam_mode = pb0100_mode;
70 sd->gspca_dev.cam.nmodes = stv06xx_sensor_pb0100.nmodes; 196 sd->gspca_dev.cam.nmodes = ARRAY_SIZE(pb0100_mode);
71 sd->desc.ctrls = stv06xx_sensor_pb0100.ctrls; 197 sd->desc.ctrls = pb0100_ctrl;
72 sd->desc.nctrls = stv06xx_sensor_pb0100.nctrls; 198 sd->desc.nctrls = ARRAY_SIZE(pb0100_ctrl);
73 for (i = 0; i < stv06xx_sensor_pb0100.nctrls; i++) 199 for (i = 0; i < sd->desc.nctrls; i++)
74 sensor_settings[i] = stv06xx_sensor_pb0100. 200 sensor_settings[i] = pb0100_ctrl[i].qctrl.default_value;
75 ctrls[i].qctrl.default_value;
76 sd->sensor_priv = sensor_settings; 201 sd->sensor_priv = sensor_settings;
77 202
78 return 0; 203 return 0;
diff --git a/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.h b/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.h
index 5ea21a1154c4..da7c13ed8ffb 100644
--- a/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.h
+++ b/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.h
@@ -137,139 +137,11 @@ const struct stv06xx_sensor stv06xx_sensor_pb0100 = {
137 .i2c_addr = 0xba, 137 .i2c_addr = 0xba,
138 .i2c_len = 2, 138 .i2c_len = 2,
139 139
140 .nctrls = 7,
141 .ctrls = {
142#define GAIN_IDX 0
143 {
144 {
145 .id = V4L2_CID_GAIN,
146 .type = V4L2_CTRL_TYPE_INTEGER,
147 .name = "Gain",
148 .minimum = 0,
149 .maximum = 255,
150 .step = 1,
151 .default_value = 128
152 },
153 .set = pb0100_set_gain,
154 .get = pb0100_get_gain
155 },
156#define RED_BALANCE_IDX 1
157 {
158 {
159 .id = V4L2_CID_RED_BALANCE,
160 .type = V4L2_CTRL_TYPE_INTEGER,
161 .name = "Red Balance",
162 .minimum = -255,
163 .maximum = 255,
164 .step = 1,
165 .default_value = 0
166 },
167 .set = pb0100_set_red_balance,
168 .get = pb0100_get_red_balance
169 },
170#define BLUE_BALANCE_IDX 2
171 {
172 {
173 .id = V4L2_CID_BLUE_BALANCE,
174 .type = V4L2_CTRL_TYPE_INTEGER,
175 .name = "Blue Balance",
176 .minimum = -255,
177 .maximum = 255,
178 .step = 1,
179 .default_value = 0
180 },
181 .set = pb0100_set_blue_balance,
182 .get = pb0100_get_blue_balance
183 },
184#define EXPOSURE_IDX 3
185 {
186 {
187 .id = V4L2_CID_EXPOSURE,
188 .type = V4L2_CTRL_TYPE_INTEGER,
189 .name = "Exposure",
190 .minimum = 0,
191 .maximum = 511,
192 .step = 1,
193 .default_value = 12
194 },
195 .set = pb0100_set_exposure,
196 .get = pb0100_get_exposure
197 },
198#define AUTOGAIN_IDX 4
199 {
200 {
201 .id = V4L2_CID_AUTOGAIN,
202 .type = V4L2_CTRL_TYPE_BOOLEAN,
203 .name = "Automatic Gain and Exposure",
204 .minimum = 0,
205 .maximum = 1,
206 .step = 1,
207 .default_value = 1
208 },
209 .set = pb0100_set_autogain,
210 .get = pb0100_get_autogain
211 },
212#define AUTOGAIN_TARGET_IDX 5
213 {
214 {
215 .id = V4L2_CTRL_CLASS_USER + 0x1000,
216 .type = V4L2_CTRL_TYPE_INTEGER,
217 .name = "Automatic Gain Target",
218 .minimum = 0,
219 .maximum = 255,
220 .step = 1,
221 .default_value = 128
222 },
223 .set = pb0100_set_autogain_target,
224 .get = pb0100_get_autogain_target
225 },
226#define NATURAL_IDX 6
227 {
228 {
229 .id = V4L2_CTRL_CLASS_USER + 0x1001,
230 .type = V4L2_CTRL_TYPE_BOOLEAN,
231 .name = "Natural Light Source",
232 .minimum = 0,
233 .maximum = 1,
234 .step = 1,
235 .default_value = 1
236 },
237 .set = pb0100_set_natural,
238 .get = pb0100_get_natural
239 },
240 },
241
242 .init = pb0100_init, 140 .init = pb0100_init,
243 .probe = pb0100_probe, 141 .probe = pb0100_probe,
244 .start = pb0100_start, 142 .start = pb0100_start,
245 .stop = pb0100_stop, 143 .stop = pb0100_stop,
246 .dump = pb0100_dump, 144 .dump = pb0100_dump,
247
248 .nmodes = 2,
249 .modes = {
250/* low res / subsample modes disabled as they are only half res horizontal,
251 halving the vertical resolution does not seem to work */
252 {
253 320,
254 240,
255 V4L2_PIX_FMT_SGRBG8,
256 V4L2_FIELD_NONE,
257 .sizeimage = 320 * 240,
258 .bytesperline = 320,
259 .colorspace = V4L2_COLORSPACE_SRGB,
260 .priv = PB0100_CROP_TO_VGA
261 },
262 {
263 352,
264 288,
265 V4L2_PIX_FMT_SGRBG8,
266 V4L2_FIELD_NONE,
267 .sizeimage = 352 * 288,
268 .bytesperline = 352,
269 .colorspace = V4L2_COLORSPACE_SRGB,
270 .priv = 0
271 },
272 }
273}; 145};
274 146
275#endif 147#endif
diff --git a/drivers/media/video/gspca/stv06xx/stv06xx_sensor.h b/drivers/media/video/gspca/stv06xx/stv06xx_sensor.h
index c726dacefa1f..e88c42f7d2f8 100644
--- a/drivers/media/video/gspca/stv06xx/stv06xx_sensor.h
+++ b/drivers/media/video/gspca/stv06xx/stv06xx_sensor.h
@@ -41,8 +41,6 @@ extern const struct stv06xx_sensor stv06xx_sensor_hdcs1x00;
41extern const struct stv06xx_sensor stv06xx_sensor_hdcs1020; 41extern const struct stv06xx_sensor stv06xx_sensor_hdcs1020;
42extern const struct stv06xx_sensor stv06xx_sensor_pb0100; 42extern const struct stv06xx_sensor stv06xx_sensor_pb0100;
43 43
44#define STV06XX_MAX_CTRLS (V4L2_CID_LASTP1 - V4L2_CID_BASE + 10)
45
46struct stv06xx_sensor { 44struct stv06xx_sensor {
47 /* Defines the name of a sensor */ 45 /* Defines the name of a sensor */
48 char name[32]; 46 char name[32];
@@ -81,12 +79,6 @@ struct stv06xx_sensor {
81 79
82 /* Instructs the sensor to dump all its contents */ 80 /* Instructs the sensor to dump all its contents */
83 int (*dump)(struct sd *sd); 81 int (*dump)(struct sd *sd);
84
85 int nctrls;
86 struct ctrl ctrls[STV06XX_MAX_CTRLS];
87
88 char nmodes;
89 struct v4l2_pix_format modes[];
90}; 82};
91 83
92#endif 84#endif
diff --git a/drivers/media/video/gspca/stv06xx/stv06xx_vv6410.c b/drivers/media/video/gspca/stv06xx/stv06xx_vv6410.c
index 1ca91f2a6dee..a204b5891f63 100644
--- a/drivers/media/video/gspca/stv06xx/stv06xx_vv6410.c
+++ b/drivers/media/video/gspca/stv06xx/stv06xx_vv6410.c
@@ -29,6 +29,59 @@
29 29
30#include "stv06xx_vv6410.h" 30#include "stv06xx_vv6410.h"
31 31
32static struct v4l2_pix_format vv6410_mode[] = {
33 {
34 356,
35 292,
36 V4L2_PIX_FMT_SGRBG8,
37 V4L2_FIELD_NONE,
38 .sizeimage = 356 * 292,
39 .bytesperline = 356,
40 .colorspace = V4L2_COLORSPACE_SRGB,
41 .priv = 0
42 }
43};
44
45static const struct ctrl vv6410_ctrl[] = {
46 {
47 {
48 .id = V4L2_CID_HFLIP,
49 .type = V4L2_CTRL_TYPE_BOOLEAN,
50 .name = "horizontal flip",
51 .minimum = 0,
52 .maximum = 1,
53 .step = 1,
54 .default_value = 0
55 },
56 .set = vv6410_set_hflip,
57 .get = vv6410_get_hflip
58 }, {
59 {
60 .id = V4L2_CID_VFLIP,
61 .type = V4L2_CTRL_TYPE_BOOLEAN,
62 .name = "vertical flip",
63 .minimum = 0,
64 .maximum = 1,
65 .step = 1,
66 .default_value = 0
67 },
68 .set = vv6410_set_vflip,
69 .get = vv6410_get_vflip
70 }, {
71 {
72 .id = V4L2_CID_GAIN,
73 .type = V4L2_CTRL_TYPE_INTEGER,
74 .name = "analog gain",
75 .minimum = 0,
76 .maximum = 15,
77 .step = 1,
78 .default_value = 0
79 },
80 .set = vv6410_set_analog_gain,
81 .get = vv6410_get_analog_gain
82 }
83};
84
32static int vv6410_probe(struct sd *sd) 85static int vv6410_probe(struct sd *sd)
33{ 86{
34 u16 data; 87 u16 data;
@@ -42,10 +95,10 @@ static int vv6410_probe(struct sd *sd)
42 if (data == 0x19) { 95 if (data == 0x19) {
43 info("vv6410 sensor detected"); 96 info("vv6410 sensor detected");
44 97
45 sd->gspca_dev.cam.cam_mode = stv06xx_sensor_vv6410.modes; 98 sd->gspca_dev.cam.cam_mode = vv6410_mode;
46 sd->gspca_dev.cam.nmodes = stv06xx_sensor_vv6410.nmodes; 99 sd->gspca_dev.cam.nmodes = ARRAY_SIZE(vv6410_mode);
47 sd->desc.ctrls = stv06xx_sensor_vv6410.ctrls; 100 sd->desc.ctrls = vv6410_ctrl;
48 sd->desc.nctrls = stv06xx_sensor_vv6410.nctrls; 101 sd->desc.nctrls = ARRAY_SIZE(vv6410_ctrl);
49 return 0; 102 return 0;
50 } 103 }
51 104
diff --git a/drivers/media/video/gspca/stv06xx/stv06xx_vv6410.h b/drivers/media/video/gspca/stv06xx/stv06xx_vv6410.h
index 3ff8c4ea3362..1cb5f57651bd 100644
--- a/drivers/media/video/gspca/stv06xx/stv06xx_vv6410.h
+++ b/drivers/media/video/gspca/stv06xx/stv06xx_vv6410.h
@@ -197,62 +197,6 @@ const struct stv06xx_sensor stv06xx_sensor_vv6410 = {
197 .start = vv6410_start, 197 .start = vv6410_start,
198 .stop = vv6410_stop, 198 .stop = vv6410_stop,
199 .dump = vv6410_dump, 199 .dump = vv6410_dump,
200
201 .nctrls = 3,
202 .ctrls = {
203 {
204 {
205 .id = V4L2_CID_HFLIP,
206 .type = V4L2_CTRL_TYPE_BOOLEAN,
207 .name = "horizontal flip",
208 .minimum = 0,
209 .maximum = 1,
210 .step = 1,
211 .default_value = 0
212 },
213 .set = vv6410_set_hflip,
214 .get = vv6410_get_hflip
215 }, {
216 {
217 .id = V4L2_CID_VFLIP,
218 .type = V4L2_CTRL_TYPE_BOOLEAN,
219 .name = "vertical flip",
220 .minimum = 0,
221 .maximum = 1,
222 .step = 1,
223 .default_value = 0
224 },
225 .set = vv6410_set_vflip,
226 .get = vv6410_get_vflip
227 }, {
228 {
229 .id = V4L2_CID_GAIN,
230 .type = V4L2_CTRL_TYPE_INTEGER,
231 .name = "analog gain",
232 .minimum = 0,
233 .maximum = 15,
234 .step = 1,
235 .default_value = 0
236 },
237 .set = vv6410_set_analog_gain,
238 .get = vv6410_get_analog_gain
239 }
240 },
241
242 .nmodes = 1,
243 .modes = {
244 {
245 356,
246 292,
247 V4L2_PIX_FMT_SGRBG8,
248 V4L2_FIELD_NONE,
249 .sizeimage =
250 356 * 292,
251 .bytesperline = 356,
252 .colorspace = V4L2_COLORSPACE_SRGB,
253 .priv = 0
254 }
255 }
256}; 200};
257 201
258/* If NULL, only single value to write, stored in len */ 202/* If NULL, only single value to write, stored in len */