diff options
-rw-r--r-- | arch/arm/mach-tegra/board-loki-pinmux-t12x.h | 6 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-loki-power.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-loki-sensors.c | 60 |
3 files changed, 67 insertions, 4 deletions
diff --git a/arch/arm/mach-tegra/board-loki-pinmux-t12x.h b/arch/arm/mach-tegra/board-loki-pinmux-t12x.h index 3e70ce06e764..d7cc3598d4b7 100644 --- a/arch/arm/mach-tegra/board-loki-pinmux-t12x.h +++ b/arch/arm/mach-tegra/board-loki-pinmux-t12x.h @@ -172,6 +172,8 @@ static __initdata struct tegra_pingroup_config loki_pinmux_common[] = { GPIO_PINMUX(GPIO_X7_AUD, PULL_DOWN, NORMAL, OUTPUT, DISABLE), GPIO_PINMUX(GPIO_W3_AUD, NORMAL, NORMAL, INPUT, DISABLE), GPIO_PINMUX(GPIO_X1_AUD, PULL_DOWN, NORMAL, OUTPUT, DISABLE), + GPIO_PINMUX(GPIO_PBB3, NORMAL, NORMAL, OUTPUT, DISABLE), + GPIO_PINMUX(GPIO_PBB6, NORMAL, NORMAL, OUTPUT, DISABLE), GPIO_PINMUX(GPIO_PG0, NORMAL, NORMAL, INPUT, DISABLE), GPIO_PINMUX(GPIO_PG1, NORMAL, NORMAL, INPUT, DISABLE), GPIO_PINMUX(GPIO_PH4, NORMAL, NORMAL, OUTPUT, DISABLE), @@ -252,10 +254,8 @@ static __initdata struct tegra_pingroup_config unused_pins_lowpower[] = { UNUSED_PINMUX(ULPI_DATA7), VI_PINMUX(CAM_MCLK, VI_ALT3, NORMAL, NORMAL, OUTPUT, DEFAULT, DISABLE), UNUSED_PINMUX(GPIO_PBB0), - UNUSED_PINMUX(GPIO_PBB3), UNUSED_PINMUX(GPIO_PBB4), UNUSED_PINMUX(GPIO_PBB5), - UNUSED_PINMUX(GPIO_PBB6), UNUSED_PINMUX(GPIO_PBB7), UNUSED_PINMUX(GPIO_PCC1), UNUSED_PINMUX(GPIO_PCC2), @@ -288,6 +288,8 @@ static struct gpio_init_pin_info init_gpio_mode_loki_common[] = { GPIO_INIT_PIN_MODE(TEGRA_GPIO_PX7, false, 0), GPIO_INIT_PIN_MODE(TEGRA_GPIO_PW3, true, 0), GPIO_INIT_PIN_MODE(TEGRA_GPIO_PX1, false, 0), + GPIO_INIT_PIN_MODE(TEGRA_GPIO_PBB3, false, 0), + GPIO_INIT_PIN_MODE(TEGRA_GPIO_PBB6, false, 0), GPIO_INIT_PIN_MODE(TEGRA_GPIO_PG0, true, 0), GPIO_INIT_PIN_MODE(TEGRA_GPIO_PG1, true, 0), GPIO_INIT_PIN_MODE(TEGRA_GPIO_PH2, false, 0), diff --git a/arch/arm/mach-tegra/board-loki-power.c b/arch/arm/mach-tegra/board-loki-power.c index 1ce7c3fd3f7f..fd7a6e633aef 100644 --- a/arch/arm/mach-tegra/board-loki-power.c +++ b/arch/arm/mach-tegra/board-loki-power.c @@ -103,6 +103,7 @@ static struct regulator_consumer_supply palmas_smps8_supply[] = { REGULATOR_SUPPLY("vid", "0-000c"), REGULATOR_SUPPLY("vddio", "0-0077"), REGULATOR_SUPPLY("vif", "2-0048"), + REGULATOR_SUPPLY("vif2", "2-0021"), }; static struct regulator_consumer_supply palmas_smps9_supply[] = { @@ -142,8 +143,7 @@ static struct regulator_consumer_supply palmas_ldo2_supply[] = { static struct regulator_consumer_supply palmas_ldo3_supply[] = { REGULATOR_SUPPLY("avdd_dsi_csi", "tegradc.0"), REGULATOR_SUPPLY("avdd_dsi_csi", "tegradc.1"), - REGULATOR_SUPPLY("avdd_dsi_csi", "vi.0"), - REGULATOR_SUPPLY("avdd_dsi_csi", "vi.1"), + REGULATOR_SUPPLY("avdd_dsi_csi", "vi"), REGULATOR_SUPPLY("vddio_hsic", "tegra-ehci.1"), REGULATOR_SUPPLY("vddio_hsic", "tegra-ehci.2"), REGULATOR_SUPPLY("vddio_hsic", "tegra-xhci"), @@ -163,6 +163,7 @@ static struct regulator_consumer_supply palmas_ldo6_supply[] = { REGULATOR_SUPPLY("vdd", "0-0077"), REGULATOR_SUPPLY("vdd", "0-004c"), REGULATOR_SUPPLY("vdd", "0-0068"), + REGULATOR_SUPPLY("vana", "2-0021"), }; static struct regulator_consumer_supply palmas_ldo8_supply[] = { diff --git a/arch/arm/mach-tegra/board-loki-sensors.c b/arch/arm/mach-tegra/board-loki-sensors.c index 7f27e733b328..f7e7c558200e 100644 --- a/arch/arm/mach-tegra/board-loki-sensors.c +++ b/arch/arm/mach-tegra/board-loki-sensors.c @@ -24,6 +24,7 @@ #include <linux/nct1008.h> #include <linux/tegra-fuse.h> #include <media/mt9m114.h> +#include <media/ov7695.h> #include <mach/gpio-tegra.h> #include <mach/edp.h> #include <linux/gpio.h> @@ -193,11 +194,70 @@ struct mt9m114_platform_data loki_mt9m114_pdata = { .power_off = loki_mt9m114_power_off, }; +static int loki_ov7695_power_on(struct ov7695_power_rail *pw) +{ + int err; + + if (unlikely(WARN_ON(!pw || !pw->avdd || !pw->iovdd))) + return -EFAULT; + + gpio_set_value(CAM2_PWDN, 0); + usleep_range(1000, 1020); + + err = regulator_enable(pw->avdd); + if (unlikely(err)) + goto ov7695_avdd_fail; + usleep_range(300, 320); + + err = regulator_enable(pw->iovdd); + if (unlikely(err)) + goto ov7695_iovdd_fail; + usleep_range(1000, 1020); + + gpio_set_value(CAM2_PWDN, 1); + usleep_range(1000, 1020); + + return 0; + +ov7695_iovdd_fail: + regulator_disable(pw->avdd); + +ov7695_avdd_fail: + + gpio_set_value(CAM_RSTN, 0); + return -ENODEV; +} + +static int loki_ov7695_power_off(struct ov7695_power_rail *pw) +{ + if (unlikely(WARN_ON(!pw || !pw->avdd || !pw->iovdd))) + return -EFAULT; + usleep_range(100, 120); + + regulator_disable(pw->iovdd); + usleep_range(100, 120); + + regulator_disable(pw->avdd); + usleep_range(100, 120); + + gpio_set_value(CAM2_PWDN, 0); + return 0; +} + +struct ov7695_platform_data loki_ov7695_pdata = { + .power_on = loki_ov7695_power_on, + .power_off = loki_ov7695_power_off, +}; + static struct i2c_board_info loki_i2c_board_info_e2548[] = { { I2C_BOARD_INFO("mt9m114", 0x48), .platform_data = &loki_mt9m114_pdata, }, + { + I2C_BOARD_INFO("ov7695", 0x21), + .platform_data = &loki_ov7695_pdata, + }, }; static int loki_camera_init(void) |