Hello Kim, Kim Phillips wrote: > On Thu, 19 Feb 2009 17:24:09 +0100 > Heiko Schocher <h...@denx.de> wrote: [...] >> unsigned int i2c_get_bus_num(void) >> { >> +#if defined(CONFIG_I2C_MUX) >> + return i2c_bus_num_mux; >> +#else >> return i2c_bus_num; >> +#endif >> } > > I don't get this mux variant - why aren't we reusing i2c_bus_num in the > mux case?
Because i2c_bus_num is used as an index which hardware i2c controller is used (0 or 1). In CONFIG_I2C_MUX case, you have more than 2 i2c busses -> i2c_bus_num would be greater than 1, so you must have a variable, where you store which hardware adapter you use, and one which stores on which i2c bus you are. bye Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot