summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-whistler-sensors.c
diff options
context:
space:
mode:
authorSachin Nikam <snikam@nvidia.com>2011-01-03 14:14:13 +0530
committerBharat Nihalani <bnihalani@nvidia.com>2011-01-05 06:32:33 -0800
commitb50be4063e53381cb31822d13a919634e8105f0e (patch)
treef0b2d8fc4f6044dc6a335eb727fd08001e83dd22 /arch/arm/mach-tegra/board-whistler-sensors.c
parentef110ce0c938c8c2dd6de491a999441c0c10e800 (diff)
[ARM] tegra: whistler: Camera sensor ov5650
Regestering and intializing tegra_camera and ov5650. Configuring pinmix for VI. Change-Id: I7672f5a1e4ef87cc115183395b144a82bb52f9e8 Reviewed-on: http://git-master/r/14773 Tested-by: Sachin Nikam <snikam@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/board-whistler-sensors.c')
-rw-r--r--arch/arm/mach-tegra/board-whistler-sensors.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-whistler-sensors.c b/arch/arm/mach-tegra/board-whistler-sensors.c
index 536a871a8303..3d88b981f78b 100644
--- a/arch/arm/mach-tegra/board-whistler-sensors.c
+++ b/arch/arm/mach-tegra/board-whistler-sensors.c
@@ -20,9 +20,74 @@
#include <linux/i2c.h>
#include <mach/gpio.h>
+#include <media/ov5650.h>
+
#include "gpio-names.h"
+#define CAMERA_RESET2_SHUTTER_GPIO TEGRA_GPIO_PBB1
+#define CAMERA_PWNDN1_GPIO TEGRA_GPIO_PBB4
+#define CAMERA_PWNDN2_STROBE_GPIO TEGRA_GPIO_PBB5
+#define CAMERA_RESET1_GPIO TEGRA_GPIO_PD2
+#define CAMERA_FLASH_GPIO TEGRA_GPIO_PA0
+
+static int whistler_camera_init(void)
+{
+ tegra_gpio_enable(CAMERA_PWNDN1_GPIO);
+ gpio_request(CAMERA_PWNDN1_GPIO, "camera_powerdown");
+ gpio_direction_output(CAMERA_PWNDN1_GPIO, 0);
+ gpio_export(CAMERA_PWNDN1_GPIO, false);
+
+ tegra_gpio_enable(CAMERA_RESET1_GPIO);
+ gpio_request(CAMERA_RESET1_GPIO, "camera_reset1");
+ gpio_direction_output(CAMERA_RESET1_GPIO, 1);
+ gpio_export(CAMERA_RESET1_GPIO, false);
+
+ tegra_gpio_enable(CAMERA_RESET2_SHUTTER_GPIO);
+ gpio_request(CAMERA_RESET2_SHUTTER_GPIO, "camera_reset2_shutter");
+ gpio_direction_output(CAMERA_RESET2_SHUTTER_GPIO, 1);
+ gpio_export(CAMERA_RESET2_SHUTTER_GPIO, false);
+
+ tegra_gpio_enable(CAMERA_PWNDN2_STROBE_GPIO);
+ gpio_request(CAMERA_PWNDN2_STROBE_GPIO, "camera_pwrdwn2_strobe");
+ gpio_direction_output(CAMERA_PWNDN2_STROBE_GPIO, 0);
+ gpio_export(CAMERA_PWNDN2_STROBE_GPIO, false);
+
+ tegra_gpio_enable(CAMERA_FLASH_GPIO);
+ gpio_request(CAMERA_FLASH_GPIO, "camera_flash");
+ gpio_direction_output(CAMERA_FLASH_GPIO, 0);
+ gpio_export(CAMERA_FLASH_GPIO, false);
+
+ return 0;
+}
+
+static int whistler_ov5650_power_on(void)
+{
+ return 0;
+}
+
+static int whistler_ov5650_power_off(void)
+{
+ return 0;
+}
+
+struct ov5650_platform_data whistler_ov5650_data = {
+ .power_on = whistler_ov5650_power_on,
+ .power_off = whistler_ov5650_power_off,
+};
+
+static struct i2c_board_info whistler_i2c3_board_info[] = {
+ {
+ I2C_BOARD_INFO("ov5650", 0x36),
+ .platform_data = &whistler_ov5650_data,
+ },
+};
+
int __init whistler_sensors_init(void)
{
+ whistler_camera_init();
+
+ i2c_register_board_info(3, whistler_i2c3_board_info,
+ ARRAY_SIZE(whistler_i2c3_board_info));
+
return 0;
}