diff options
author | Erik Andr?n <erik.andren@gmail.com> | 2009-01-20 07:54:51 +0100 |
---|---|---|
committer | Erik Andr?n <erik.andren@gmail.com> | 2009-01-20 07:54:51 +0100 |
commit | d92d1df320e850ba703ecb4966b59d3b6bc7a129 (patch) | |
tree | b548b81e0b73fb09b4458a659390b0c42b93ac1e /linux/drivers/media/video/gspca/m5602 | |
parent | 312924eff02687357bebf77fb8c9e6d6e8b168a4 (diff) | |
download | mediapointer-dvb-s2-d92d1df320e850ba703ecb4966b59d3b6bc7a129.tar.gz mediapointer-dvb-s2-d92d1df320e850ba703ecb4966b59d3b6bc7a129.tar.bz2 |
gspca - m5602-mt9m111: Add a start function
From: Erik Andr?n <erik.andren@gmail.com>
Priority: normal
Signed-off-by: Erik Andr?n <erik.andren@gmail.com>
Diffstat (limited to 'linux/drivers/media/video/gspca/m5602')
-rw-r--r-- | linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c | 20 | ||||
-rw-r--r-- | linux/drivers/media/video/gspca/m5602/m5602_mt9m111.h | 6 |
2 files changed, 26 insertions, 0 deletions
diff --git a/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c b/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c index 95b6e95aa..edf502041 100644 --- a/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c +++ b/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c @@ -265,6 +265,26 @@ int mt9m111_init(struct sd *sd) return mt9m111_set_gain(&sd->gspca_dev, sensor_settings[GAIN_IDX]); } +int mt9m111_start(struct sd *sd) +{ + int i, err = 0; + u8 data[2]; + + for (i = 0; i < ARRAY_SIZE(start_mt9m111) && !err; i++) { + if (start_mt9m111[i][0] == BRIDGE) { + err = m5602_write_bridge(sd, + start_mt9m111[i][1], + start_mt9m111[i][2]); + } else { + data[0] = start_mt9m111[i][2]; + data[1] = start_mt9m111[i][3]; + err = m5602_write_sensor(sd, + start_mt9m111[i][1], data, 2); + } + } + return err; +} + void mt9m111_disconnect(struct sd *sd) { sd->sensor = NULL; diff --git a/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.h b/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.h index 7bb8ebb86..6598dd9c4 100644 --- a/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.h +++ b/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.h @@ -109,6 +109,7 @@ extern int dump_sensor; int mt9m111_probe(struct sd *sd); int mt9m111_init(struct sd *sd); +int mt9m111_start(struct sd *sd); void mt9m111_disconnect(struct sd *sd); const static struct m5602_sensor mt9m111 = { @@ -120,6 +121,7 @@ const static struct m5602_sensor mt9m111 = { .probe = mt9m111_probe, .init = mt9m111_init, .disconnect = mt9m111_disconnect, + .start = mt9m111_start, }; static const unsigned char preinit_mt9m111[][4] = @@ -258,7 +260,10 @@ static const unsigned char init_mt9m111[][4] = {SENSOR, 0x30, 0x04, 0x00}, /* Set number of blank rows chosen to 400 */ {SENSOR, MT9M111_SC_SHUTTER_WIDTH, 0x01, 0x90}, +}; +static const unsigned char start_mt9m111[][4] = +{ {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x06, 0x00}, {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00}, {BRIDGE, M5602_XB_ADC_CTRL, 0xc0, 0x00}, @@ -285,4 +290,5 @@ static const unsigned char init_mt9m111[][4] = {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00}, }; + #endif |