summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-harmony-pcie.c
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2011-03-19 05:38:08 +0300
committerColin Cross <ccross@android.com>2011-03-19 05:38:08 +0300
commit84abf6084704673ae80a2105bf63ece5eee3edd5 (patch)
treeb65d3fab2b7e86935f9248053d741ed91f68b6b3 /arch/arm/mach-tegra/board-harmony-pcie.c
parentc871fe663a6368fd0e98f5a3bfd81b0b9c591266 (diff)
parent2f40ea9d0743b3cc48190e4ebf3a9f474a8833a2 (diff)
downloadlinux-84abf6084704673ae80a2105bf63ece5eee3edd5.tar.xz
Merge branch 'boards-for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/tegra-2.6 into for-next
Diffstat (limited to 'arch/arm/mach-tegra/board-harmony-pcie.c')
-rw-r--r--arch/arm/mach-tegra/board-harmony-pcie.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/board-harmony-pcie.c b/arch/arm/mach-tegra/board-harmony-pcie.c
index f7e7d4514b6a..9c27b95b8d86 100644
--- a/arch/arm/mach-tegra/board-harmony-pcie.c
+++ b/arch/arm/mach-tegra/board-harmony-pcie.c
@@ -27,13 +27,29 @@
#ifdef CONFIG_TEGRA_PCI
+/* GPIO 3 of the PMIC */
+#define EN_VDD_1V05_GPIO (TEGRA_NR_GPIOS + 2)
+
static int __init harmony_pcie_init(void)
{
+ struct regulator *regulator = NULL;
int err;
if (!machine_is_harmony())
return 0;
+ err = gpio_request(EN_VDD_1V05_GPIO, "EN_VDD_1V05");
+ if (err)
+ return err;
+
+ gpio_direction_output(EN_VDD_1V05_GPIO, 1);
+
+ regulator = regulator_get(NULL, "pex_clk");
+ if (IS_ERR_OR_NULL(regulator))
+ goto err_reg;
+
+ regulator_enable(regulator);
+
tegra_pinmux_set_tristate(TEGRA_PINGROUP_GPV, TEGRA_TRI_NORMAL);
tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXA, TEGRA_TRI_NORMAL);
tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXK, TEGRA_TRI_NORMAL);
@@ -49,9 +65,15 @@ err_pcie:
tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXA, TEGRA_TRI_TRISTATE);
tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXK, TEGRA_TRI_TRISTATE);
+ regulator_disable(regulator);
+ regulator_put(regulator);
+err_reg:
+ gpio_free(EN_VDD_1V05_GPIO);
+
return err;
}
-subsys_initcall(harmony_pcie_init);
+/* PCI should be initialized after I2C, mfd and regulators */
+subsys_initcall_sync(harmony_pcie_init);
#endif