diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-01 20:28:31 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-01 20:28:31 -0500 |
commit | 132a69c6cc3dfa7fa354a88128acee7e6ee7082b (patch) | |
tree | be77ed97c9c94cbcc9931c58ce1a061e9dc26755 /include/asm-sparc64/parport.h | |
parent | fb7d4045669b3ea0e92cf45963839a9808b7650c (diff) | |
parent | 74bd7d093b8e87f35eaf3b14459b96a0e20d1d10 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
[SPARC64]: Fix parport_pc build.
[SPARC64]: Update defconfig.
Diffstat (limited to 'include/asm-sparc64/parport.h')
-rw-r--r-- | include/asm-sparc64/parport.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/asm-sparc64/parport.h b/include/asm-sparc64/parport.h index d3895873e4c7..be9509c8f8c1 100644 --- a/include/asm-sparc64/parport.h +++ b/include/asm-sparc64/parport.h | |||
@@ -23,8 +23,30 @@ static struct sparc_ebus_info { | |||
23 | struct ebus_dma_info info; | 23 | struct ebus_dma_info info; |
24 | unsigned int addr; | 24 | unsigned int addr; |
25 | unsigned int count; | 25 | unsigned int count; |
26 | int lock; | ||
26 | } sparc_ebus_dmas[PARPORT_PC_MAX_PORTS]; | 27 | } sparc_ebus_dmas[PARPORT_PC_MAX_PORTS]; |
27 | 28 | ||
29 | static __inline__ int request_dma(unsigned int dmanr, const char *device_id) | ||
30 | { | ||
31 | if (dmanr >= PARPORT_PC_MAX_PORTS) | ||
32 | return -EINVAL; | ||
33 | if (xchg(&sparc_ebus_dmas[dmanr].lock, 1) != 0) | ||
34 | return -EBUSY; | ||
35 | return 0; | ||
36 | } | ||
37 | |||
38 | static __inline__ void free_dma(unsigned int dmanr) | ||
39 | { | ||
40 | if (dmanr >= PARPORT_PC_MAX_PORTS) { | ||
41 | printk(KERN_WARNING "Trying to free DMA%d\n", dmanr); | ||
42 | return; | ||
43 | } | ||
44 | if (xchg(&sparc_ebus_dmas[dmanr].lock, 0) == 0) { | ||
45 | printk(KERN_WARNING "Trying to free free DMA%d\n", dmanr); | ||
46 | return; | ||
47 | } | ||
48 | } | ||
49 | |||
28 | static __inline__ void enable_dma(unsigned int dmanr) | 50 | static __inline__ void enable_dma(unsigned int dmanr) |
29 | { | 51 | { |
30 | ebus_dma_enable(&sparc_ebus_dmas[dmanr].info, 1); | 52 | ebus_dma_enable(&sparc_ebus_dmas[dmanr].info, 1); |