aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra/board-harmony-power.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-tegra/board-harmony-power.c')
-rw-r--r--arch/arm/mach-tegra/board-harmony-power.c25
1 files changed, 24 insertions, 1 deletions
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
111int __init harmony_regulator_init(void) 115int __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}