]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
lm75: Make the LM75 MULTI_BUS compatible.
authorHeiko Schocher <hs@denx.de>
Wed, 15 Oct 2008 07:37:34 +0000 (09:37 +0200)
committerWolfgang Denk <wd@denx.de>
Sat, 18 Oct 2008 19:54:01 +0000 (21:54 +0200)
Signed-off-by: Heiko Schocher <hs@denx.de>
drivers/hwmon/lm75.c

index f544ebb772913d68bd98af0482e52e3fafd72a11..17379e53186cd9cf61dd65dd9b6000b4e44f2e80 100644 (file)
@@ -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() */