aboutsummaryrefslogtreecommitdiff
path: root/board/evb64260
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2011-11-17 07:57:20 +0100
committerWolfgang Denk <wd@denx.de>2011-11-23 21:22:32 +0100
commit7d5ff54fde6a22c36e4b7e0a039971b279bf21c6 (patch)
tree001d8beb0dfdf90d61b3fe214b0b3e83b5cd496d /board/evb64260
parent3dab3e0e6785efad54e5919d3b30fb99a6e6402e (diff)
downloadu-boot-linaro-stable-7d5ff54fde6a22c36e4b7e0a039971b279bf21c6.tar.gz
i2c: Codingstyle cleanup for i2c evb64260 board driver
There are some magic constants in this drivers, which I cannot fixup ... Eran, can you help here? Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Eran Man <eran@nbase.co.il>
Diffstat (limited to 'board/evb64260')
-rw-r--r--board/evb64260/i2c.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/board/evb64260/i2c.c b/board/evb64260/i2c.c
index 3eae3d903..8119fced4 100644
--- a/board/evb64260/i2c.c
+++ b/board/evb64260/i2c.c
@@ -20,25 +20,25 @@ static void
i2c_init(int speed, int slaveaddr)
{
unsigned int n, m, freq, margin, power;
- unsigned int actualN = 0, actualM = 0;
+ unsigned int actualn = 0, actualm = 0;
unsigned int control, status;
- unsigned int minMargin = 0xffffffff;
+ unsigned int minmargin = 0xffffffff;
unsigned int tclk = 125000000;
DP(puts("i2c_init\n"));
for (n = 0 ; n < 8 ; n++) {
for (m = 0 ; m < 16 ; m++) {
- power = 2<<n; /* power = 2^(n+1) */
- freq = tclk/(10*(m+1)*power);
+ power = 2 << n; /* power = 2^(n+1) */
+ freq = tclk / (10 * (m + 1) * power);
if (speed > freq)
margin = speed - freq;
else
margin = freq - speed;
- if (margin < minMargin) {
- minMargin = margin;
- actualN = n;
- actualM = m;
+ if (margin < minmargin) {
+ minmargin = margin;
+ actualn = n;
+ actualm = m;
}
}
}
@@ -55,7 +55,7 @@ i2c_init(int speed, int slaveaddr)
DP(puts("set baudrate\n"));
- GT_REG_WRITE(I2C_STATUS_BAUDE_RATE, (actualM << 3) | actualN);
+ GT_REG_WRITE(I2C_STATUS_BAUDE_RATE, (actualm << 3) | actualn);
GT_REG_WRITE(I2C_CONTROL, (0x1 << 2) | (0x1 << 6));
udelay(I2C_DELAY * 10);
@@ -257,11 +257,11 @@ i2c_read(uchar dev_addr, unsigned int offset, int len, uchar *data,
int ten_bit)
{
uchar status = 0;
- unsigned int i2cFreq = 400000;
+ unsigned int i2cfreq = 400000;
DP(puts("i2c_read\n"));
- i2c_init(i2cFreq, 0);
+ i2c_init(i2cfreq, 0);
status = i2c_start();
@@ -280,7 +280,7 @@ i2c_read(uchar dev_addr, unsigned int offset, int len, uchar *data,
return status;
}
- i2c_init(i2cFreq, 0);
+ i2c_init(i2cfreq, 0);
status = i2c_start();
if (status) {