Commit 931a1c8d authored by Erik Andr?n's avatar Erik Andr?n Committed by Mauro Carvalho Chehab

V4L/DVB (11535): gspca - m5602-po1030: Add experimental QVGA support

Adds experimental support for QVGA. This is code is compile tested only.
Signed-off-by: default avatarErik Andr?n <erik.andren@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 9536a57e
...@@ -43,6 +43,15 @@ static int po1030_get_auto_exposure(struct gspca_dev *gspca_dev, ...@@ -43,6 +43,15 @@ static int po1030_get_auto_exposure(struct gspca_dev *gspca_dev,
static struct v4l2_pix_format po1030_modes[] = { static struct v4l2_pix_format po1030_modes[] = {
{ {
320,
240,
V4L2_PIX_FMT_SBGGR8,
V4L2_FIELD_NONE,
.sizeimage = 320 * 240,
.bytesperline = 320,
.colorspace = V4L2_COLORSPACE_SRGB,
.priv = 2
}, {
640, 640,
480, 480,
V4L2_PIX_FMT_SBGGR8, V4L2_PIX_FMT_SBGGR8,
...@@ -329,7 +338,40 @@ int po1030_start(struct sd *sd) ...@@ -329,7 +338,40 @@ int po1030_start(struct sd *sd)
u8 data; u8 data;
switch (width) { switch (width) {
case 320:
data = PO1030_SUBSAMPLING;
err = m5602_write_sensor(sd, PO1030_CONTROL3, &data, 1);
if (err < 0)
return err;
data = ((width + 3) >> 8) & 0xff;
err = m5602_write_sensor(sd, PO1030_WINDOWWIDTH_H, &data, 1);
if (err < 0)
return err;
data = (width + 3) & 0xff;
err = m5602_write_sensor(sd, PO1030_WINDOWWIDTH_L, &data, 1);
if (err < 0)
return err;
data = ((height + 1) >> 8) & 0xff;
err = m5602_write_sensor(sd, PO1030_WINDOWHEIGHT_H, &data, 1);
if (err < 0)
return err;
data = (height + 1) & 0xff;
err = m5602_write_sensor(sd, PO1030_WINDOWHEIGHT_L, &data, 1);
height += 6;
width -= 1;
break;
case 640: case 640:
data = 0;
err = m5602_write_sensor(sd, PO1030_CONTROL3, &data, 1);
if (err < 0)
return err;
data = ((width + 7) >> 8) & 0xff; data = ((width + 7) >> 8) & 0xff;
err = m5602_write_sensor(sd, PO1030_WINDOWWIDTH_H, &data, 1); err = m5602_write_sensor(sd, PO1030_WINDOWWIDTH_H, &data, 1);
if (err < 0) if (err < 0)
......
...@@ -133,6 +133,8 @@ ...@@ -133,6 +133,8 @@
#define PO1030_SENSOR_RESET (1 << 5) #define PO1030_SENSOR_RESET (1 << 5)
#define PO1030_SUBSAMPLING (1 << 6)
/*****************************************************************************/ /*****************************************************************************/
#define PO1030_GLOBAL_GAIN_DEFAULT 0x12 #define PO1030_GLOBAL_GAIN_DEFAULT 0x12
......
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