diff options
-rw-r--r-- | arch/arm/mach-tegra/board-dt-tegra20.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-harmony-pcie.c | 15 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-harmony-power.c | 25 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board.h | 7 |
4 files changed, 61 insertions, 6 deletions
diff --git a/arch/arm/mach-tegra/board-dt-tegra20.c b/arch/arm/mach-tegra/board-dt-tegra20.c index 9537f20384fc..777138611c77 100644 --- a/arch/arm/mach-tegra/board-dt-tegra20.c +++ b/arch/arm/mach-tegra/board-dt-tegra20.c | |||
@@ -109,6 +109,23 @@ static void __init trimslice_init(void) | |||
109 | } | 109 | } |
110 | #endif | 110 | #endif |
111 | 111 | ||
112 | #ifdef CONFIG_MACH_HARMONY | ||
113 | static void __init harmony_init(void) | ||
114 | { | ||
115 | int ret; | ||
116 | |||
117 | ret = harmony_regulator_init(); | ||
118 | if (ret) { | ||
119 | pr_err("harmony_regulator_init() failed: %d\n", ret); | ||
120 | return; | ||
121 | } | ||
122 | |||
123 | ret = harmony_pcie_init(); | ||
124 | if (ret) | ||
125 | pr_err("harmony_pcie_init() failed: %d\n", ret); | ||
126 | } | ||
127 | #endif | ||
128 | |||
112 | static struct { | 129 | static struct { |
113 | char *machine; | 130 | char *machine; |
114 | void (*init)(void); | 131 | void (*init)(void); |
@@ -116,6 +133,9 @@ static struct { | |||
116 | #ifdef CONFIG_MACH_TRIMSLICE | 133 | #ifdef CONFIG_MACH_TRIMSLICE |
117 | { "compulab,trimslice", trimslice_init }, | 134 | { "compulab,trimslice", trimslice_init }, |
118 | #endif | 135 | #endif |
136 | #ifdef CONFIG_MACH_HARMONY | ||
137 | { "nvidia,harmony", harmony_init }, | ||
138 | #endif | ||
119 | }; | 139 | }; |
120 | 140 | ||
121 | static void __init tegra_dt_init_late(void) | 141 | static void __init tegra_dt_init_late(void) |
diff --git a/arch/arm/mach-tegra/board-harmony-pcie.c b/arch/arm/mach-tegra/board-harmony-pcie.c index 33c4fedab840..e8c3fda9bec2 100644 --- a/arch/arm/mach-tegra/board-harmony-pcie.c +++ b/arch/arm/mach-tegra/board-harmony-pcie.c | |||
@@ -27,14 +27,11 @@ | |||
27 | 27 | ||
28 | #ifdef CONFIG_TEGRA_PCI | 28 | #ifdef CONFIG_TEGRA_PCI |
29 | 29 | ||
30 | static int __init harmony_pcie_init(void) | 30 | int __init harmony_pcie_init(void) |
31 | { | 31 | { |
32 | struct regulator *regulator = NULL; | 32 | struct regulator *regulator = NULL; |
33 | int err; | 33 | int err; |
34 | 34 | ||
35 | if (!machine_is_harmony()) | ||
36 | return 0; | ||
37 | |||
38 | err = gpio_request(TEGRA_GPIO_EN_VDD_1V05_GPIO, "EN_VDD_1V05"); | 35 | err = gpio_request(TEGRA_GPIO_EN_VDD_1V05_GPIO, "EN_VDD_1V05"); |
39 | if (err) | 36 | if (err) |
40 | return err; | 37 | return err; |
@@ -62,7 +59,15 @@ err_reg: | |||
62 | return err; | 59 | return err; |
63 | } | 60 | } |
64 | 61 | ||
62 | static int __init harmony_pcie_initcall(void) | ||
63 | { | ||
64 | if (!machine_is_harmony()) | ||
65 | return 0; | ||
66 | |||
67 | return harmony_pcie_init(); | ||
68 | } | ||
69 | |||
65 | /* PCI should be initialized after I2C, mfd and regulators */ | 70 | /* PCI should be initialized after I2C, mfd and regulators */ |
66 | subsys_initcall_sync(harmony_pcie_init); | 71 | subsys_initcall_sync(harmony_pcie_initcall); |
67 | 72 | ||
68 | #endif | 73 | #endif |
diff --git a/arch/arm/mach-tegra/board-harmony-power.c b/arch/arm/mach-tegra/board-harmony-power.c index 82f32300796c..44dcb2e869b5 100644 --- a/arch/arm/mach-tegra/board-harmony-power.c +++ b/arch/arm/mach-tegra/board-harmony-power.c | |||
@@ -20,6 +20,10 @@ | |||
20 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
21 | #include <linux/regulator/machine.h> | 21 | #include <linux/regulator/machine.h> |
22 | #include <linux/mfd/tps6586x.h> | 22 | #include <linux/mfd/tps6586x.h> |
23 | #include <linux/of.h> | ||
24 | #include <linux/of_i2c.h> | ||
25 | |||
26 | #include <asm/mach-types.h> | ||
23 | 27 | ||
24 | #include <mach/irqs.h> | 28 | #include <mach/irqs.h> |
25 | 29 | ||
@@ -110,7 +114,26 @@ static struct i2c_board_info __initdata harmony_regulators[] = { | |||
110 | 114 | ||
111 | int __init harmony_regulator_init(void) | 115 | int __init harmony_regulator_init(void) |
112 | { | 116 | { |
113 | i2c_register_board_info(3, harmony_regulators, 1); | 117 | if (machine_is_harmony()) { |
118 | i2c_register_board_info(3, harmony_regulators, 1); | ||
119 | } else { /* Harmony, booted using device tree */ | ||
120 | struct device_node *np; | ||
121 | struct i2c_adapter *adapter; | ||
122 | |||
123 | np = of_find_node_by_path("/i2c@7000d000"); | ||
124 | if (np == NULL) { | ||
125 | pr_err("Could not find device_node for DVC I2C\n"); | ||
126 | return -ENODEV; | ||
127 | } | ||
128 | |||
129 | adapter = of_find_i2c_adapter_by_node(np); | ||
130 | if (!adapter) { | ||
131 | pr_err("Could not find i2c_adapter for DVC I2C\n"); | ||
132 | return -ENODEV; | ||
133 | } | ||
134 | |||
135 | i2c_new_device(adapter, harmony_regulators); | ||
136 | } | ||
114 | 137 | ||
115 | return 0; | 138 | return 0; |
116 | } | 139 | } |
diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h index 65014968fc6c..097e0e16eacd 100644 --- a/arch/arm/mach-tegra/board.h +++ b/arch/arm/mach-tegra/board.h | |||
@@ -46,5 +46,12 @@ int __init tegra_powergate_debugfs_init(void); | |||
46 | static inline int tegra_powergate_debugfs_init(void) { return 0; } | 46 | static inline int tegra_powergate_debugfs_init(void) { return 0; } |
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | int __init harmony_regulator_init(void); | ||
50 | #ifdef CONFIG_TEGRA_PCI | ||
51 | int __init harmony_pcie_init(void); | ||
52 | #else | ||
53 | static inline int harmony_pcie_init(void) { return 0; } | ||
54 | #endif | ||
55 | |||
49 | extern struct sys_timer tegra_timer; | 56 | extern struct sys_timer tegra_timer; |
50 | #endif | 57 | #endif |