aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Andrén <erik.andren@gmail.com>2009-01-29 11:34:41 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-16 17:20:51 -0400
commit4fcec145e9eaae26864731fd6a3120d34abcaffe (patch)
tree744896708f1a3e0eaeee471e8135ee2d1a9df296
parent27d403214317d42fbeaf626f2734a1028087fd16 (diff)
V4L/DVB (11684): gspca - m5602-s5k4aa: Add experimental SXGA support
Signed-off-by: Erik Andrén <erik.andren@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/gspca/m5602/m5602_s5k4aa.c43
-rw-r--r--drivers/media/video/gspca/m5602/m5602_s5k4aa.h52
2 files changed, 95 insertions, 0 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k4aa.c b/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
index 78ea95ba7483..b045b08ac13d 100644
--- a/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
+++ b/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
@@ -65,6 +65,17 @@ static
65 65
66static struct v4l2_pix_format s5k4aa_modes[] = { 66static struct v4l2_pix_format s5k4aa_modes[] = {
67 { 67 {
68 1280,
69 1024,
70 V4L2_PIX_FMT_SBGGR8,
71 V4L2_FIELD_NONE,
72 .sizeimage =
73 1280 * 1024,
74 .bytesperline = 1280,
75 .colorspace = V4L2_COLORSPACE_SRGB,
76 .priv = 0
77 },
78 {
68 640, 79 640,
69 480, 80 480,
70 V4L2_PIX_FMT_SBGGR8, 81 V4L2_PIX_FMT_SBGGR8,
@@ -257,6 +268,38 @@ int s5k4aa_start(struct sd *sd)
257 struct cam *cam = &sd->gspca_dev.cam; 268 struct cam *cam = &sd->gspca_dev.cam;
258 269
259 switch (cam->cam_mode[sd->gspca_dev.curr_mode].width) { 270 switch (cam->cam_mode[sd->gspca_dev.curr_mode].width) {
271 case 1280:
272 PDEBUG(D_V4L2, "Configuring camera for SXGA mode");
273
274 for (i = 0; i < ARRAY_SIZE(SXGA_s5k4aa); i++) {
275 switch (SXGA_s5k4aa[i][0]) {
276 case BRIDGE:
277 err = m5602_write_bridge(sd,
278 SXGA_s5k4aa[i][1],
279 SXGA_s5k4aa[i][2]);
280 break;
281
282 case SENSOR:
283 data[0] = SXGA_s5k4aa[i][2];
284 err = m5602_write_sensor(sd,
285 SXGA_s5k4aa[i][1],
286 data, 1);
287 break;
288
289 case SENSOR_LONG:
290 data[0] = SXGA_s5k4aa[i][2];
291 data[1] = SXGA_s5k4aa[i][3];
292 err = m5602_write_sensor(sd,
293 SXGA_s5k4aa[i][1],
294 data, 2);
295 break;
296
297 default:
298 err("Invalid stream command, exiting init");
299 return -EINVAL;
300 }
301 }
302
260 case 640: 303 case 640:
261 PDEBUG(D_V4L2, "Configuring camera for VGA mode"); 304 PDEBUG(D_V4L2, "Configuring camera for VGA mode");
262 305
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k4aa.h b/drivers/media/video/gspca/m5602/m5602_s5k4aa.h
index c8d909a1fecc..e0709a55eb44 100644
--- a/drivers/media/video/gspca/m5602/m5602_s5k4aa.h
+++ b/drivers/media/video/gspca/m5602/m5602_s5k4aa.h
@@ -235,4 +235,56 @@ static const unsigned char VGA_s5k4aa[][4] =
235 {SENSOR, 0x02, 0x0e, 0x00}, 235 {SENSOR, 0x02, 0x0e, 0x00},
236}; 236};
237 237
238static const unsigned char SXGA_s5k4aa[][4] =
239{
240 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x06, 0x00},
241 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
242 {BRIDGE, M5602_XB_ADC_CTRL, 0xc0, 0x00},
243 {BRIDGE, M5602_XB_SENSOR_TYPE, 0x08, 0x00},
244 {BRIDGE, M5602_XB_LINE_OF_FRAME_H, 0x81, 0x00},
245 {BRIDGE, M5602_XB_PIX_OF_LINE_H, 0x82, 0x00},
246 {BRIDGE, M5602_XB_SIG_INI, 0x01, 0x00},
247 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
248 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
249 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
250 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
251 /* VSYNC_PARA, VSYNC_PARA : img height 1024 = 0x0400 */
252 {BRIDGE, M5602_XB_VSYNC_PARA, 0x04, 0x00},
253 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
254 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
255 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
256 {BRIDGE, M5602_XB_SIG_INI, 0x00, 0x00},
257 {BRIDGE, M5602_XB_SIG_INI, 0x02, 0x00},
258 {BRIDGE, M5602_XB_HSYNC_PARA, 0x00, 0x00},
259 {BRIDGE, M5602_XB_HSYNC_PARA, 0x00, 0x00},
260 /* HSYNC_PARA, HSYNC_PARA : img width 1280 = 0x0500 */
261 {BRIDGE, M5602_XB_HSYNC_PARA, 0x05, 0x00},
262 {BRIDGE, M5602_XB_HSYNC_PARA, 0x00, 0x00},
263 {BRIDGE, M5602_XB_SIG_INI, 0x00, 0x00},
264 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
265 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xa0, 0x00}, /* 48 MHz */
266
267 {SENSOR, S5K4AA_PAGE_MAP, 0x02, 0x00},
268 {SENSOR, S5K4AA_READ_MODE, S5K4AA_RM_H_FLIP | S5K4AA_RM_ROW_SKIP_2X
269 | S5K4AA_RM_COL_SKIP_2X, 0x00},
270 {SENSOR, 0x37, 0x01, 0x00},
271 {SENSOR, S5K4AA_ROWSTART_HI, 0x00, 0x00},
272 {SENSOR, S5K4AA_ROWSTART_LO, 0x0a, 0x00},
273 {SENSOR, S5K4AA_COLSTART_HI, 0x00, 0x00},
274 {SENSOR, S5K4AA_COLSTART_LO, 0x0b, 0x00},
275 {SENSOR, S5K4AA_WINDOW_HEIGHT_HI, 0x04, 0x00},
276 {SENSOR, S5K4AA_WINDOW_HEIGHT_LO, 0x00, 0x00},
277 {SENSOR, S5K4AA_WINDOW_WIDTH_HI, 0x05, 0x00},
278 {SENSOR, S5K4AA_WINDOW_WIDTH_LO, 0x00, 0x00},
279 {SENSOR, S5K4AA_H_BLANK_HI__, 0x00, 0x00},
280 {SENSOR, S5K4AA_H_BLANK_LO__, 0xa8, 0x00},
281 {SENSOR, S5K4AA_EXPOSURE_HI, 0x01, 0x00},
282 {SENSOR, S5K4AA_EXPOSURE_LO, 0x00, 0x00},
283 {SENSOR, 0x11, 0x04, 0x00},
284 {SENSOR, 0x12, 0xc3, 0x00},
285 {SENSOR, S5K4AA_PAGE_MAP, 0x02, 0x00},
286 {SENSOR, 0x02, 0x0e, 0x00},
287};
288
289
238#endif 290#endif