summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorPritesh Raithatha <praithatha@nvidia.com>2010-12-13 20:28:34 -0800
committerBharat Nihalani <bnihalani@nvidia.com>2010-12-14 23:58:30 -0800
commit084b957d086a3e7c1cdceefac772cd3632ef50cd (patch)
treebcea9b2ea94e9f304f92f34a61957674c08dc1e5 /arch
parentd8cb2dab9e6b9a22f6218d21185b999f317a9e42 (diff)
ventana: camera: late initcall for tca6416 and pca9546
-add new i2c device tca6416 -request tps6586x_gpio2 and set high to enable AVDD_DSI_CSI. -request camera selection gpio and set it. -add new i2c device pca9546 Keeping the late_init_call under OV5650 config Change-Id: Ic9ea671e9afdca91d5ed94df43227e2ed4e023aa Reviewed-on: http://git-master/r/12800 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-tegra/board-ventana-sensors.c60
1 files changed, 56 insertions, 4 deletions
diff --git a/arch/arm/mach-tegra/board-ventana-sensors.c b/arch/arm/mach-tegra/board-ventana-sensors.c
index 8d163cb8e10a..fd16b81b0bbe 100644
--- a/arch/arm/mach-tegra/board-ventana-sensors.c
+++ b/arch/arm/mach-tegra/board-ventana-sensors.c
@@ -29,6 +29,8 @@
#include <linux/mpu3050.h>
#endif
+#include <generated/mach-types.h>
+
#include "gpio-names.h"
#include <linux/i2c/pca954x.h>
#include <linux/i2c/pca953x.h>
@@ -133,11 +135,14 @@ static struct pca954x_platform_data ventana_pca9546_data = {
.num_modes = ARRAY_SIZE(ventana_pca9546_modes),
};
-static const struct i2c_board_info ventana_i2c3_board_info[] = {
+static const struct i2c_board_info ventana_i2c3_board_info_tca6416[] = {
{
I2C_BOARD_INFO("tca6416", 0x20),
.platform_data = &ventana_tca6416_data,
},
+};
+
+static const struct i2c_board_info ventana_i2c3_board_info_pca9546[] = {
{
I2C_BOARD_INFO("pca9546", 0x70),
.platform_data = &ventana_pca9546_data,
@@ -218,9 +223,6 @@ int __init ventana_sensors_init(void)
i2c_register_board_info(2, ventana_i2c2_board_info,
ARRAY_SIZE(ventana_i2c2_board_info));
- i2c_register_board_info(3, ventana_i2c3_board_info,
- ARRAY_SIZE(ventana_i2c3_board_info));
-
i2c_register_board_info(4, ventana_i2c4_board_info,
ARRAY_SIZE(ventana_i2c4_board_info));
@@ -233,3 +235,53 @@ int __init ventana_sensors_init(void)
return 0;
}
+
+#ifdef CONFIG_VIDEO_OV5650
+
+#define TPS6586X_GPIO2 TEGRA_NR_GPIOS + 1
+
+#define TCA6416_GPIO4 TEGRA_NR_GPIOS + 4 + 4
+#define TCA6416_GPIO5 TEGRA_NR_GPIOS + 4 + 5
+#define TCA6416_GPIO6 TEGRA_NR_GPIOS + 4 + 6
+#define TCA6416_GPIO7 TEGRA_NR_GPIOS + 4 + 7
+#define TCA6416_GPIO15 TEGRA_NR_GPIOS + 4 + 15
+
+int __init ventana_sensors_late_init()
+{
+
+ if (!machine_is_ventana()) return 0;
+
+ i2c_new_device(i2c_get_adapter(3), ventana_i2c3_board_info_tca6416);
+
+ gpio_request(TPS6586X_GPIO2, "tps6586x_gpio2");
+ gpio_direction_output(TPS6586X_GPIO2, 1);
+ gpio_export(TPS6586X_GPIO2, false);
+
+ gpio_request(TCA6416_GPIO4, "tca6416_gpio4");
+ gpio_direction_output(TCA6416_GPIO4, 0);
+ gpio_export(TCA6416_GPIO4, false);
+
+ gpio_request(TCA6416_GPIO5, "tca6416_gpio5");
+ gpio_direction_output(TCA6416_GPIO5, 1);
+ gpio_export(TCA6416_GPIO5, false);
+
+ gpio_request(TCA6416_GPIO6, "tca6416_gpio6");
+ gpio_direction_output(TCA6416_GPIO6, 0);
+ gpio_export(TCA6416_GPIO6, false);
+
+ gpio_request(TCA6416_GPIO7, "tca6416_gpio7");
+ gpio_direction_output(TCA6416_GPIO7, 1);
+ gpio_export(TCA6416_GPIO7, false);
+
+ gpio_request(TCA6416_GPIO15, "tca6416_gpio15");
+ gpio_direction_output(TCA6416_GPIO15, 1);
+ gpio_export(TCA6416_GPIO15, false);
+
+ i2c_new_device(i2c_get_adapter(3), ventana_i2c3_board_info_pca9546);
+
+ return 0;
+}
+
+late_initcall(ventana_sensors_late_init);
+
+#endif /* CONFIG_VIDEO_OV5650 */