diff options
Diffstat (limited to 'arch/arm/mach-netx/pfifo.c')
-rw-r--r-- | arch/arm/mach-netx/pfifo.c | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/arch/arm/mach-netx/pfifo.c b/arch/arm/mach-netx/pfifo.c deleted file mode 100644 index 2e5cc777329f..000000000000 --- a/arch/arm/mach-netx/pfifo.c +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0-only | ||
2 | /* | ||
3 | * arch/arm/mach-netx/pfifo.c | ||
4 | * | ||
5 | * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix | ||
6 | */ | ||
7 | |||
8 | #include <linux/init.h> | ||
9 | #include <linux/module.h> | ||
10 | #include <linux/mutex.h> | ||
11 | #include <linux/io.h> | ||
12 | |||
13 | #include <mach/hardware.h> | ||
14 | #include <mach/netx-regs.h> | ||
15 | #include <mach/pfifo.h> | ||
16 | |||
17 | static DEFINE_MUTEX(pfifo_lock); | ||
18 | |||
19 | static unsigned int pfifo_used = 0; | ||
20 | |||
21 | int pfifo_request(unsigned int pfifo_mask) | ||
22 | { | ||
23 | int err = 0; | ||
24 | unsigned int val; | ||
25 | |||
26 | mutex_lock(&pfifo_lock); | ||
27 | |||
28 | if (pfifo_mask & pfifo_used) { | ||
29 | err = -EBUSY; | ||
30 | goto out; | ||
31 | } | ||
32 | |||
33 | pfifo_used |= pfifo_mask; | ||
34 | |||
35 | val = readl(NETX_PFIFO_RESET); | ||
36 | writel(val | pfifo_mask, NETX_PFIFO_RESET); | ||
37 | writel(val, NETX_PFIFO_RESET); | ||
38 | |||
39 | out: | ||
40 | mutex_unlock(&pfifo_lock); | ||
41 | return err; | ||
42 | } | ||
43 | |||
44 | void pfifo_free(unsigned int pfifo_mask) | ||
45 | { | ||
46 | mutex_lock(&pfifo_lock); | ||
47 | pfifo_used &= ~pfifo_mask; | ||
48 | mutex_unlock(&pfifo_lock); | ||
49 | } | ||
50 | |||
51 | EXPORT_SYMBOL(pfifo_push); | ||
52 | EXPORT_SYMBOL(pfifo_pop); | ||
53 | EXPORT_SYMBOL(pfifo_fill_level); | ||
54 | EXPORT_SYMBOL(pfifo_empty); | ||
55 | EXPORT_SYMBOL(pfifo_request); | ||
56 | EXPORT_SYMBOL(pfifo_free); | ||