diff options
author | Andrei Andreyanau <a.andreyanau@sam-solutions.com> | 2013-06-19 14:19:54 +0300 |
---|---|---|
committer | Justin Waters <justin.waters@timesys.com> | 2013-11-07 12:19:33 -0500 |
commit | 78e2abbfd83ccc69150b762ae3b66d1506138fb4 (patch) | |
tree | 2b450754ce669768730a3889fe4a6add276b3049 /drivers | |
parent | 09105e1e6571c3d43bcfd196bc54ccd4c7074c3f (diff) |
Added support for faster frame rate for small resolutions for mt9m111 (VM-009) camera.
Signed-off-by: Andrei Andreyanau <a.andreyanau@sam-solutions.com>
modified: drivers/media/video/mt9m111.c
Signed-off-by: Christian Hemp <c.hemp@phytec.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/mt9m111.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/drivers/media/video/mt9m111.c b/drivers/media/video/mt9m111.c index e892431f7ae9..f4635345e04b 100644 --- a/drivers/media/video/mt9m111.c +++ b/drivers/media/video/mt9m111.c @@ -289,6 +289,11 @@ static int mt9m111_setup_rect(struct i2c_client *client, if (!ret) ret = reg_write(ROW_START, rect->top); + if (!ret) /* set default skip0 context B */ + ret = reg_clear(READ_MODE_B, 0x0030); + if (!ret) /* set default context B */ + ret = reg_set(CONTEXT_CONTROL, 0x170b); + if (is_raw_format) { if (!ret) ret = reg_write(WINDOW_WIDTH, width); @@ -311,6 +316,47 @@ static int mt9m111_setup_rect(struct i2c_client *client, ret = reg_write(REDUCER_XSIZE_A, width); if (!ret) ret = reg_write(REDUCER_YSIZE_A, height); + + if ((width == 640 && height == 512) || + (width == 320 && height == 256)) { + + if (!ret) + ret = reg_write(REDUCER_XSIZE_B, + MT9M111_MAX_WIDTH); + if (!ret) + ret = reg_write(REDUCER_YSIZE_B, + MT9M111_MAX_HEIGHT); + if (!ret) + ret = reg_write(REDUCER_XSIZE_A, + (MT9M111_MAX_WIDTH/2)); + if (!ret) + ret = reg_write(REDUCER_YSIZE_A, + (MT9M111_MAX_HEIGHT/2)); + if (!ret) + ret = reg_write(WINDOW_WIDTH, + MT9M111_MAX_WIDTH); + if (!ret) + ret = reg_write(WINDOW_HEIGHT, + MT9M111_MAX_HEIGHT); + + if (width == 640 && height == 512) { + if (!ret) /* set skip2 context A */ + ret = reg_set(READ_MODE_A, 0x000c); + if (!ret) /* set full power mode */ + ret = reg_clear(READ_MODE_A, 0x0400); + if (!ret) /* set context A */ + ret = reg_clear(CONTEXT_CONTROL, + 0x170b); + + } else if (width == 320 && height == 256) { + if (!ret) /* set skip4 context B*/ + ret = reg_set(READ_MODE_B, 0x0030); + if (!ret) /* set full power mode */ + ret = reg_clear(READ_MODE_B, 0x0400); + if (!ret) /* set context B */ + ret = reg_set(CONTEXT_CONTROL, 0x170b); + } + } } return ret; |