Currently PCA9450 might have address 0x25 or 0x35, so let user
choose the address.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
struct pmic *p;
int ret;
- ret = power_pca9450_init(I2C_PMIC);
+ ret = power_pca9450_init(I2C_PMIC, 0x25);
if (ret)
printf("power init failed");
p = pmic_get("PCA9450");
struct pmic *p;
int ret;
- ret = power_pca9450_init(0);
+ ret = power_pca9450_init(0, 0x25);
if (ret)
printf("power init failed");
p = pmic_get("PCA9450");
static const char pca9450_name[] = "PCA9450";
-int power_pca9450_init(unsigned char bus)
+int power_pca9450_init(unsigned char bus, unsigned char addr)
{
struct pmic *p = pmic_alloc();
p->name = pca9450_name;
p->interface = PMIC_I2C;
p->number_of_regs = PCA9450_REG_NUM;
- p->hw.i2c.addr = 0x25;
+ p->hw.i2c.addr = addr;
p->hw.i2c.tx_num = 1;
p->bus = bus;
PCA9450_REG_NUM,
};
-int power_pca9450_init(unsigned char bus);
+int power_pca9450_init(unsigned char bus, unsigned char addr);
#endif