aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/zc3xx.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2010-01-13 05:12:28 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 13:10:47 -0500
commit9919fe891da1bd61fad78a0e1e3c0f21cd127eca (patch)
tree5390eaa92e048649f444ed8fa86d5b622f2e0504 /drivers/media/video/gspca/zc3xx.c
parent6aeb0905620f2ba3adecfaabc7000ae0481a263b (diff)
V4L/DVB: gspca - zc3xx: Change the resolutions of some sensors
The sensors adcm2700, mc501cb and ov7620 cannot have the full height permitted by the zc3xx bridges. This change removes 8 pixels at the bottom of the images. Signed-off-by: Hans de Goede <hdegoede@redhat.com> 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/zc3xx.c')
-rw-r--r--drivers/media/video/gspca/zc3xx.c52
1 files changed, 46 insertions, 6 deletions
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c
index 1c403a2fccbe..8c31aa9b26e2 100644
--- a/drivers/media/video/gspca/zc3xx.c
+++ b/drivers/media/video/gspca/zc3xx.c
@@ -192,6 +192,19 @@ static const struct v4l2_pix_format vga_mode[] = {
192 .priv = 0}, 192 .priv = 0},
193}; 193};
194 194
195static const struct v4l2_pix_format broken_vga_mode[] = {
196 {320, 232, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
197 .bytesperline = 320,
198 .sizeimage = 320 * 232 * 4 / 8 + 590,
199 .colorspace = V4L2_COLORSPACE_JPEG,
200 .priv = 1},
201 {640, 472, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
202 .bytesperline = 640,
203 .sizeimage = 640 * 472 * 3 / 8 + 590,
204 .colorspace = V4L2_COLORSPACE_JPEG,
205 .priv = 0},
206};
207
195static const struct v4l2_pix_format sif_mode[] = { 208static const struct v4l2_pix_format sif_mode[] = {
196 {176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, 209 {176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
197 .bytesperline = 176, 210 .bytesperline = 176,
@@ -6573,7 +6586,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
6573 struct sd *sd = (struct sd *) gspca_dev; 6586 struct sd *sd = (struct sd *) gspca_dev;
6574 struct cam *cam; 6587 struct cam *cam;
6575 int sensor; 6588 int sensor;
6576 int vga = 1; /* 1: vga, 0: sif */
6577 static const u8 gamma[SENSOR_MAX] = { 6589 static const u8 gamma[SENSOR_MAX] = {
6578 4, /* SENSOR_ADCM2700 0 */ 6590 4, /* SENSOR_ADCM2700 0 */
6579 4, /* SENSOR_CS2102 1 */ 6591 4, /* SENSOR_CS2102 1 */
@@ -6595,6 +6607,27 @@ static int sd_config(struct gspca_dev *gspca_dev,
6595 3, /* SENSOR_TAS5130CXX 17 */ 6607 3, /* SENSOR_TAS5130CXX 17 */
6596 3, /* SENSOR_TAS5130C_VF0250 18 */ 6608 3, /* SENSOR_TAS5130C_VF0250 18 */
6597 }; 6609 };
6610 static const u8 mode_tb[SENSOR_MAX] = {
6611 2, /* SENSOR_ADCM2700 0 */
6612 1, /* SENSOR_CS2102 1 */
6613 1, /* SENSOR_CS2102K 2 */
6614 1, /* SENSOR_GC0305 3 */
6615 1, /* SENSOR_HDCS2020b 4 */
6616 1, /* SENSOR_HV7131B 5 */
6617 1, /* SENSOR_HV7131C 6 */
6618 1, /* SENSOR_ICM105A 7 */
6619 2, /* SENSOR_MC501CB 8 */
6620 1, /* SENSOR_MI0360SOC 9 */
6621 2, /* SENSOR_OV7620 10 */
6622 1, /* SENSOR_OV7630C 11 */
6623 0, /* SENSOR_PAS106 12 */
6624 1, /* SENSOR_PAS202B 13 */
6625 1, /* SENSOR_PB0330 14 */
6626 1, /* SENSOR_PO2030 15 */
6627 1, /* SENSOR_TAS5130CK 16 */
6628 1, /* SENSOR_TAS5130CXX 17 */
6629 1, /* SENSOR_TAS5130C_VF0250 18 */
6630 };
6598 6631
6599 /* define some sensors from the vendor/product */ 6632 /* define some sensors from the vendor/product */
6600 sd->sharpness = SHARPNESS_DEF; 6633 sd->sharpness = SHARPNESS_DEF;
@@ -6668,7 +6701,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
6668 case 0x0f: 6701 case 0x0f:
6669 PDEBUG(D_PROBE, "Find Sensor PAS106"); 6702 PDEBUG(D_PROBE, "Find Sensor PAS106");
6670 sd->sensor = SENSOR_PAS106; 6703 sd->sensor = SENSOR_PAS106;
6671 vga = 0; /* SIF */
6672 break; 6704 break;
6673 case 0x10: 6705 case 0x10:
6674 case 0x12: 6706 case 0x12:
@@ -6740,12 +6772,20 @@ static int sd_config(struct gspca_dev *gspca_dev,
6740 cam = &gspca_dev->cam; 6772 cam = &gspca_dev->cam;
6741/*fixme:test*/ 6773/*fixme:test*/
6742 gspca_dev->nbalt--; 6774 gspca_dev->nbalt--;
6743 if (vga) { 6775 switch (mode_tb[sd->sensor]) {
6744 cam->cam_mode = vga_mode; 6776 case 0:
6745 cam->nmodes = ARRAY_SIZE(vga_mode);
6746 } else {
6747 cam->cam_mode = sif_mode; 6777 cam->cam_mode = sif_mode;
6748 cam->nmodes = ARRAY_SIZE(sif_mode); 6778 cam->nmodes = ARRAY_SIZE(sif_mode);
6779 break;
6780 case 1:
6781 cam->cam_mode = vga_mode;
6782 cam->nmodes = ARRAY_SIZE(vga_mode);
6783 break;
6784 default:
6785/* case 2: */
6786 cam->cam_mode = broken_vga_mode;
6787 cam->nmodes = ARRAY_SIZE(broken_vga_mode);
6788 break;
6749 } 6789 }
6750 sd->brightness = BRIGHTNESS_DEF; 6790 sd->brightness = BRIGHTNESS_DEF;
6751 sd->contrast = CONTRAST_DEF; 6791 sd->contrast = CONTRAST_DEF;