All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch: gspca-pac73xx-sof-detect.patch
@ 2008-08-22 21:28 Hans de Goede
  0 siblings, 0 replies; only message in thread
From: Hans de Goede @ 2008-08-22 21:28 UTC (permalink / raw)
  To: Jean-Francois Moine; +Cc: Linux and Kernel Video

[-- Attachment #1: Type: text/plain, Size: 348 bytes --]

Hi,

This patch adjusts the pac73xx sof detection, we were throwing away 2 bytes 
after the sof, but one of those 2 actually is the first magic marker for the 
first MCU, as we may need those markers in the future pass the 2 bytes to 
userspace, this also simplifies the code :)

Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>

Regards,

Hans

[-- Attachment #2: gspca-pac73xx-sof-detect.patch --]
[-- Type: text/plain, Size: 1611 bytes --]

Adjust pac73xx sof detection, we were throwing away 2 bytes after the sof,
but one of those 2 actually is the first magic marker for the first MCU, as
we may need those markers in the future pass the 2 bytes to userspace, this
also simplifies the code :)

Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>

p.s.

Matching userspace code has now been committed to my tree:
http://linuxtv.org/hg/~hgoede/v4l-dvb
diff -r 55d686bc5075 linux/drivers/media/video/gspca/pac7311.c
--- a/linux/drivers/media/video/gspca/pac7311.c	Fri Aug 22 22:51:29 2008 +0200
+++ b/linux/drivers/media/video/gspca/pac7311.c	Fri Aug 22 22:54:13 2008 +0200
@@ -70,7 +70,6 @@
 #define SENSOR_PAC7311 1
 
 	u8 sof_read;
-	u8 header_read;
 	u8 autogain_ignore_frames;
 
 	atomic_t avg_lum;
@@ -759,8 +758,6 @@
 /* Include pac common sof detection functions */
 #include "pac_common.h"
 
-#define HEADER_LENGTH 2
-
 /* this function is run at interrupt level */
 static void sd_pkt_scan(struct gspca_dev *gspca_dev,
 			struct gspca_frame *frame,	/* target */
@@ -834,22 +831,7 @@
 		gspca_frame_add(gspca_dev, INTER_PACKET, frame, tmpbuf, 4);
 		gspca_frame_add(gspca_dev, INTER_PACKET, frame,
 			pac7311_jpeg_header2, sizeof(pac7311_jpeg_header2));
-
-		sd->header_read = 0;
 	}
-
-	if (sd->header_read < HEADER_LENGTH) {
-		/* skip the variable part of the sof header */
-		int needed = HEADER_LENGTH - sd->header_read;
-		if (len <= needed) {
-			sd->header_read += len;
-			return;
-		}
-		data += needed;
-		len -= needed;
-		sd->header_read = HEADER_LENGTH;
-	}
-
 	gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
 }
 

[-- Attachment #3: Type: text/plain, Size: 164 bytes --]

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-08-22 21:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-22 21:28 Patch: gspca-pac73xx-sof-detect.patch Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.