[ARM] tegra: spdif/i2s audio: fixes
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-tegra / delay.S
1 /*
2  * arch/arm/mach-tegra/delay.S
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
20 #include <linux/linkage.h>
21 #include <asm/assembler.h>
22 #include <mach/iomap.h>
23 #include <mach/io.h>
24 #include "power-macros.S"
25
26     .text
27
28 ENTRY(__udelay)
29 ENTRY(__const_udelay)
30     mov32 r3, (IO_PPSB_VIRT + TEGRA_TMRUS_BASE - IO_PPSB_PHYS)
31     ldr r1, [r3]
32
33 /* r0 - usecs to wait
34  * r1 - initial value of the counter
35  */
36 loop:
37     ldr r2, [r3]
38     sub r2, r2, r1
39     cmp r2, r0
40     bls loop
41     mov pc, lr
42 ENDPROC(__const_udelay)
43 ENDPROC(__udelay)
44
45
46 @ Delay routine
47 ENTRY(__delay)
48     subs  r0, r0, #1
49     bhi __delay
50     mov pc, lr
51 ENDPROC(__delay)