aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/ov519.c
diff options
context:
space:
mode:
authorJean-François Moine <moinejf@free.fr>2010-11-12 05:14:08 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-12-29 05:16:42 -0500
commit83db76886c0b0a32a0c8d35b4dc3dc1d8f1287d4 (patch)
tree1101c8140b93e308025094efde452557e3a136b1 /drivers/media/video/gspca/ov519.c
parent218678032589895f29f4ee01b9c330caaab44274 (diff)
[media] gspca - ov519: Define the disabled controls in a table
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/ov519.c')
-rw-r--r--drivers/media/video/gspca/ov519.c62
1 files changed, 47 insertions, 15 deletions
diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c
index 519dec9774fd..f6c62be00949 100644
--- a/drivers/media/video/gspca/ov519.c
+++ b/drivers/media/video/gspca/ov519.c
@@ -234,6 +234,51 @@ static const struct ctrl sd_ctrls[] = {
234 }, 234 },
235}; 235};
236 236
237/* table of the disabled controls */
238static const unsigned ctrl_dis[] = {
239[SEN_OV2610] = (1 << NCTRL) - 1, /* no control */
240
241[SEN_OV3610] = (1 << NCTRL) - 1, /* no control */
242
243[SEN_OV6620] = (1 << HFLIP) |
244 (1 << VFLIP),
245
246[SEN_OV6630] = (1 << HFLIP) |
247 (1 << VFLIP),
248
249[SEN_OV66308AF] = (1 << HFLIP) |
250 (1 << VFLIP),
251
252[SEN_OV7610] = (1 << HFLIP) |
253 (1 << VFLIP),
254
255[SEN_OV7620] = (1 << HFLIP) |
256 (1 << VFLIP),
257
258[SEN_OV7620AE] = (1 << HFLIP) |
259 (1 << VFLIP),
260
261[SEN_OV7640] = (1 << HFLIP) |
262 (1 << VFLIP) |
263 (1 << AUTOBRIGHT) |
264 (1 << CONTRAST),
265
266[SEN_OV7648] = (1 << HFLIP) |
267 (1 << VFLIP) |
268 (1 << AUTOBRIGHT) |
269 (1 << CONTRAST),
270
271[SEN_OV7670] = (1 << COLORS) |
272 (1 << AUTOBRIGHT),
273
274[SEN_OV76BE] = (1 << HFLIP) |
275 (1 << VFLIP),
276
277[SEN_OV8610] = (1 << HFLIP) |
278 (1 << VFLIP) |
279 (1 << FREQ),
280};
281
237static const struct v4l2_pix_format ov519_vga_mode[] = { 282static const struct v4l2_pix_format ov519_vga_mode[] = {
238 {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, 283 {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
239 .bytesperline = 320, 284 .bytesperline = 320,
@@ -3099,22 +3144,9 @@ static int sd_config(struct gspca_dev *gspca_dev,
3099 break; 3144 break;
3100 } 3145 }
3101 gspca_dev->cam.ctrls = sd->ctrls; 3146 gspca_dev->cam.ctrls = sd->ctrls;
3102 if (sd->sensor == SEN_OV7670)
3103 gspca_dev->ctrl_dis = 1 << COLORS;
3104 else
3105 gspca_dev->ctrl_dis = (1 << HFLIP) | (1 << VFLIP);
3106 sd->quality = QUALITY_DEF; 3147 sd->quality = QUALITY_DEF;
3107 if (sd->sensor == SEN_OV7640 || 3148
3108 sd->sensor == SEN_OV7648) 3149 gspca_dev->ctrl_dis = ctrl_dis[sd->sensor];
3109 gspca_dev->ctrl_dis |= (1 << AUTOBRIGHT) | (1 << CONTRAST);
3110 if (sd->sensor == SEN_OV7670)
3111 gspca_dev->ctrl_dis |= 1 << AUTOBRIGHT;
3112 /* OV8610 Frequency filter control should work but needs testing */
3113 if (sd->sensor == SEN_OV8610)
3114 gspca_dev->ctrl_dis |= 1 << FREQ;
3115 /* No controls for the OV2610/OV3610 */
3116 if (sd->sensor == SEN_OV2610 || sd->sensor == SEN_OV3610)
3117 gspca_dev->ctrl_dis |= (1 << NCTRL) - 1;
3118 3150
3119 return 0; 3151 return 0;
3120error: 3152error: