aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca
diff options
context:
space:
mode:
authorErik Andr?n <erik.andren@gmail.com>2009-01-08 12:15:06 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-16 17:20:26 -0400
commitc996b36809af0e5ee441b411f947c3b53d43a104 (patch)
tree786308a308d0f9d273c43dafc118785b7a5099fb /drivers/media/video/gspca
parentfcb981080a08c033cf6f1e7e5c4ff706a37a659d (diff)
V4L/DVB (11462): gspca - m5602-po1030: Split up the init into init and start
Split up the po1030 init into start and init. Add a start function. Signed-off-by: Erik Andr?n <erik.andren@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca')
-rw-r--r--drivers/media/video/gspca/m5602/m5602_po1030.c17
-rw-r--r--drivers/media/video/gspca/m5602/m5602_po1030.h14
2 files changed, 26 insertions, 5 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_po1030.c b/drivers/media/video/gspca/m5602/m5602_po1030.c
index 122c777c71c5..c2bd12eeb5e7 100644
--- a/drivers/media/video/gspca/m5602/m5602_po1030.c
+++ b/drivers/media/video/gspca/m5602/m5602_po1030.c
@@ -260,6 +260,23 @@ int po1030_init(struct sd *sd)
260 return err; 260 return err;
261} 261}
262 262
263int po1030_start(struct sd *sd)
264{
265 int i, err = 0;
266 /* Synthesize the vsync/hsync setup */
267 for (i = 0; i < ARRAY_SIZE(start_po1030) && !err; i++) {
268 if (start_po1030[i][0] == BRIDGE)
269 err = m5602_write_bridge(sd, start_po1030[i][1],
270 start_po1030[i][2]);
271 else if (start_po1030[i][0] == SENSOR) {
272 u8 data = start_po1030[i][2];
273 err = m5602_write_sensor(sd,
274 start_po1030[i][1], &data, 1);
275 }
276 }
277 return err;
278}
279
263int po1030_get_exposure(struct gspca_dev *gspca_dev, __s32 *val) 280int po1030_get_exposure(struct gspca_dev *gspca_dev, __s32 *val)
264{ 281{
265 struct sd *sd = (struct sd *) gspca_dev; 282 struct sd *sd = (struct sd *) gspca_dev;
diff --git a/drivers/media/video/gspca/m5602/m5602_po1030.h b/drivers/media/video/gspca/m5602/m5602_po1030.h
index 1260cfa6e4ef..451d2065213c 100644
--- a/drivers/media/video/gspca/m5602/m5602_po1030.h
+++ b/drivers/media/video/gspca/m5602/m5602_po1030.h
@@ -148,6 +148,7 @@ extern int dump_sensor;
148 148
149int po1030_probe(struct sd *sd); 149int po1030_probe(struct sd *sd);
150int po1030_init(struct sd *sd); 150int po1030_init(struct sd *sd);
151int po1030_start(struct sd *sd);
151void po1030_disconnect(struct sd *sd); 152void po1030_disconnect(struct sd *sd);
152 153
153int po1030_get_exposure(struct gspca_dev *gspca_dev, __s32 *val); 154int po1030_get_exposure(struct gspca_dev *gspca_dev, __s32 *val);
@@ -173,6 +174,7 @@ static const struct m5602_sensor po1030 = {
173 174
174 .probe = po1030_probe, 175 .probe = po1030_probe,
175 .init = po1030_init, 176 .init = po1030_init,
177 .start = po1030_start,
176 .disconnect = po1030_disconnect, 178 .disconnect = po1030_disconnect,
177}; 179};
178 180
@@ -237,7 +239,7 @@ static const unsigned char preinit_po1030[][3] =
237 {BRIDGE, M5602_XB_GPIO_DAT, 0x00} 239 {BRIDGE, M5602_XB_GPIO_DAT, 0x00}
238}; 240};
239 241
240static const unsigned char init_po1030[][4] = 242static const unsigned char init_po1030[][3] =
241{ 243{
242 {BRIDGE, M5602_XB_MCU_CLK_DIV, 0x02}, 244 {BRIDGE, M5602_XB_MCU_CLK_DIV, 0x02},
243 {BRIDGE, M5602_XB_MCU_CLK_CTRL, 0xb0}, 245 {BRIDGE, M5602_XB_MCU_CLK_CTRL, 0xb0},
@@ -299,11 +301,13 @@ static const unsigned char init_po1030[][4] =
299 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x04}, 301 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x04},
300 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0}, 302 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0},
301 /*end of sequence 2 stop */ 303 /*end of sequence 2 stop */
304};
302 305
303/* --------------------------------- 306static const unsigned char start_po1030[][3] =
304 * end of init - begin of start 307{
305 * --------------------------------- */ 308 /* ---------------------------------
306 309 * end of init - begin of start
310 * --------------------------------- */
307 /*sequence 3*/ 311 /*sequence 3*/
308 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00}, 312 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00},
309 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0}, 313 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0},