diff options
author | Erik Andr?n <erik.andren@gmail.com> | 2009-01-08 18:15:06 +0100 |
---|---|---|
committer | Erik Andr?n <erik.andren@gmail.com> | 2009-01-08 18:15:06 +0100 |
commit | b57d73529a29d046f3d01a40b27613af57ea6f5e (patch) | |
tree | 91964a00724bbc28cfb3af1cd3253878002727c9 /linux/drivers/media | |
parent | eb5048481558b0ffb869825cf1b287ab08b63695 (diff) | |
download | mediapointer-dvb-s2-b57d73529a29d046f3d01a40b27613af57ea6f5e.tar.gz mediapointer-dvb-s2-b57d73529a29d046f3d01a40b27613af57ea6f5e.tar.bz2 |
gspca - m5602-po1030: Split up the init into init and start
From: Erik Andr?n <erik.andren@gmail.com>
Split up the po1030 init into start and init. Add a start function.
Priority: normal
Signed-off-by: Erik Andr?n <erik.andren@gmail.com>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r-- | linux/drivers/media/video/gspca/m5602/m5602_po1030.c | 17 | ||||
-rw-r--r-- | linux/drivers/media/video/gspca/m5602/m5602_po1030.h | 14 |
2 files changed, 26 insertions, 5 deletions
diff --git a/linux/drivers/media/video/gspca/m5602/m5602_po1030.c b/linux/drivers/media/video/gspca/m5602/m5602_po1030.c index 122c777c7..c2bd12eeb 100644 --- a/linux/drivers/media/video/gspca/m5602/m5602_po1030.c +++ b/linux/drivers/media/video/gspca/m5602/m5602_po1030.c @@ -260,6 +260,23 @@ int po1030_init(struct sd *sd) return err; } +int po1030_start(struct sd *sd) +{ + int i, err = 0; + /* Synthesize the vsync/hsync setup */ + for (i = 0; i < ARRAY_SIZE(start_po1030) && !err; i++) { + if (start_po1030[i][0] == BRIDGE) + err = m5602_write_bridge(sd, start_po1030[i][1], + start_po1030[i][2]); + else if (start_po1030[i][0] == SENSOR) { + u8 data = start_po1030[i][2]; + err = m5602_write_sensor(sd, + start_po1030[i][1], &data, 1); + } + } + return err; +} + int po1030_get_exposure(struct gspca_dev *gspca_dev, __s32 *val) { struct sd *sd = (struct sd *) gspca_dev; diff --git a/linux/drivers/media/video/gspca/m5602/m5602_po1030.h b/linux/drivers/media/video/gspca/m5602/m5602_po1030.h index 1260cfa6e..451d20652 100644 --- a/linux/drivers/media/video/gspca/m5602/m5602_po1030.h +++ b/linux/drivers/media/video/gspca/m5602/m5602_po1030.h @@ -148,6 +148,7 @@ extern int dump_sensor; int po1030_probe(struct sd *sd); int po1030_init(struct sd *sd); +int po1030_start(struct sd *sd); void po1030_disconnect(struct sd *sd); int po1030_get_exposure(struct gspca_dev *gspca_dev, __s32 *val); @@ -173,6 +174,7 @@ static const struct m5602_sensor po1030 = { .probe = po1030_probe, .init = po1030_init, + .start = po1030_start, .disconnect = po1030_disconnect, }; @@ -237,7 +239,7 @@ static const unsigned char preinit_po1030[][3] = {BRIDGE, M5602_XB_GPIO_DAT, 0x00} }; -static const unsigned char init_po1030[][4] = +static const unsigned char init_po1030[][3] = { {BRIDGE, M5602_XB_MCU_CLK_DIV, 0x02}, {BRIDGE, M5602_XB_MCU_CLK_CTRL, 0xb0}, @@ -299,11 +301,13 @@ static const unsigned char init_po1030[][4] = {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x04}, {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0}, /*end of sequence 2 stop */ +}; -/* --------------------------------- - * end of init - begin of start - * --------------------------------- */ - +static const unsigned char start_po1030[][3] = +{ + /* --------------------------------- + * end of init - begin of start + * --------------------------------- */ /*sequence 3*/ {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00}, {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0}, |