Skip to contentSkip to conversation

lm75: Make the LM75 MULTI_BUS compatible.

PATCH New Heiko Schocher 1 participant 1 message Oct 15, 2008 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH v2 9/16 lm75: Make the LM75 MULTI_BUS compatible.

---
 drivers/hwmon/lm75.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
drivers/hwmon/lm75.c +6 -0
index f544ebb..17379e5 100644
@@ -155,6 +155,10 @@ int dtt_init (void)
 	const char *const header = "DTT:   ";
 	int old_bus;
 
+	/* switch to correct I2C bus */
+	old_bus = I2C_GET_BUS();
+	I2C_SET_BUS(CFG_DTT_BUS_NUM);
+
 	for (i = 0; i < sizeof(sensors); i++) {
 	if (_dtt_init(sensors[i]) != 0)
 		printf("%s%d FAILED INIT\n", header, i+1);
@@ -162,6 +166,8 @@ int dtt_init (void)
 		printf("%s%d is %i C\n", header, i+1,
 		dtt_get_temp(sensors[i]));
 	}
+	/* switch back to original I2C bus */
+	I2C_SET_BUS(old_bus);
 
 	return (0);
 } /* dtt_init() */
Signature · 5 lines
1.5.6.1

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany