]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00252064-2 mx6sl: ov5640: need enable MCLK before read sensor ID
authorRobby Cai <R63905@freescale.com>
Thu, 14 Mar 2013 08:51:00 +0000 (16:51 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:58 +0000 (08:35 +0200)
After the patch of auto-detection for sensor pushed, there's a need to
read sensor ID in probe function. But on MX6SL, MCLK is not enabled at
that time. So need to enable it before read sensor ID.

Signed-off-by: Robby Cai <R63905@freescale.com>
drivers/media/video/mxc/capture/ov5640.c

index 2a1bc983e28e0a478f5cfec8a027707533c5a5ee..3195377152b73108069e6ba8edcd84a9e2cd1443 100644 (file)
@@ -31,6 +31,7 @@
 #include <media/v4l2-chip-ident.h>
 #include <media/v4l2-int-device.h>
 #include "mxc_v4l2_capture.h"
+#include "fsl_csi.h"
 
 #define OV5640_VOLTAGE_ANALOG               2800000
 #define OV5640_VOLTAGE_DIGITAL_CORE         1500000
@@ -1821,6 +1822,8 @@ static int ov5640_probe(struct i2c_client *client,
        if (plat_data->pwdn)
                plat_data->pwdn(0);
 
+       if (cpu_is_mx6sl())
+               csi_enable_mclk(CSI_MCLK_I2C, true, true);
        retval = ov5640_read_reg(OV5640_CHIP_ID_HIGH_BYTE, &chip_id_high);
        if (retval < 0 || chip_id_high != 0x56) {
                pr_warning("camera ov5640 is not found\n");
@@ -1837,6 +1840,9 @@ static int ov5640_probe(struct i2c_client *client,
        if (plat_data->pwdn)
                plat_data->pwdn(1);
 
+       if (cpu_is_mx6sl())
+               csi_enable_mclk(CSI_MCLK_I2C, false, false);
+
        camera_plat = plat_data;
 
        ov5640_int_device.priv = &ov5640_data;