arm: tegra: cardhu: pm269 board support for sh532u
Erik Lilliebjerg [Sat, 7 Jan 2012 02:59:50 +0000 (19:59 -0700)]
Add PM269 board support for sh532u focuser by adding regulator
defines and the PM269 reset GPIO's.

Bug 923072

Change-Id: Ic042d2c9c2cf78a38a1b72fab2db0289fb1d9909
Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com>
Reviewed-on: http://git-master/r/73877
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
Reviewed-on: http://git-master/r/75146
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Tested-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User

arch/arm/mach-tegra/board-cardhu-pm298-power-rails.c
arch/arm/mach-tegra/board-cardhu-pm299-power-rails.c
arch/arm/mach-tegra/board-cardhu-sensors.c

index d1ad617..50e10fc 100644 (file)
@@ -486,14 +486,14 @@ static int gpio_switch_en_vdd_pnl1_voltages[] = { 3300};
 /* CAM1_LDO_EN from AP GPIO KB_ROW6 R06*/
 static struct regulator_consumer_supply gpio_switch_cam1_ldo_en_supply[] = {
        REGULATOR_SUPPLY("vdd_2v8_cam1", NULL),
-       REGULATOR_SUPPLY("vdd_2v8_cam1_af", NULL),
+       REGULATOR_SUPPLY("vdd", "6-0072"),
 };
 static int gpio_switch_cam1_ldo_en_voltages[] = { 2800};
 
 /* CAM2_LDO_EN from AP GPIO KB_ROW7 R07*/
 static struct regulator_consumer_supply gpio_switch_cam2_ldo_en_supply[] = {
        REGULATOR_SUPPLY("vdd_2v8_cam2", NULL),
-       REGULATOR_SUPPLY("vdd_2v8_cam2_af", NULL),
+       REGULATOR_SUPPLY("vdd", "7-0072"),
 };
 static int gpio_switch_cam2_ldo_en_voltages[] = { 2800};
 
@@ -538,6 +538,9 @@ static struct regulator_consumer_supply gpio_switch_en_1v8_cam_supply[] = {
        REGULATOR_SUPPLY("vdd_1v8_cam1", NULL),
        REGULATOR_SUPPLY("vdd_1v8_cam2", NULL),
        REGULATOR_SUPPLY("vdd_1v8_cam3", NULL),
+       REGULATOR_SUPPLY("vdd_i2c", "6-0072"),
+       REGULATOR_SUPPLY("vdd_i2c", "7-0072"),
+       REGULATOR_SUPPLY("vdd_i2c", "2-0033"),
 };
 static int gpio_switch_en_1v8_cam_voltages[] = { 1800};
 
index 76f358c..0b79534 100644 (file)
@@ -473,14 +473,14 @@ static int gpio_switch_en_vdd_pnl1_voltages[] = { 3300};
 /* CAM1_LDO_EN from AP GPIO KB_ROW6 R06*/
 static struct regulator_consumer_supply gpio_switch_cam1_ldo_en_supply[] = {
        REGULATOR_SUPPLY("vdd_2v8_cam1", NULL),
-       REGULATOR_SUPPLY("vdd_2v8_cam1_af", NULL),
+       REGULATOR_SUPPLY("vdd", "6-0072"),
 };
 static int gpio_switch_cam1_ldo_en_voltages[] = { 2800};
 
 /* CAM2_LDO_EN from AP GPIO KB_ROW7 R07*/
 static struct regulator_consumer_supply gpio_switch_cam2_ldo_en_supply[] = {
        REGULATOR_SUPPLY("vdd_2v8_cam2", NULL),
-       REGULATOR_SUPPLY("vdd_2v8_cam2_af", NULL),
+       REGULATOR_SUPPLY("vdd", "7-0072"),
 };
 static int gpio_switch_cam2_ldo_en_voltages[] = { 2800};
 
