diff options
| -rw-r--r-- | arch/arm/mach-tegra/board-harmony-pcie.c | 24 |
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 @@ | |||
| 27 | 27 | ||
| 28 | #ifdef CONFIG_TEGRA_PCI | 28 | #ifdef CONFIG_TEGRA_PCI |
| 29 | 29 | ||
| 30 | /* GPIO 3 of the PMIC */ | ||
| 31 | #define EN_VDD_1V05_GPIO (TEGRA_NR_GPIOS + 2) | ||
| 32 | |||
| 30 | static int __init harmony_pcie_init(void) | 33 | static int __init harmony_pcie_init(void) |
| 31 | { | 34 | { |
| 35 | struct regulator *regulator = NULL; | ||
| 32 | int err; | 36 | int err; |
| 33 | 37 | ||
| 34 | if (!machine_is_harmony()) | 38 | if (!machine_is_harmony()) |
| 35 | return 0; | 39 | return 0; |
| 36 | 40 | ||
| 41 | err = gpio_request(EN_VDD_1V05_GPIO, "EN_VDD_1V05"); | ||
| 42 | if (err) | ||
| 43 | return err; | ||
| 44 | |||
| 45 | gpio_direction_output(EN_VDD_1V05_GPIO, 1); | ||
| 46 | |||
| 47 | regulator = regulator_get(NULL, "pex_clk"); | ||
| 48 | if (IS_ERR_OR_NULL(regulator)) | ||
| 49 | goto err_reg; | ||
| 50 | |||
| 51 | regulator_enable(regulator); | ||
| 52 | |||
| 37 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_GPV, TEGRA_TRI_NORMAL); | 53 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_GPV, TEGRA_TRI_NORMAL); |
| 38 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXA, TEGRA_TRI_NORMAL); | 54 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXA, TEGRA_TRI_NORMAL); |
| 39 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXK, TEGRA_TRI_NORMAL); | 55 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXK, TEGRA_TRI_NORMAL); |
| @@ -49,9 +65,15 @@ err_pcie: | |||
| 49 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXA, TEGRA_TRI_TRISTATE); | 65 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXA, TEGRA_TRI_TRISTATE); |
| 50 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXK, TEGRA_TRI_TRISTATE); | 66 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXK, TEGRA_TRI_TRISTATE); |
| 51 | 67 | ||
| 68 | regulator_disable(regulator); | ||
| 69 | regulator_put(regulator); | ||
| 70 | err_reg: | ||
| 71 | gpio_free(EN_VDD_1V05_GPIO); | ||
| 72 | |||
| 52 | return err; | 73 | return err; |
| 53 | } | 74 | } |
| 54 | 75 | ||
| 55 | subsys_initcall(harmony_pcie_init); | 76 | /* PCI should be initialized after I2C, mfd and regulators */ |
| 77 | subsys_initcall_sync(harmony_pcie_init); | ||
| 56 | 78 | ||
| 57 | #endif | 79 | #endif |
