ARM: tegra: Add ad5816 focuser board support
Sudhir Vyas [Thu, 17 May 2012 14:32:22 +0000 (19:32 +0530)]
- Add support for new focuser ad5816 driver to
cardhu boards.
- Add regulator for new focuser ad5816.

Bug 947792

Change-Id: I62e89e9188d307704098e2d4e88d276914836d70
Signed-off-by: Sudhir vyas <svyas@nvidia.com>
Reviewed-on: http://git-master/r/103138
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>

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

index ab7fac8..3bda314 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * arch/arm/mach-tegra/board-cardhu-power.c
  *
- * Copyright (C) 2011 NVIDIA, Inc.
+ * Copyright (C) 2011-2012 NVIDIA, Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -606,6 +606,7 @@ static struct regulator_consumer_supply fixed_reg_en_vdd_pnl1_supply[] = {
 static struct regulator_consumer_supply fixed_reg_cam1_ldo_en_supply[] = {
        REGULATOR_SUPPLY("vdd_2v8_cam1", NULL),
        REGULATOR_SUPPLY("avdd", "6-0072"),
+       REGULATOR_SUPPLY("vdd", "6-000e"),
 };
 
 /* CAM2_LDO_EN from AP GPIO KB_ROW7 R07*/
@@ -651,6 +652,7 @@ static struct regulator_consumer_supply fixed_reg_en_1v8_cam_supply[] = {
        REGULATOR_SUPPLY("vdd_1v8_cam3", NULL),
        REGULATOR_SUPPLY("dvdd", "6-0072"),
        REGULATOR_SUPPLY("dvdd", "7-0072"),
+       REGULATOR_SUPPLY("vdd_i2c", "6-000e"),
        REGULATOR_SUPPLY("vdd_i2c", "2-0033"),
 };
 
index 9773faa..1b4d733 100644 (file)
@@ -50,6 +50,7 @@
 #include "board.h"
 #include <linux/mpu.h>
 #include <media/sh532u.h>
+#include <media/ad5816.h>
 #include <linux/bq27x00.h>
 #include <mach/edp.h>
 #include <mach/thermal.h>
@@ -596,6 +597,54 @@ static struct sh532u_platform_data pm269_sh532u_right_pdata = {
        .gpio           = pm269_sh532u_right_gpio_pdata,
 };
 
+static struct nvc_gpio_pdata ad5816_gpio_pdata[] = {
+       { AD5816_GPIO_RESET, TEGRA_GPIO_PBB0, false, 0, },
+};
+
+static struct ad5816_platform_data ad5816_left_pdata = {
+       .cfg            = NVC_CFG_NODEV,
+       .num            = 1,
+       .sync           = 2,
+       .dev_name       = "focuser",
+       .gpio_count     = ARRAY_SIZE(ad5816_gpio_pdata),
+       .gpio           = ad5816_gpio_pdata,
+};
+
+static struct ad5816_platform_data ad5816_right_pdata = {
+       .cfg            = NVC_CFG_NODEV,
+       .num            = 2,
+       .sync           = 1,
+       .dev_name       = "focuser",
+       .gpio_count     = ARRAY_SIZE(ad5816_gpio_pdata),
+       .gpio           = ad5816_gpio_pdata,
+};
+
+static struct nvc_gpio_pdata pm269_ad5816_left_gpio_pdata[] = {
+       { AD5816_GPIO_RESET, CAM1_RST_L_GPIO, false, 0, },
+};
+
+static struct ad5816_platform_data pm269_ad5816_left_pdata = {
+       .cfg            = 0,
+       .num            = 1,
+       .sync           = 2,
+       .dev_name       = "focuser",
+       .gpio_count     = ARRAY_SIZE(pm269_ad5816_left_gpio_pdata),
+       .gpio           = pm269_ad5816_left_gpio_pdata,
+};
+
+static struct nvc_gpio_pdata pm269_ad5816_right_gpio_pdata[] = {
+       { AD5816_GPIO_RESET, CAM2_RST_L_GPIO, false, 0, },
+};
+
+static struct ad5816_platform_data pm269_ad5816_right_pdata = {
+       .cfg            = 0,
+       .num            = 2,
+       .sync           = 1,
+       .dev_name       = "focuser",
+       .gpio_count     = ARRAY_SIZE(pm269_ad5816_right_gpio_pdata),
+       .gpio           = pm269_ad5816_right_gpio_pdata,
+};
+
 
 static struct nvc_torch_pin_state cardhu_tps61050_pinstate = {
        .mask           = 0x0008, /*VGP3*/
@@ -623,6 +672,10 @@ static struct i2c_board_info cardhu_i2c6_board_info[] = {
                I2C_BOARD_INFO("sh532u", 0x72),
                .platform_data = &sh532u_left_pdata,
        },
+       {
+               I2C_BOARD_INFO("ad5816", 0x0E),
+               .platform_data = &ad5816_left_pdata,
+       },
 };
 
 static struct i2c_board_info cardhu_i2c7_board_info[] = {
@@ -634,6 +687,10 @@ static struct i2c_board_info cardhu_i2c7_board_info[] = {
                I2C_BOARD_INFO("sh532u", 0x72),
                .platform_data = &sh532u_right_pdata,
        },
+       {
+               I2C_BOARD_INFO("ad5816", 0x0E),
+               .platform_data = &ad5816_right_pdata,
+       },
 };
 
 static struct i2c_board_info pm269_i2c6_board_info[] = {
@@ -645,6 +702,10 @@ static struct i2c_board_info pm269_i2c6_board_info[] = {
                I2C_BOARD_INFO("sh532u", 0x72),
                .platform_data = &pm269_sh532u_left_pdata,
        },
+       {
+               I2C_BOARD_INFO("ad5816", 0x0E),
+               .platform_data = &pm269_ad5816_left_pdata,
+       },
 };
 
 static struct i2c_board_info pm269_i2c7_board_info[] = {
@@ -656,6 +717,10 @@ static struct i2c_board_info pm269_i2c7_board_info[] = {
                I2C_BOARD_INFO("sh532u", 0x72),
                .platform_data = &pm269_sh532u_right_pdata,
        },
+       {
+               I2C_BOARD_INFO("ad5816", 0x0E),
+               .platform_data = &pm269_ad5816_right_pdata,
+       },
 };
 
 static struct i2c_board_info cardhu_i2c8_board_info[] = {