@@ -525,6 +525,9 @@ static struct regulator_consumer_supply gpio_switch_en_1v8_cam_supply[] = {
        REGULATOR_SUPPLY("vdd_1v8_cam1", NULL),
        REGULATOR_SUPPLY("vdd_1v8_cam2", NULL),
        REGULATOR_SUPPLY("vdd_1v8_cam3", NULL),
+       REGULATOR_SUPPLY("vdd_i2c", "6-0072"),
+       REGULATOR_SUPPLY("vdd_i2c", "7-0072"),
+       REGULATOR_SUPPLY("vdd_i2c", "2-0033"),
 };
 static int gpio_switch_en_1v8_cam_voltages[] = { 1800};
 
index e464ffe..c969337 100644 (file)
@@ -485,6 +485,20 @@ static struct sh532u_platform_data sh532u_right_pdata = {
        .gpio_reset     = TEGRA_GPIO_PBB0,
 };
 
+static struct sh532u_platform_data pm269_sh532u_left_pdata = {
+       .num            = 1,
+       .sync           = 2,
+       .dev_name       = "focuser",
+       .gpio_reset     = CAM1_RST_L_GPIO,
+};
+
+static struct sh532u_platform_data pm269_sh532u_right_pdata = {
+       .num            = 2,
+       .sync           = 1,
+       .dev_name       = "focuser",
+       .gpio_reset     = CAM2_RST_L_GPIO,
+};
+
 static struct nvc_torch_pin_state cardhu_tps61050_pinstate = {
        .mask           = 0x0008, /*VGP3*/
        .values         = 0x0008,
@@ -524,6 +538,28 @@ static struct i2c_board_info cardhu_i2c7_board_info[] = {
        },
 };
 
+static struct i2c_board_info pm269_i2c6_board_info[] = {
+       {
+               I2C_BOARD_INFO("ov5650L", 0x36),
+               .platform_data = &cardhu_left_ov5650_data,
+       },
+       {
+               I2C_BOARD_INFO("sh532u", 0x72),
+               .platform_data = &pm269_sh532u_left_pdata,
+       },
+};
+
+static struct i2c_board_info pm269_i2c7_board_info[] = {
+       {
+               I2C_BOARD_INFO("ov5650R", 0x36),
+               .platform_data = &cardhu_right_ov5650_data,
+       },
+       {
+               I2C_BOARD_INFO("sh532u", 0x72),
+               .platform_data = &pm269_sh532u_right_pdata,
+       },
+};
+
 static struct i2c_board_info cardhu_i2c8_board_info[] = {
        {
                I2C_BOARD_INFO("ov2710", 0x36),
@@ -835,12 +871,23 @@ int __init cardhu_sensors_init(void)
 #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,
-               ARRAY_SIZE(cardhu_i2c6_board_info));
-
-       i2c_register_board_info(PCA954x_I2C_BUS1, cardhu_i2c7_board_info,
-               ARRAY_SIZE(cardhu_i2c7_board_info));
-
+       if (board_info.board_id != BOARD_PM269) {
+               i2c_register_board_info(PCA954x_I2C_BUS0,
+                                       cardhu_i2c6_board_info,
+                                       ARRAY_SIZE(cardhu_i2c6_board_info));
+
+               i2c_register_board_info(PCA954x_I2C_BUS1,
+                                       cardhu_i2c7_board_info,
+                                       ARRAY_SIZE(cardhu_i2c7_board_info));
+       } else {
+               i2c_register_board_info(PCA954x_I2C_BUS0,
+                                       pm269_i2c6_board_info,
+                                       ARRAY_SIZE(pm269_i2c6_board_info));
+
+               i2c_register_board_info(PCA954x_I2C_BUS1,
+                                       pm269_i2c7_board_info,
+                                       ARRAY_SIZE(pm269_i2c7_board_info));
+       }
        i2c_register_board_info(PCA954x_I2C_BUS2, cardhu_i2c8_board_info,
                ARRAY_SIZE(cardhu_i2c8_board_info));