From: Kim Phillips Date: Mon, 16 Feb 2009 19:36:14 -0600 Subject: [U-Boot] [PATCH 03/12] 83xx, kmeter1: add I2C, dtt, eeprom support In-Reply-To: <4993182D.2030003@denx.de> References: <4993182D.2030003@denx.de> Message-ID: <20090216193614.1fe95a7e.kim.phillips@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 11 Feb 2009 19:25:49 +0100 Heiko Schocher wrote: > diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c > index 8119821..ecfc345 100644 > --- a/drivers/hwmon/lm75.c > +++ b/drivers/hwmon/lm75.c > @@ -42,6 +42,8 @@ > #define DTT_TEMP_HYST 0x2 > #define DTT_TEMP_SET 0x3 > > +DECLARE_GLOBAL_DATA_PTR; > + > int dtt_read(int sensor, int reg) > { > int dlen; > @@ -157,7 +159,17 @@ int dtt_init (void) > > /* switch to correct I2C bus */ > old_bus = I2C_GET_BUS(); > - I2C_SET_BUS(CONFIG_SYS_DTT_BUS_NUM); > + if ((gd->flags & GD_FLG_RELOC) != GD_FLG_RELOC) { > + uchar *tmp = (uchar *)getenv("dtt_bus"); sorry Heiko, I should have asked you before: this is a hardcoded environment variable in driver code, does the dtt bus value change between boots? If not, what's the reason the value isn't specified as a CONFIG_SYS_DTT_BUS_NUM? > + if (tmp == NULL) > + printf("FAILED: dtt_bus not defined\n"); > + else { > + if (i2c_mux_ident_muxstring_f(tmp)) > + printf("FAILED: couldnt switch to bus\n"); > + } btw, these braces unnecessary. Kim