diff options
author | Andoni Zubimendi <andoni.zubimendi@gmail.com> | 2008-07-06 06:27:19 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-20 06:17:29 -0400 |
commit | 553b9fa47d67a77f6456bc969891a347bfb323dc (patch) | |
tree | ff4df0437246a07b22f7348879d4e8dfbe33cf05 | |
parent | 814429501f65e3482adb8e7678660ceb7a2fc2e6 (diff) |
V4L/DVB (8205): gspca: Size of frame header adjusted according to sn9c10x in sonixb.
Signed-off-by: Andoni Zubimendi <andoni.zubimendi@gmail.com>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/video/gspca/sonixb.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/media/video/gspca/sonixb.c b/drivers/media/video/gspca/sonixb.c index 574568736317..3dbeadf23e19 100644 --- a/drivers/media/video/gspca/sonixb.c +++ b/drivers/media/video/gspca/sonixb.c | |||
@@ -38,6 +38,7 @@ struct sd { | |||
38 | unsigned char brightness; | 38 | unsigned char brightness; |
39 | unsigned char contrast; | 39 | unsigned char contrast; |
40 | 40 | ||
41 | unsigned char fr_h_sz; /* size of frame header */ | ||
41 | char sensor; /* Type of image sensor chip */ | 42 | char sensor; /* Type of image sensor chip */ |
42 | #define SENSOR_HV7131R 0 | 43 | #define SENSOR_HV7131R 0 |
43 | #define SENSOR_OV6650 1 | 44 | #define SENSOR_OV6650 1 |
@@ -510,6 +511,7 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
510 | __u16 product; | 511 | __u16 product; |
511 | int sif = 0; | 512 | int sif = 0; |
512 | 513 | ||
514 | sd->fr_h_sz = 12; /* default size of the frame header */ | ||
513 | /* vendor = id->idVendor; */ | 515 | /* vendor = id->idVendor; */ |
514 | product = id->idProduct; | 516 | product = id->idProduct; |
515 | /* switch (vendor) { */ | 517 | /* switch (vendor) { */ |
@@ -538,6 +540,7 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
538 | break; | 540 | break; |
539 | case 0x60b0: /* SN9C103 */ | 541 | case 0x60b0: /* SN9C103 */ |
540 | sd->sensor = SENSOR_OV7630_3; | 542 | sd->sensor = SENSOR_OV7630_3; |
543 | sd->fr_h_sz = 18; /* size of frame header */ | ||
541 | break; | 544 | break; |
542 | case 0x6024: /* SN9C102 */ | 545 | case 0x6024: /* SN9C102 */ |
543 | case 0x6025: /* SN9C102 */ | 546 | case 0x6025: /* SN9C102 */ |
@@ -551,6 +554,7 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
551 | break; | 554 | break; |
552 | case 0x60af: /* SN9C103 */ | 555 | case 0x60af: /* SN9C103 */ |
553 | sd->sensor = SENSOR_PAS202; | 556 | sd->sensor = SENSOR_PAS202; |
557 | sd->fr_h_sz = 18; /* size of frame header (?) */ | ||
554 | break; | 558 | break; |
555 | } | 559 | } |
556 | /* break; */ | 560 | /* break; */ |
@@ -775,6 +779,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
775 | unsigned char *data, /* isoc packet */ | 779 | unsigned char *data, /* isoc packet */ |
776 | int len) /* iso packet length */ | 780 | int len) /* iso packet length */ |
777 | { | 781 | { |
782 | struct sd *sd; | ||
778 | int i; | 783 | int i; |
779 | 784 | ||
780 | if (len > 6 && len < 24) { | 785 | if (len > 6 && len < 24) { |
@@ -787,8 +792,9 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
787 | && data[5 + i] == 0x96) { /* start of frame */ | 792 | && data[5 + i] == 0x96) { /* start of frame */ |
788 | frame = gspca_frame_add(gspca_dev, LAST_PACKET, | 793 | frame = gspca_frame_add(gspca_dev, LAST_PACKET, |
789 | frame, data, 0); | 794 | frame, data, 0); |
790 | data += i + 12; | 795 | sd = (struct sd *) gspca_dev; |
791 | len -= i + 12; | 796 | data += i + sd->fr_h_sz; |
797 | len -= i + sd->fr_h_sz; | ||
792 | gspca_frame_add(gspca_dev, FIRST_PACKET, | 798 | gspca_frame_add(gspca_dev, FIRST_PACKET, |
793 | frame, data, len); | 799 | frame, data, len); |
794 | return; | 800 | return; |