arm: tegra: cardhu: Add OV2710 sensor driver for cardhu
Prayas Mohanty [Thu, 24 Feb 2011 23:00:01 +0000 (04:00 +0530)]
Add initialization code for OV2710.

bug: 794025
Original-Change-Id: I4b2a28cbdee83a3b3f18d6521dd9c3f8472b0ddc
Reviewed-on: http://git-master/r/20816
Tested-by: Prayas Mohanty <pmohanty@nvidia.com>
Reviewed-by: Abhiruchi Birajdar <abirajdar@nvidia.com>
Reviewed-by: Erik M Lilliebjerg <elilliebjerg@nvidia.com>
Reviewed-by: Daniel Willemsen <dwillemsen@nvidia.com>
Original-Change-Id: I1ab5df5a47b26052cfce3b962223350b382f4899

Rebase-Id: R13c354f397b4c56423cff5c9ad0f82ffa0299cdc

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

index 1be08b4..2e8d92f 100644 (file)
@@ -27,6 +27,7 @@
 #include <mach/fb.h>
 #include <mach/gpio.h>
 #include <media/ov5650.h>
+#include <media/ov2710.h>
 #include <generated/mach-types.h>
 #include "gpio-names.h"
 #include "board.h"
@@ -190,6 +191,24 @@ struct ov5650_platform_data cardhu_ov5650_data = {
        .power_off = cardhu_ov5650_power_off,
 };
 
+static int cardhu_ov2710_power_on(void)
+{
+       cardhu_ov5650_power_on();
+       gpio_direction_output(CAMERA_CSI_MUX_SEL_GPIO, 1);
+       return 0;
+}
+
+static int cardhu_ov2710_power_off(void)
+{
+       cardhu_ov5650_power_off();
+       return 0;
+}
+
+struct ov2710_platform_data cardhu_ov2710_data = {
+       .power_on = cardhu_ov2710_power_on,
+       .power_off = cardhu_ov2710_power_off,
+};
+
 static const struct i2c_board_info cardhu_i2c3_board_info[] = {
 #ifdef CONFIG_I2C_MUX_PCA954x
        {
@@ -205,6 +224,13 @@ static struct i2c_board_info cardhu_i2c6_board_info[] = {
        },
 };
 
+static struct i2c_board_info cardhu_i2c8_board_info[] = {
+       {
+               I2C_BOARD_INFO("ov2710", 0x36),
+               .platform_data = &cardhu_ov2710_data,
+       },
+};
+
 static struct nct1008_platform_data cardhu_nct1008_pdata = {
        .supported_hwrev = true,
        .ext_range = false,
@@ -382,6 +408,9 @@ int __init cardhu_sensors_init(void)
        i2c_register_board_info(PCA954x_I2C_BUS0, cardhu_i2c6_board_info,
                ARRAY_SIZE(cardhu_i2c6_board_info));
 
+       i2c_register_board_info(PCA954x_I2C_BUS2, cardhu_i2c8_board_info,
+               ARRAY_SIZE(cardhu_i2c8_board_info));
+
        pmu_tca6416_init();
 
        i2c_register_board_info(4, cardhu_i2c4_board_info,