diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2008-12-20 15:25:22 +0100 |
---|---|---|
committer | Nobuhiro Iwamatsu <iwamatsu@nigauri.org> | 2009-01-16 10:22:26 +0900 |
commit | 1e15ff999322e81af4c0c0c548908f38944ba39c (patch) | |
tree | a3bf34b470cb2746b73d18d6b5bac97014b08056 /lib_sh | |
parent | 0e3ece33801e377be67ffa29f083421ad820f28b (diff) | |
download | u-boot-imx-1e15ff999322e81af4c0c0c548908f38944ba39c.zip u-boot-imx-1e15ff999322e81af4c0c0c548908f38944ba39c.tar.gz u-boot-imx-1e15ff999322e81af4c0c0c548908f38944ba39c.tar.bz2 |
sh: update sh timer coding style
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Diffstat (limited to 'lib_sh')
-rw-r--r-- | lib_sh/time.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lib_sh/time.c b/lib_sh/time.c index 2bd7715..8fccce3 100644 --- a/lib_sh/time.c +++ b/lib_sh/time.c @@ -49,21 +49,21 @@ int timer_init (void) { /* Divide clock by TMU_CLK_DIVIDER */ u16 bit = 0; - switch( TMU_CLK_DIVIDER ){ - case 4: - bit = 0; - break; - case 16: - bit = 1; - break; - case 64: bit = 2; + + switch (TMU_CLK_DIVIDER) { + case 1024: + bit = 4; break; case 256: bit = 3; break; - case 1024: - bit = 4; + case 64: + bit = 2; break; + case 16: + bit = 1; + break; + case 4: default: bit = 0; break; @@ -71,7 +71,7 @@ int timer_init (void) writew(readw(TCR0) | bit, TCR0); /* Clock adjustment calc */ - clk_adj = (int)(1.0/((1.0/CONFIG_SYS_HZ)*1000000)); + clk_adj = (int)(1.0 / ((1.0 / CONFIG_SYS_HZ) * 1000000)); if (clk_adj < 1) clk_adj = 1; @@ -102,8 +102,8 @@ void udelay (unsigned long usec) unsigned long get_timer (unsigned long base) { - /* return msec */ - return ((get_usec()/clk_adj)/1000) - base; + /* return msec */ + return ((get_usec() / clk_adj) / 1000) - base; } void set_timer (unsigned long t) |