aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/pac207.c
diff options
context:
space:
mode:
authorHans de Goede <j.w.r.degoede@hhs.nl>2008-09-03 16:12:14 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-09-03 17:37:24 -0400
commit327c4abf74a4426676df6c359b2a3dea2a5d126e (patch)
tree005359b56ee32e6dc645b57d0f0da518292719a8 /drivers/media/video/gspca/pac207.c
parent62ee8eeebd1bf6c29977800ac18dfcecf584d42e (diff)
V4L/DVB (8812): gspca: Do pac73xx webcams work.
- documentation for some registers - some preparations for adding autogain_n_exposure functionality - various pac7311 fixes - disable brightness and colors controls for 7311 - fix contrast control for 7311 - add hflip and vflip controls for 7311 - minimal jpeg header - proper SOF detection Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl> 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/pac207.c')
-rw-r--r--drivers/media/video/gspca/pac207.c36
1 files changed, 5 insertions, 31 deletions
diff --git a/drivers/media/video/gspca/pac207.c b/drivers/media/video/gspca/pac207.c
index d9668f4cb4d1..620c9631629e 100644
--- a/drivers/media/video/gspca/pac207.c
+++ b/drivers/media/video/gspca/pac207.c
@@ -181,9 +181,6 @@ static const __u8 pac207_sensor_init[][8] = {
181 /* 48 reg_72 Rate Control end BalSize_4a =0x36 */ 181 /* 48 reg_72 Rate Control end BalSize_4a =0x36 */
182static const __u8 PacReg72[] = { 0x00, 0x00, 0x36, 0x00 }; 182static const __u8 PacReg72[] = { 0x00, 0x00, 0x36, 0x00 };
183 183
184static const unsigned char pac207_sof_marker[5] =
185 { 0xff, 0xff, 0x00, 0xff, 0x96 };
186
187static int pac207_write_regs(struct gspca_dev *gspca_dev, u16 index, 184static int pac207_write_regs(struct gspca_dev *gspca_dev, u16 index,
188 const u8 *buffer, u16 length) 185 const u8 *buffer, u16 length)
189{ 186{
@@ -367,31 +364,8 @@ static void pac207_do_auto_gain(struct gspca_dev *gspca_dev)
367 sd->autogain_ignore_frames = PAC207_AUTOGAIN_IGNORE_FRAMES; 364 sd->autogain_ignore_frames = PAC207_AUTOGAIN_IGNORE_FRAMES;
368} 365}
369 366
370static unsigned char *pac207_find_sof(struct gspca_dev *gspca_dev, 367/* Include pac common sof detection functions */
371 unsigned char *m, int len) 368#include "pac_common.h"
372{
373 struct sd *sd = (struct sd *) gspca_dev;
374 int i;
375
376 /* Search for the SOF marker (fixed part) in the header */
377 for (i = 0; i < len; i++) {
378 if (m[i] == pac207_sof_marker[sd->sof_read]) {
379 sd->sof_read++;
380 if (sd->sof_read == sizeof(pac207_sof_marker)) {
381 PDEBUG(D_STREAM,
382 "SOF found, bytes to analyze: %u."
383 " Frame starts at byte #%u",
384 len, i + 1);
385 sd->sof_read = 0;
386 return m + i + 1;
387 }
388 } else {
389 sd->sof_read = 0;
390 }
391 }
392
393 return NULL;
394}
395 369
396static void sd_pkt_scan(struct gspca_dev *gspca_dev, 370static void sd_pkt_scan(struct gspca_dev *gspca_dev,
397 struct gspca_frame *frame, 371 struct gspca_frame *frame,
@@ -401,14 +375,14 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
401 struct sd *sd = (struct sd *) gspca_dev; 375 struct sd *sd = (struct sd *) gspca_dev;
402 unsigned char *sof; 376 unsigned char *sof;
403 377
404 sof = pac207_find_sof(gspca_dev, data, len); 378 sof = pac_find_sof(gspca_dev, data, len);
405 if (sof) { 379 if (sof) {
406 int n; 380 int n;
407 381
408 /* finish decoding current frame */ 382 /* finish decoding current frame */
409 n = sof - data; 383 n = sof - data;
410 if (n > sizeof pac207_sof_marker) 384 if (n > sizeof pac_sof_marker)
411 n -= sizeof pac207_sof_marker; 385 n -= sizeof pac_sof_marker;
412 else 386 else
413 n = 0; 387 n = 0;
414 frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, 388 frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,