summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/tegra20-common/pmu.c
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2014-12-11 20:47:34 -0500
committerTom Rini <trini@ti.com>2014-12-11 20:47:34 -0500
commita5a58826110eb3da2956c6b3213bd750e166d75c (patch)
tree50d21157a7118c6b2b13e7763452332f2d9b51fd /arch/arm/cpu/tegra20-common/pmu.c
parentfc9b0b80435cda721fbdbe507c9e4f388b0ea62b (diff)
parentb0e6ef46405353270595ffa35c21f4334c541189 (diff)
downloadu-boot-imx-a5a58826110eb3da2956c6b3213bd750e166d75c.zip
u-boot-imx-a5a58826110eb3da2956c6b3213bd750e166d75c.tar.gz
u-boot-imx-a5a58826110eb3da2956c6b3213bd750e166d75c.tar.bz2
Merge git://git.denx.de/u-boot-dm
Diffstat (limited to 'arch/arm/cpu/tegra20-common/pmu.c')
-rw-r--r--arch/arm/cpu/tegra20-common/pmu.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/arch/arm/cpu/tegra20-common/pmu.c b/arch/arm/cpu/tegra20-common/pmu.c
index c595f70..36a76a2 100644
--- a/arch/arm/cpu/tegra20-common/pmu.c
+++ b/arch/arm/cpu/tegra20-common/pmu.c
@@ -6,6 +6,7 @@
*/
#include <common.h>
+#include <i2c.h>
#include <tps6586x.h>
#include <asm/io.h>
#include <asm/arch/tegra.h>
@@ -23,9 +24,13 @@
#define VDD_TRANSITION_STEP 0x06 /* 150mv */
#define VDD_TRANSITION_RATE 0x06 /* 3.52mv/us */
+#define PMI_I2C_ADDRESS 0x34 /* chip requires this address */
+
int pmu_set_nominal(void)
{
- int core, cpu, bus;
+ struct udevice *bus, *dev;
+ int core, cpu;
+ int ret;
/* by default, the table has been filled with T25 settings */
switch (tegra_get_chip_sku()) {
@@ -42,12 +47,18 @@ int pmu_set_nominal(void)
return -1;
}
- bus = tegra_i2c_get_dvc_bus_num();
- if (bus == -1) {
+ ret = tegra_i2c_get_dvc_bus(&bus);
+ if (ret) {
debug("%s: Cannot find DVC I2C bus\n", __func__);
- return -1;
+ return ret;
}
- tps6586x_init(bus);
+ ret = i2c_get_chip(bus, PMI_I2C_ADDRESS, &dev);
+ if (ret) {
+ debug("%s: Cannot find DVC I2C chip\n", __func__);
+ return ret;
+ }
+
+ tps6586x_init(dev);
tps6586x_set_pwm_mode(TPS6586X_PWM_SM1);
return tps6586x_adjust_sm0_sm1(core, cpu, VDD_TRANSITION_STEP,
VDD_TRANSITION_RATE, VDD_RELATION);