X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fpower%2Fpower_fsl.c;h=a663831589fdfe05a5756c592cd4ae5fcfc0fd6e;hb=5a34d9bf31a021987f97f20aefa812b97b58584e;hp=651f88f850a0690bc26f15693051ddfee31e16f2;hpb=be3b51aa4a450f3e3fcd9c6e5074ef435812a02d;p=u-boot diff --git a/drivers/power/power_fsl.c b/drivers/power/power_fsl.c index 651f88f850..a663831589 100644 --- a/drivers/power/power_fsl.c +++ b/drivers/power/power_fsl.c @@ -27,6 +27,12 @@ #include #include +#if defined(CONFIG_PMIC_FSL_MC13892) +#define FSL_PMIC_I2C_LENGTH 3 +#elif defined(CONFIG_PMIC_FSL_MC34704) +#define FSL_PMIC_I2C_LENGTH 1 +#endif + #if defined(CONFIG_POWER_SPI) static u32 pmic_spi_prepare_tx(u32 reg, u32 *val, u32 write) { @@ -59,7 +65,7 @@ int pmic_init(unsigned char bus) #elif defined(CONFIG_POWER_I2C) p->interface = PMIC_I2C; p->hw.i2c.addr = CONFIG_SYS_FSL_PMIC_I2C_ADDR; - p->hw.i2c.tx_num = 3; + p->hw.i2c.tx_num = FSL_PMIC_I2C_LENGTH; p->bus = bus; #else #error "You must select CONFIG_POWER_SPI or CONFIG_PMIC_I2C"