summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorGuoqing Jiang <b22156@freescale.com>2009-07-28 14:50:24 +0800
committerJustin Waters <justin.waters@timesys.com>2009-10-13 11:04:39 -0400
commitcbd6cc1a15b3a588440c5cb4393242832c17b14e (patch)
tree9e087d1d37f389611e66253fd8f59ad5a16b2d7a /drivers
parent50aa0ccd3d2f676fd3e7913761e2da1f59bf3801 (diff)
ENGR00114538 Camera: fix incorrect input clock on MX25
The ov2640 camera's input clock value is not equal to the value which is required in ov2640 datasheet, change it to 24MHz according to the datasheet. Signed-off-by: Guoqing Jiang <b22156@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/mxc/capture/fsl_csi.c12
-rw-r--r--drivers/media/video/mxc/capture/ov2640.c10
2 files changed, 13 insertions, 9 deletions
diff --git a/drivers/media/video/mxc/capture/fsl_csi.c b/drivers/media/video/mxc/capture/fsl_csi.c
index f30a9e0b63ca..4f14f26eede1 100644
--- a/drivers/media/video/mxc/capture/fsl_csi.c
+++ b/drivers/media/video/mxc/capture/fsl_csi.c
@@ -97,6 +97,7 @@ void csi_init_interface(void)
val |= BIT_PACK_DIR;
val |= BIT_FCC;
val |= BIT_SWAP16_EN;
+ val |= 1 << SHIFT_MCLKDIV;
__raw_writel(val, CSI_CSICR1);
imag_para = (640 << 16) | 960;
@@ -221,7 +222,10 @@ static void csi_mclk_recalc(struct clk *clk)
u32 div;
div = (__raw_readl(CSI_CSICR1) & BIT_MCLKDIV) >> SHIFT_MCLKDIV;
- div = (div + 1) * 2;
+ if (div == 0)
+ div = 1;
+ else
+ div = div * 2;
clk->rate = clk->parent->rate / div;
}
@@ -241,6 +245,9 @@ int32_t __init csi_init_module(void)
int ret = 0;
struct clk *per_clk;
+ csihw_reset();
+ csi_init_interface();
+
per_clk = clk_get(NULL, "csi_clk");
if (IS_ERR(per_clk))
return PTR_ERR(per_clk);
@@ -252,9 +259,6 @@ int32_t __init csi_init_module(void)
clk_enable(per_clk);
csi_mclk_recalc(&csi_mclk);
- csihw_reset();
- csi_init_interface();
-
return ret;
}
diff --git a/drivers/media/video/mxc/capture/ov2640.c b/drivers/media/video/mxc/capture/ov2640.c
index bf338db158b6..a1329b0b431d 100644
--- a/drivers/media/video/mxc/capture/ov2640.c
+++ b/drivers/media/video/mxc/capture/ov2640.c
@@ -54,7 +54,7 @@ struct reg_value {
static struct reg_value ov2640_setting_1600_1120[] = {
#ifdef CONFIG_MACH_MX25_3DS
{0xff, 0x01, 0}, {0x12, 0x80, 5}, {0xff, 0x00, 0}, {0x2c, 0xff, 0},
- {0x2e, 0xdf, 0}, {0xff, 0x01, 0}, {0x3c, 0x32, 0}, {0x11, 0x02, 0},
+ {0x2e, 0xdf, 0}, {0xff, 0x01, 0}, {0x3c, 0x32, 0}, {0x11, 0x00, 0},
{0x09, 0x02, 0}, {0x04, 0x28, 0}, {0x13, 0xe5, 0}, {0x14, 0x48, 0},
{0x2c, 0x0c, 0}, {0x33, 0x78, 0}, {0x3a, 0x33, 0}, {0x3b, 0xfb, 0},
{0x3e, 0x00, 0}, {0x43, 0x11, 0}, {0x16, 0x10, 0}, {0x39, 0x02, 0},
@@ -153,7 +153,7 @@ static struct reg_value ov2640_setting_1600_1120[] = {
static struct reg_value ov2640_setting_800_600[] = {
#ifdef CONFIG_MACH_MX25_3DS
{0xff, 0x01, 0}, {0x12, 0x80, 5}, {0xff, 0x00, 0}, {0x2c, 0xff, 0},
- {0x2e, 0xdf, 0}, {0xff, 0x01, 0}, {0x3c, 0x32, 0}, {0x11, 0x01, 0},
+ {0x2e, 0xdf, 0}, {0xff, 0x01, 0}, {0x3c, 0x32, 0}, {0x11, 0x00, 0},
{0x09, 0x02, 0}, {0x04, 0x28, 0}, {0x13, 0xe5, 0}, {0x14, 0x48, 0},
{0x2c, 0x0c, 0}, {0x33, 0x78, 0}, {0x3a, 0x33, 0}, {0x3b, 0xfb, 0},
{0x3e, 0x00, 0}, {0x43, 0x11, 0}, {0x16, 0x10, 0}, {0x39, 0x92, 0},
@@ -335,7 +335,7 @@ static int ov2640_init_mode(struct sensor *s)
return ret;
}
-/* At present only support change to 15fps */
+/* At present only support change to 15fps(only for SVGA mode) */
static int ov2640_set_fps(struct sensor *s, int fps)
{
int ret = 0;
@@ -345,8 +345,8 @@ static int ov2640_set_fps(struct sensor *s, int fps)
ret = -EPERM;
}
- /* change the camera framerate to 15fps */
- if (i2c_smbus_write_byte_data(s->i2c_client, 0x11, 0x03) < 0) {
+ /* change the camera framerate to 15fps(only for SVGA mode) */
+ if (i2c_smbus_write_byte_data(s->i2c_client, 0x11, 0x01) < 0) {
pr_err("change camera to 15fps failed\n");
ret = -EPERM;
}