arm: tegra: sensors: synchronize cam A and cam B
Prayas Mohanty [Wed, 18 May 2011 12:22:29 +0000 (17:22 +0530)]
For stereo camera support, both cam A and cam B should
start at the same point of time to be in sync.

bug 787214
bug 786928

Original-Change-Id: I417db0f8ff8c76130b76d8edb4e66189d6b92447
Reviewed-on: http://git-master/r/30004
Tested-by: Prayas Mohanty <pmohanty@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

Rebase-Id: Re9bbc67fd3560887f1f38dba129d267b1cf21af7

arch/arm/mach-tegra/board-cardhu-sensors.c

index 852fd30..81f4ab8 100644 (file)
@@ -263,10 +263,30 @@ static int cardhu_right_ov5650_power_off(void)
        return 0;
 }
 
+static void cardhu_ov5650_synchronize_sensors(void)
+{
+       if (board_info.board_id == BOARD_E1198) {
+               gpio_direction_output(CAM1_POWER_DWN_GPIO, 1);
+               mdelay(50);
+               gpio_direction_output(CAM1_POWER_DWN_GPIO, 0);
+               mdelay(50);
+       }
+       else if (board_info.board_id == BOARD_E1291) {
+               gpio_direction_output(CAM1_POWER_DWN_GPIO, 1);
+               gpio_direction_output(CAM2_POWER_DWN_GPIO, 1);
+               mdelay(50);
+               gpio_direction_output(CAM1_POWER_DWN_GPIO, 0);
+               gpio_direction_output(CAM2_POWER_DWN_GPIO, 0);
+               mdelay(50);
+       }
+       else
+               pr_err("%s: UnSupported BoardId\n", __func__);
+}
 
 struct ov5650_platform_data cardhu_right_ov5650_data = {
        .power_on = cardhu_right_ov5650_power_on,
        .power_off = cardhu_right_ov5650_power_off,
+       .synchronize_sensors = cardhu_ov5650_synchronize_sensors,
 };
 
 static int cardhu_ov2710_power_on(void)