media: video: tegra: ov9772 NVC driver
Phil Breczinski [Thu, 13 Sep 2012 02:28:58 +0000 (19:28 -0700)]
Replace old framework ov9772 driver with new framework
NVC driver.

Bug 1041786

Change-Id: I4e6c1e22d745688e652becdc94171874333bb865
Signed-off-by: Phil Breczinski <pbreczinski@nvidia.com>
(cherry picked from commit 9c4d6d1da8e5083adea4545288c10ee46edc3903)
Reviewed-on: http://git-master/r/139517
Reviewed-on: http://git-master/r/146022
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

Rebase-Id: Rb5b8a54daa97c9d64228f3f90dff1b204d492b42

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

index 10d58f3..a07589c 100644 (file)
@@ -175,16 +175,25 @@ static int dalmore_ov9772_power_off(struct device *dev)
        return 0;
 }
 
+static struct nvc_gpio_pdata ov9772_gpio_pdata[] = {
+       { OV9772_GPIO_TYPE_SHTDN, TEGRA_GPIO_PBB5, true, 0, },
+       { OV9772_GPIO_TYPE_PWRDN, TEGRA_GPIO_PBB3, true, 0, },
+};
+
+static struct ov9772_platform_data ov9772_pdata = {
+       .num            = 1,
+       .dev_name       = "camera",
+       .gpio_count     = ARRAY_SIZE(ov9772_gpio_pdata),
+       .gpio           = ov9772_gpio_pdata,
+       .power_on       = dalmore_ov9772_power_on,
+       .power_off      = dalmore_ov9772_power_off,
+};
+
 struct imx091_platform_data dalmore_imx091_data = {
        .power_on = dalmore_imx091_power_on,
        .power_off = dalmore_imx091_power_off,
 };
 
-struct ov9772_platform_data dalmore_ov9772_data = {
-       .power_on = dalmore_ov9772_power_on,
-       .power_off = dalmore_ov9772_power_off,
-};
-
 static struct i2c_board_info dalmore_i2c_board_info_e1625[] = {
        {
                I2C_BOARD_INFO("imx091", 0x36),
@@ -192,7 +201,7 @@ static struct i2c_board_info dalmore_i2c_board_info_e1625[] = {
        },
        {
                I2C_BOARD_INFO("ov9772", 0x10),
-               .platform_data = &dalmore_ov9772_data,
+               .platform_data = &ov9772_pdata,
        },
 };