Commit 553b9fa4 authored by Andoni Zubimendi's avatar Andoni Zubimendi Committed by Mauro Carvalho Chehab

V4L/DVB (8205): gspca: Size of frame header adjusted according to sn9c10x in sonixb.

Signed-off-by: default avatarAndoni Zubimendi <andoni.zubimendi@gmail.com>
Signed-off-by: default avatarJean-Francois Moine <moinejf@free.fr>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 81442950
...@@ -38,6 +38,7 @@ struct sd { ...@@ -38,6 +38,7 @@ struct sd {
unsigned char brightness; unsigned char brightness;
unsigned char contrast; unsigned char contrast;
unsigned char fr_h_sz; /* size of frame header */
char sensor; /* Type of image sensor chip */ char sensor; /* Type of image sensor chip */
#define SENSOR_HV7131R 0 #define SENSOR_HV7131R 0
#define SENSOR_OV6650 1 #define SENSOR_OV6650 1
...@@ -510,6 +511,7 @@ static int sd_config(struct gspca_dev *gspca_dev, ...@@ -510,6 +511,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
__u16 product; __u16 product;
int sif = 0; int sif = 0;
sd->fr_h_sz = 12; /* default size of the frame header */
/* vendor = id->idVendor; */ /* vendor = id->idVendor; */
product = id->idProduct; product = id->idProduct;
/* switch (vendor) { */ /* switch (vendor) { */
...@@ -538,6 +540,7 @@ static int sd_config(struct gspca_dev *gspca_dev, ...@@ -538,6 +540,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
break; break;
case 0x60b0: /* SN9C103 */ case 0x60b0: /* SN9C103 */
sd->sensor = SENSOR_OV7630_3; sd->sensor = SENSOR_OV7630_3;
sd->fr_h_sz = 18; /* size of frame header */
break; break;
case 0x6024: /* SN9C102 */ case 0x6024: /* SN9C102 */
case 0x6025: /* SN9C102 */ case 0x6025: /* SN9C102 */
...@@ -551,6 +554,7 @@ static int sd_config(struct gspca_dev *gspca_dev, ...@@ -551,6 +554,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
break; break;
case 0x60af: /* SN9C103 */ case 0x60af: /* SN9C103 */
sd->sensor = SENSOR_PAS202; sd->sensor = SENSOR_PAS202;
sd->fr_h_sz = 18; /* size of frame header (?) */
break; break;
} }
/* break; */ /* break; */
...@@ -775,6 +779,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, ...@@ -775,6 +779,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
unsigned char *data, /* isoc packet */ unsigned char *data, /* isoc packet */
int len) /* iso packet length */ int len) /* iso packet length */
{ {
struct sd *sd;
int i; int i;
if (len > 6 && len < 24) { if (len > 6 && len < 24) {
...@@ -787,8 +792,9 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, ...@@ -787,8 +792,9 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
&& data[5 + i] == 0x96) { /* start of frame */ && data[5 + i] == 0x96) { /* start of frame */
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame = gspca_frame_add(gspca_dev, LAST_PACKET,
frame, data, 0); frame, data, 0);
data += i + 12; sd = (struct sd *) gspca_dev;
len -= i + 12; data += i + sd->fr_h_sz;
len -= i + sd->fr_h_sz;
gspca_frame_add(gspca_dev, FIRST_PACKET, gspca_frame_add(gspca_dev, FIRST_PACKET,
frame, data, len); frame, data, len);
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment