diff options
author | wdenk <wdenk> | 2003-10-15 23:53:47 +0000 |
---|---|---|
committer | wdenk <wdenk> | 2003-10-15 23:53:47 +0000 |
commit | 42d1f0394bef0624fc9664714d54bb137931d6a6 (patch) | |
tree | 892a4130507484d25faf9a72e019cf88cfb3e3d9 /cpu/mpc5xxx/i2c.c | |
parent | 2d5b561e2bfdee8552a99b2cf93016cce2a74895 (diff) |
* Patches by Xianghua Xiao, 15 Oct 2003:LABEL_2003_10_16_0200
- Added Motorola CPU 8540/8560 support (cpu/85xx)
- Added Motorola MPC8540ADS board support (board/mpc8540ads)
- Added Motorola MPC8560ADS board support (board/mpc8560ads)
* Minor code cleanup
Diffstat (limited to 'cpu/mpc5xxx/i2c.c')
-rw-r--r-- | cpu/mpc5xxx/i2c.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/cpu/mpc5xxx/i2c.c b/cpu/mpc5xxx/i2c.c index 74a610f940a..ea37fb0e68d 100644 --- a/cpu/mpc5xxx/i2c.c +++ b/cpu/mpc5xxx/i2c.c @@ -133,13 +133,13 @@ static int do_address(uchar chip, char rdwr_flag) mpc_reg_out(®s->mcr, I2C_TX, I2C_TX); mpc_reg_out(®s->mdr, chip, 0); - if (wait_for_pin(&status)) { - return -2; - } + if (wait_for_pin(&status)) { + return -2; + } - if (status & I2C_RXAK) { - return -3; - } + if (status & I2C_RXAK) { + return -3; + } return 0; } @@ -250,7 +250,7 @@ static int mpc_get_fdr(int speed) ipb = gd->ipb_clk; for (i = 7; i >= 0; i--) { for (j = 7; j >= 0; j--) { - scl = 2 * (scltap[j].scl2tap + + scl = 2 * (scltap[j].scl2tap + (SCL_Tap[i] - 1) * scltap[j].tap2tap + 2); if (ipb <= speed*scl) { if ((speed*scl - ipb) < bestmatch) { @@ -344,13 +344,13 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len) xaddr[2] = (addr >> 8) & 0xFF; xaddr[3] = addr & 0xFF; - if (wait_for_bb()) { + if (wait_for_bb()) { printf("i2c_write: bus is busy\n"); goto Done; } - mpc_reg_out(®s->mcr, I2C_STA, I2C_STA); - if (do_address(chip, 0)) { + mpc_reg_out(®s->mcr, I2C_STA, I2C_STA); + if (do_address(chip, 0)) { printf("i2c_write: failed to address chip\n"); goto Done; } |