diff options
author | Stefan Roese <sr@denx.de> | 2007-02-20 10:51:26 +0100 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2007-02-20 10:51:26 +0100 |
commit | 0dc018ece13effc689e47479ea9ebf1c98a507f5 (patch) | |
tree | ee428909979fcf779234fed26f38028cdce40562 /dtt/adm1021.c | |
parent | 4037ed3b63923cfcec27f784a89057c3cbabcedb (diff) |
[PATCH] I2C: Add support for multiple I2C busses for RTC & DTT
This patch switches to the desired I2C bus when the date/dtt
commands are called. This can be configured using the
CFG_RTC_BUS_NUM and/or CFG_DTT_BUS_NUM defines.
Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'dtt/adm1021.c')
-rw-r--r-- | dtt/adm1021.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/dtt/adm1021.c b/dtt/adm1021.c index 14c38f0a83d..9f65cfb2740 100644 --- a/dtt/adm1021.c +++ b/dtt/adm1021.c @@ -144,12 +144,15 @@ dtt_init (void) unsigned char sensors[] = CONFIG_DTT_SENSORS; const char *const header = "DTT: "; + /* switch to correct I2C 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); - else - printf ("%s%d is %i C\n", header, i+1, - dtt_get_temp(sensors[i])); + if (_dtt_init(sensors[i]) != 0) + printf ("%s%d FAILED INIT\n", header, i+1); + else + printf ("%s%d is %i C\n", header, i+1, + dtt_get_temp(sensors[i])); } return (0); |