diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2007-05-01 00:24:54 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2007-05-01 00:24:54 -0400 |
commit | bc95f3669f5e6f63cf0b84fe4922c3c6dd4aa775 (patch) | |
tree | 427fcf2a7287c16d4b5aa6cbf494d59579a6a8b1 /include/asm-sparc64/parport.h | |
parent | 3d29cdff999c37b3876082278a8134a0642a02cd (diff) | |
parent | dc87c3985e9b442c60994308a96f887579addc39 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
drivers/usb/input/Makefile
drivers/usb/input/gtco.c
Diffstat (limited to 'include/asm-sparc64/parport.h')
-rw-r--r-- | include/asm-sparc64/parport.h | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/include/asm-sparc64/parport.h b/include/asm-sparc64/parport.h index d3895873e4c7..6340a5253a34 100644 --- a/include/asm-sparc64/parport.h +++ b/include/asm-sparc64/parport.h | |||
@@ -19,12 +19,45 @@ | |||
19 | */ | 19 | */ |
20 | #define HAS_DMA | 20 | #define HAS_DMA |
21 | 21 | ||
22 | static DEFINE_SPINLOCK(dma_spin_lock); | ||
23 | |||
24 | #define claim_dma_lock() \ | ||
25 | ({ unsigned long flags; \ | ||
26 | spin_lock_irqsave(&dma_spin_lock, flags); \ | ||
27 | flags; \ | ||
28 | }) | ||
29 | |||
30 | #define release_dma_lock(__flags) \ | ||
31 | spin_unlock_irqrestore(&dma_spin_lock, __flags); | ||
32 | |||
22 | static struct sparc_ebus_info { | 33 | static struct sparc_ebus_info { |
23 | struct ebus_dma_info info; | 34 | struct ebus_dma_info info; |
24 | unsigned int addr; | 35 | unsigned int addr; |
25 | unsigned int count; | 36 | unsigned int count; |
37 | int lock; | ||
26 | } sparc_ebus_dmas[PARPORT_PC_MAX_PORTS]; | 38 | } sparc_ebus_dmas[PARPORT_PC_MAX_PORTS]; |
27 | 39 | ||
40 | static __inline__ int request_dma(unsigned int dmanr, const char *device_id) | ||
41 | { | ||
42 | if (dmanr >= PARPORT_PC_MAX_PORTS) | ||
43 | return -EINVAL; | ||
44 | if (xchg(&sparc_ebus_dmas[dmanr].lock, 1) != 0) | ||
45 | return -EBUSY; | ||
46 | return 0; | ||
47 | } | ||
48 | |||
49 | static __inline__ void free_dma(unsigned int dmanr) | ||
50 | { | ||
51 | if (dmanr >= PARPORT_PC_MAX_PORTS) { | ||
52 | printk(KERN_WARNING "Trying to free DMA%d\n", dmanr); | ||
53 | return; | ||
54 | } | ||
55 | if (xchg(&sparc_ebus_dmas[dmanr].lock, 0) == 0) { | ||
56 | printk(KERN_WARNING "Trying to free free DMA%d\n", dmanr); | ||
57 | return; | ||
58 | } | ||
59 | } | ||
60 | |||
28 | static __inline__ void enable_dma(unsigned int dmanr) | 61 | static __inline__ void enable_dma(unsigned int dmanr) |
29 | { | 62 | { |
30 | ebus_dma_enable(&sparc_ebus_dmas[dmanr].info, 1); | 63 | ebus_dma_enable(&sparc_ebus_dmas[dmanr].info, 1); |
@@ -70,7 +103,7 @@ static int ebus_ecpp_p(struct linux_ebus_device *edev) | |||
70 | if (!strcmp(edev->prom_node->name, "ecpp")) | 103 | if (!strcmp(edev->prom_node->name, "ecpp")) |
71 | return 1; | 104 | return 1; |
72 | if (!strcmp(edev->prom_node->name, "parallel")) { | 105 | if (!strcmp(edev->prom_node->name, "parallel")) { |
73 | char *compat; | 106 | const char *compat; |
74 | 107 | ||
75 | compat = of_get_property(edev->prom_node, | 108 | compat = of_get_property(edev->prom_node, |
76 | "compatible", NULL); | 109 | "compatible", NULL); |