* Patches by Xianghua Xiao, 15 Oct 2003:
- 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
diff --git a/cpu/mpc5xxx/i2c.c b/cpu/mpc5xxx/i2c.c
index 74a610f..ea37fb0 100644
--- a/cpu/mpc5xxx/i2c.c
+++ b/cpu/mpc5xxx/i2c.c
@@ -133,13 +133,13 @@
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 @@
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 @@
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;
}