Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2f6cf7bfc64c44d760d53caf4b547e7729392e78
Commit:     2f6cf7bfc64c44d760d53caf4b547e7729392e78
Parent:     b0a68dc07ec395d44849ce98eb417713ca333410
Author:     Mike Frysinger <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 21 22:59:49 2007 +0800
Committer:  Bryan Wu <[EMAIL PROTECTED]>
CommitDate: Sun Oct 21 22:59:49 2007 +0800

    Blackfin arch: add functions for converting between sclks and usecs
    
    Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]>
    Signed-off-by: Bryan Wu <[EMAIL PROTECTED]>
---
 arch/blackfin/kernel/setup.c       |   14 +++++++++++++-
 include/asm-blackfin/bfin-global.h |    2 ++
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index 6b85145..0e74644 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -459,7 +459,7 @@ static u_long get_vco(void)
        return vco;
 }
 
-/*Get the Core clock*/
+/* Get the Core clock */
 u_long get_cclk(void)
 {
        u_long csel, ssel;
@@ -493,6 +493,18 @@ u_long get_sclk(void)
 }
 EXPORT_SYMBOL(get_sclk);
 
+unsigned long sclk_to_usecs(unsigned long sclk)
+{
+       return (USEC_PER_SEC * (u64)sclk) / get_sclk();
+}
+EXPORT_SYMBOL(sclk_to_usecs);
+
+unsigned long usecs_to_sclk(unsigned long usecs)
+{
+       return get_sclk() / (USEC_PER_SEC * (u64)usecs);
+}
+EXPORT_SYMBOL(usecs_to_sclk);
+
 /*
  *     Get CPU information for use by the procfs.
  */
diff --git a/include/asm-blackfin/bfin-global.h 
b/include/asm-blackfin/bfin-global.h
index a006353..14cb8d3 100644
--- a/include/asm-blackfin/bfin-global.h
+++ b/include/asm-blackfin/bfin-global.h
@@ -47,6 +47,8 @@
 
 extern unsigned long get_cclk(void);
 extern unsigned long get_sclk(void);
+extern unsigned long sclk_to_usecs(unsigned long sclk);
+extern unsigned long usecs_to_sclk(unsigned long usecs);
 
 extern void dump_thread(struct pt_regs *regs, struct user *dump);
 extern void dump_bfin_regs(struct pt_regs *fp, void *retaddr);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to