Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f6cf7bf authored by Mike Frysinger's avatar Mike Frysinger Committed by Bryan Wu
Browse files

Blackfin arch: add functions for converting between sclks and usecs

parent b0a68dc0
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -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.
 */
+2 −0
Original line number Diff line number Diff line
@@ -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);