X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fpower%2Fpmic%2Fpmic_tps65218.c;h=dbc7a73a7235eb090efccb350238eebba8f31f3f;hb=151b223b9c4e309d65166558afdfa0ce3c3b3213;hp=095245637995d3f6cf44f35accb468ff1770efd9;hpb=55e8250bd3cfd996d1caa04f520160a89ec04754;p=oweals%2Fu-boot.git 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 #include +#include +#include #include /** @@ -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; +}