diff options
author | Tom Rini <trini@ti.com> | 2014-06-24 00:06:29 +0400 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2014-07-25 23:21:06 +0400 |
commit | 7aa5598aac3faf9188559f7a50940df11c30b656 (patch) | |
tree | b999a41c246d9a5ef10ede31b233fb195a0a2ea1 /drivers/power | |
parent | 5c44dd6bbd42775a93b9938510d398f0e26dbcc2 (diff) | |
download | u-boot-7aa5598aac3faf9188559f7a50940df11c30b656.tar.xz |
tps65218/am43xx_evm: Add power framework support to TPS65218
Add in an init function for the drivers/power framework so we can dump
and read the registers via i2c.
Cc: Ćukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/pmic/pmic_tps65218.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/power/pmic/pmic_tps65218.c b/drivers/power/pmic/pmic_tps65218.c index 0952456379..dbc7a73a72 100644 --- a/drivers/power/pmic/pmic_tps65218.c +++ b/drivers/power/pmic/pmic_tps65218.c @@ -7,6 +7,8 @@ #include <common.h> #include <i2c.h> +#include <asm/errno.h> +#include <power/pmic.h> #include <power/tps65218.h> /** @@ -95,3 +97,23 @@ int tps65218_voltage_update(uchar dc_cntrl_reg, uchar volt_sel) return 0; } + +int power_tps65218_init(unsigned char bus) +{ + static const char name[] = "TPS65218_PMIC"; + struct pmic *p = pmic_alloc(); + + if (!p) { + printf("%s: POWER allocation error!\n", __func__); + return -ENOMEM; + } + + p->name = name; + p->interface = PMIC_I2C; + p->number_of_regs = TPS65218_PMIC_NUM_OF_REGS; + p->hw.i2c.addr = TPS65218_CHIP_PM; + p->hw.i2c.tx_num = 1; + p->bus = bus; + + return 0; +} |