diff options
author | kdivvela <kdivvela@nvidia.com> | 2011-09-30 18:34:14 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:49:26 -0800 |
commit | 1e757fd62a398dd2a622944fe16f93d1cda89718 (patch) | |
tree | 9497d8d4362049fe1914553247030ea6c04b1bc2 | |
parent | 451a464cb4edad1b16bac24f6abdd7ce82168d42 (diff) |
arm: tegra: cardhu: OV14810 sensor support
Support for OV14810 sensor on cardhu
Bug 839441
Reviewed-on: http://git-master/r/51985
(cherry picked from commit f1aea025b145a884ac4cc507c86c647ca65e348f)
Change-Id: I9db882aab6f8ae89c4d463b9d6825e7c7cfd2928
Reviewed-on: http://git-master/r/58660
Reviewed-by: Krupal Divvela <kdivvela@nvidia.com>
Tested-by: Krupal Divvela <kdivvela@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Rebase-Id: R8f2a1692deba888e2d0476ea2159a1e36722cc63
-rw-r--r-- | arch/arm/mach-tegra/board-cardhu-sensors.c | 67 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-cardhu.h | 1 |
2 files changed, 68 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu-sensors.c b/arch/arm/mach-tegra/board-cardhu-sensors.c index 128ff4684acd..2c3f0b2c3e6d 100644 --- a/arch/arm/mach-tegra/board-cardhu-sensors.c +++ b/arch/arm/mach-tegra/board-cardhu-sensors.c @@ -40,6 +40,7 @@ #include <mach/fb.h> #include <mach/gpio.h> #include <media/ov5650.h> +#include <media/ov14810.h> #include <media/ov2710.h> #include <media/tps61050.h> #include <generated/mach-types.h> @@ -217,6 +218,62 @@ struct ov5650_platform_data cardhu_left_ov5650_data = { .power_off = cardhu_left_ov5650_power_off, }; +#ifdef CONFIG_VIDEO_OV14810 +static int cardhu_ov14810_power_on(void) +{ + if (board_info.board_id == BOARD_E1198) { + gpio_direction_output(CAM1_POWER_DWN_GPIO, 1); + mdelay(20); + gpio_direction_output(OV14810_RESETN_GPIO, 0); + mdelay(100); + gpio_direction_output(OV14810_RESETN_GPIO, 1); + } + + return 0; +} + +static int cardhu_ov14810_power_off(void) +{ + if (board_info.board_id == BOARD_E1198) { + gpio_direction_output(CAM1_POWER_DWN_GPIO, 1); + gpio_direction_output(CAM2_POWER_DWN_GPIO, 1); + gpio_direction_output(CAM3_POWER_DWN_GPIO, 1); + } + + return 0; +} + +struct ov14810_platform_data cardhu_ov14810_data = { + .power_on = cardhu_ov14810_power_on, + .power_off = cardhu_ov14810_power_off, +}; + +struct ov14810_platform_data cardhu_ov14810uC_data = { + .power_on = NULL, + .power_off = NULL, +}; + +struct ov14810_platform_data cardhu_ov14810SlaveDev_data = { + .power_on = NULL, + .power_off = NULL, +}; + +static struct i2c_board_info cardhu_i2c_board_info_e1214[] = { + { + I2C_BOARD_INFO("ov14810", 0x36), + .platform_data = &cardhu_ov14810_data, + }, + { + I2C_BOARD_INFO("ov14810uC", 0x67), + .platform_data = &cardhu_ov14810uC_data, + }, + { + I2C_BOARD_INFO("ov14810SlaveDev", 0x69), + .platform_data = &cardhu_ov14810SlaveDev_data, + } +}; +#endif + static int cardhu_right_ov5650_power_on(void) { /* Boards E1198 and E1291 are of Cardhu personality @@ -776,6 +833,15 @@ int __init cardhu_sensors_init(void) i2c_register_board_info(2, cardhu_i2c_board_info_tps61050, ARRAY_SIZE(cardhu_i2c_board_info_tps61050)); +#ifdef CONFIG_VIDEO_OV14810 + /* This is disabled by default; To enable this change Kconfig; + * there should be some way to detect dynamically which board + * is connected (E1211/E1214), till that time sensor selection + * logic is static; + * e1214 corresponds to ov14810 sensor */ + i2c_register_board_info(2, cardhu_i2c_board_info_e1214, + ARRAY_SIZE(cardhu_i2c_board_info_e1214)); +#else /* Left camera is on PCA954x's I2C BUS0, Right camera is on BUS1 & * Front camera is on BUS2 */ i2c_register_board_info(PCA954x_I2C_BUS0, cardhu_i2c6_board_info, @@ -787,6 +853,7 @@ int __init cardhu_sensors_init(void) i2c_register_board_info(PCA954x_I2C_BUS2, cardhu_i2c8_board_info, ARRAY_SIZE(cardhu_i2c8_board_info)); +#endif pmu_tca6416_init(); if (board_info.board_id == BOARD_E1291) diff --git a/arch/arm/mach-tegra/board-cardhu.h b/arch/arm/mach-tegra/board-cardhu.h index e4b4d29132ab..fbf96a92a903 100644 --- a/arch/arm/mach-tegra/board-cardhu.h +++ b/arch/arm/mach-tegra/board-cardhu.h @@ -145,6 +145,7 @@ #define CAM1_LDO_EN_GPIO TEGRA_GPIO_PR6 #define CAM2_LDO_EN_GPIO TEGRA_GPIO_PR7 #define CAM3_LDO_EN_GPIO TEGRA_GPIO_PS0 +#define OV14810_RESETN_GPIO TEGRA_GPIO_PBB0 #define CAMERA_FLASH_SYNC_GPIO TEGRA_GPIO_PBB3 #define CAMERA_FLASH_MAX_TORCH_AMP 7 |