diff options
author | Nathan Lord <nlord@nvidia.com> | 2011-02-07 00:41:35 -0800 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:46:12 -0800 |
commit | 746f5fdc1e60b12977994a90e5dd9b5f5da18582 (patch) | |
tree | 3f71d4bfdf61cd3ad0b9fd1af89cce2dabf90190 | |
parent | e7f4ad751e664c75f291b3a8f40e0f94732d4225 (diff) |
arm: tegra: ventana: add support for ov2710
Original-Change-Id: I58ad22bd0a78e705ba6d4941352c397c3cb2bd43
Reviewed-on: http://git-master/r/18539
Reviewed-by: Nathan Lord <nlord@nvidia.com>
Tested-by: Nathan Lord <nlord@nvidia.com>
Reviewed-by: Jonathan Mayo <jmayo@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
Rebase-Id: R9f25d092f95ad26da0bc564c6b412075db0040df
-rw-r--r-- | arch/arm/mach-tegra/board-ventana-sensors.c | 52 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-ventana.h | 24 |
2 files changed, 62 insertions, 14 deletions
diff --git a/arch/arm/mach-tegra/board-ventana-sensors.c b/arch/arm/mach-tegra/board-ventana-sensors.c index 92491e39e8c4..794068316429 100644 --- a/arch/arm/mach-tegra/board-ventana-sensors.c +++ b/arch/arm/mach-tegra/board-ventana-sensors.c @@ -1,7 +1,7 @@ /* * arch/arm/mach-tegra/board-ventana-sensors.c * - * Copyright (c) 2010, NVIDIA, All Rights Reserved. + * Copyright (c) 2011, NVIDIA, All Rights Reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,6 +27,7 @@ #include <mach/gpio.h> #include <media/ov5650.h> +#include <media/ov2710.h> #include <generated/mach-types.h> #include "gpio-names.h" @@ -59,6 +60,7 @@ static int ventana_camera_init(void) static int ventana_ov5650_power_on(void) { + gpio_direction_output(CAMERA_CSI_MUX_SEL_GPIO, 0); return 0; } @@ -72,6 +74,22 @@ struct ov5650_platform_data ventana_ov5650_data = { .power_off = ventana_ov5650_power_off, }; +static int ventana_ov2710_power_on(void) +{ + gpio_direction_output(CAMERA_CSI_MUX_SEL_GPIO, 1); + return 0; +} + +static int ventana_ov2710_power_off(void) +{ + return 0; +} + +struct ov2710_platform_data ventana_ov2710_data = { + .power_on = ventana_ov2710_power_on, + .power_off = ventana_ov2710_power_off, +}; + static void ventana_isl29018_init(void) { tegra_gpio_enable(ISL29018_IRQ_GPIO); @@ -174,6 +192,13 @@ static struct i2c_board_info ventana_i2c7_board_info[] = { }, }; +static struct i2c_board_info ventana_i2c8_board_info[] = { + { + I2C_BOARD_INFO("ov2710", 0x36), + .platform_data = &ventana_ov2710_data, + }, +}; + int __init ventana_sensors_init(void) { struct board_info BoardInfo; @@ -204,6 +229,9 @@ int __init ventana_sensors_init(void) i2c_register_board_info(7, ventana_i2c7_board_info, ARRAY_SIZE(ventana_i2c7_board_info)); + i2c_register_board_info(8, ventana_i2c8_board_info, + ARRAY_SIZE(ventana_i2c8_board_info)); + return 0; } @@ -224,11 +252,23 @@ struct ov5650_gpios { static struct ov5650_gpios ov5650_gpio_keys[] = { [0] = OV5650_GPIO("en_avdd_csi", AVDD_DSI_CSI_ENB_GPIO, 1), - [1] = OV5650_GPIO("cam2_pwdn", CAM2_PWR_DN_GPIO, 0), - [2] = OV5650_GPIO("cam2_rst_lo", CAM2_RST_L_GPIO, 1), - [3] = OV5650_GPIO("cam2_af_pwdn_lo", CAM2_AF_PWR_DN_L_GPIO, 0), - [4] = OV5650_GPIO("cam2_ldo_shdn_lo", CAM2_LDO_SHUTDN_L_GPIO, 1), - [5] = OV5650_GPIO("cam2_i2c_mux_rst_lo", CAM2_I2C_MUX_RST_GPIO, 1), + [1] = OV5650_GPIO("cam_i2c_mux_rst_lo", CAM_I2C_MUX_RST_GPIO, 1), + + [2] = OV5650_GPIO("cam2_pwdn", CAM2_PWR_DN_GPIO, 0), + [3] = OV5650_GPIO("cam2_rst_lo", CAM2_RST_L_GPIO, 1), + [4] = OV5650_GPIO("cam2_af_pwdn_lo", CAM2_AF_PWR_DN_L_GPIO, 1), + [5] = OV5650_GPIO("cam2_ldo_shdn_lo", CAM2_LDO_SHUTDN_L_GPIO, 1), + + [6] = OV5650_GPIO("cam1_pwdn", CAM1_PWR_DN_GPIO, 0), + [7] = OV5650_GPIO("cam1_rst_lo", CAM1_RST_L_GPIO, 1), + [8] = OV5650_GPIO("cam1_af_pwdn_lo", CAM1_AF_PWR_DN_L_GPIO, 0), + [9] = OV5650_GPIO("cam1_ldo_shdn_lo", CAM1_LDO_SHUTDN_L_GPIO, 1), + + [10] = OV5650_GPIO("cam3_pwdn", CAM3_PWR_DN_GPIO, 0), + [11] = OV5650_GPIO("cam3_rst_lo", CAM3_RST_L_GPIO, 1), + [12] = OV5650_GPIO("cam3_af_pwdn_lo", CAM3_AF_PWR_DN_L_GPIO, 0), + [13] = OV5650_GPIO("cam3_ldo_shdn_lo", CAM3_LDO_SHUTDN_L_GPIO, 1), + }; int __init ventana_ov5650_late_init(void) diff --git a/arch/arm/mach-tegra/board-ventana.h b/arch/arm/mach-tegra/board-ventana.h index 2c929c435935..353ac46f6ea0 100644 --- a/arch/arm/mach-tegra/board-ventana.h +++ b/arch/arm/mach-tegra/board-ventana.h @@ -1,7 +1,7 @@ /* * arch/arm/mach-tegra/board-ventana.h * - * Copyright (C) 2010 Google, Inc. + * Copyright (C) 2011 Google, Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -30,14 +30,22 @@ int ventana_emc_init(void); /* TPS6586X gpios */ #define TPS6586X_GPIO_BASE TEGRA_NR_GPIOS -#define AVDD_DSI_CSI_ENB_GPIO TPS6586X_GPIO_BASE + 1 /* gpio2 */ +#define AVDD_DSI_CSI_ENB_GPIO (TPS6586X_GPIO_BASE + 1) /* gpio2 */ /* TCA6416 gpios */ -#define TCA6416_GPIO_BASE TEGRA_NR_GPIOS + 4 -#define CAM2_PWR_DN_GPIO TCA6416_GPIO_BASE + 4 /* gpio4 */ -#define CAM2_RST_L_GPIO TCA6416_GPIO_BASE + 5 /* gpio5 */ -#define CAM2_AF_PWR_DN_L_GPIO TCA6416_GPIO_BASE + 6 /* gpio6 */ -#define CAM2_LDO_SHUTDN_L_GPIO TCA6416_GPIO_BASE + 7 /* gpio7 */ -#define CAM2_I2C_MUX_RST_GPIO TCA6416_GPIO_BASE + 15 /* gpio15 */ +#define TCA6416_GPIO_BASE (TEGRA_NR_GPIOS + 4) +#define CAM1_PWR_DN_GPIO (TCA6416_GPIO_BASE + 0) /* gpio0 */ +#define CAM1_RST_L_GPIO (TCA6416_GPIO_BASE + 1) /* gpio1 */ +#define CAM1_AF_PWR_DN_L_GPIO (TCA6416_GPIO_BASE + 2) /* gpio2 */ +#define CAM1_LDO_SHUTDN_L_GPIO (TCA6416_GPIO_BASE + 3) /* gpio3 */ +#define CAM2_PWR_DN_GPIO (TCA6416_GPIO_BASE + 4) /* gpio4 */ +#define CAM2_RST_L_GPIO (TCA6416_GPIO_BASE + 5) /* gpio5 */ +#define CAM2_AF_PWR_DN_L_GPIO (TCA6416_GPIO_BASE + 6) /* gpio6 */ +#define CAM2_LDO_SHUTDN_L_GPIO (TCA6416_GPIO_BASE + 7) /* gpio7 */ +#define CAM3_PWR_DN_GPIO (TCA6416_GPIO_BASE + 8) /* gpio8 */ +#define CAM3_RST_L_GPIO (TCA6416_GPIO_BASE + 9) /* gpio9 */ +#define CAM3_AF_PWR_DN_L_GPIO (TCA6416_GPIO_BASE + 10) /* gpio10 */ +#define CAM3_LDO_SHUTDN_L_GPIO (TCA6416_GPIO_BASE + 11) /* gpio11 */ +#define CAM_I2C_MUX_RST_GPIO (TCA6416_GPIO_BASE + 15) /* gpio15 */ #endif |