[U-Boot] [PATCH v3 05/12] power: fix pmic command

Piotr Wilczek p.wilczek at samsung.com
Fri May 17 14:55:48 CEST 2013


This patch fix automatic i2c bus change when calling subsequent
'pmic' command on diffrent devices connected to separete i2c bus.

Signed-off-by: Piotr Wilczek <p.wilczek at samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
CC: Lukasz Majewski <l.majewski at samsung.com>

---
Changes in v3:
- use i2c_set_bus_num() instead I2C_SET_BUS maro
That macro should be completly replaced when all i2c drivers
 are adapted to new i2c framework

Changes in v2:
- new patch

 drivers/power/power_core.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/power/power_core.c b/drivers/power/power_core.c
index 90df2c5..befd458 100644
--- a/drivers/power/power_core.c
+++ b/drivers/power/power_core.c
@@ -164,6 +164,14 @@ int do_pmic(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	if (!p)
 		return CMD_RET_FAILURE;
 
+	/* this #ifdef should go away when all i2c drivers */
+	/* are adapted to the new i2c framework */
+#ifdef CONFIG_SYS_I2C
+	i2c_set_bus_num(p->bus);
+#else
+	I2C_SET_BUS(p->bus);
+#endif
+
 	if (strcmp(cmd, "dump") == 0) {
 		if (pmic_dump(p))
 			return CMD_RET_FAILURE;
-- 
1.7.9.5



More information about the U-Boot mailing list