aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra/include/mach/delay.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-tegra/include/mach/delay.h')
-rw-r--r--arch/arm/mach-tegra/include/mach/delay.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/include/mach/delay.h b/arch/arm/mach-tegra/include/mach/delay.h
new file mode 100644
index 00000000000..2defb7b9b65
--- /dev/null
+++ b/arch/arm/mach-tegra/include/mach/delay.h
@@ -0,0 +1,41 @@
1/*
2 * arch/arm/mach-tegra/include/mach/delay.h
3 *
4 * Copyright (C) 2010 Google, Inc.
5 *
6 * Author:
7 * Colin Cross <ccross@google.com>
8 *
9 * This software is licensed under the terms of the GNU General Public
10 * License version 2, as published by the Free Software Foundation, and
11 * may be copied, distributed, and modified under those terms.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 */
19#ifndef __MACH_TEGRA_DELAY_H
20#define __MACH_TEGRA_DELAY_H
21
22/* needed by loops_per_jiffy calculations */
23extern void __delay(int loops);
24
25extern void __udelay(unsigned long usecs);
26extern void __const_udelay(unsigned long usecs);
27
28/* we don't have any restrictions on maximum udelay length, but we'll enforce
29 * the same restriction as the ARM default so we don't introduce any
30 * incompatibilties in drivers.
31 */
32extern void __bad_udelay(void);
33
34#define MAX_UDELAY_MS 2
35
36#define udelay(n) \
37 ((__builtin_constant_p(n) && (n) > (MAX_UDELAY_MS * 1000)) ? \
38 __bad_udelay() : \
39 __udelay(n))
40
41#endif /* defined(__MACH_TEGRA_DELAY_H) */