From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Warren Date: Wed, 30 Jan 2008 11:33:56 -0500 Subject: [U-Boot-Users] MPC8xx I2C Message-ID: <47A0A6F4.4010402@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, I'm trying to rationalize some very common I2C code and came across the following: Every controller except cpu/mpc8xx implements functions like this: --- uchar i2c_reg_read(uchar i2c_addr, uchar reg) { uchar buf; i2c_read(i2c_addr, reg, 1, &buf, 1); return buf; } void i2c_reg_write(uchar i2c_addr, uchar reg, uchar val) { i2c_write(i2c_addr, reg, 1, &val, 1); } --- cpu/mpc8xx, however, adds i2c_init() calls: --- uchar i2c_reg_read(uchar i2c_addr, uchar reg) { uchar buf; i2c_init(CFG_I2C_SPEED, CFG_I2C_SLAVE); i2c_read(i2c_addr, reg, 1, &buf, 1); return (buf); } void i2c_reg_write(uchar i2c_addr, uchar reg, uchar val) { i2c_init(CFG_I2C_SPEED, CFG_I2C_SLAVE); i2c_write(i2c_addr, reg, 1, &val, 1); } --- Can somebody lend historical perspective as to why these i2c_init() calls are needed? thanks, Ben