aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64/parport.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-01 17:28:31 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-01 17:28:31 -0800
commit132a69c6cc3dfa7fa354a88128acee7e6ee7082b (patch)
treebe77ed97c9c94cbcc9931c58ce1a061e9dc26755 /include/asm-sparc64/parport.h
parentfb7d4045669b3ea0e92cf45963839a9808b7650c (diff)
parent74bd7d093b8e87f35eaf3b14459b96a0e20d1d10 (diff)
downloadkernel_samsung_smdk4412-132a69c6cc3dfa7fa354a88128acee7e6ee7082b.tar.gz
kernel_samsung_smdk4412-132a69c6cc3dfa7fa354a88128acee7e6ee7082b.tar.bz2
kernel_samsung_smdk4412-132a69c6cc3dfa7fa354a88128acee7e6ee7082b.zip
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.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/asm-sparc64/parport.h b/include/asm-sparc64/parport.h
index d3895873e4c..be9509c8f8c 100644
--- a/include/asm-sparc64/parport.h
+++ b/include/asm-sparc64/parport.h
@@ -23,8 +23,30 @@ static struct sparc_ebus_info {
struct ebus_dma_info info;
unsigned int addr;
unsigned int count;
+ int lock;
} sparc_ebus_dmas[PARPORT_PC_MAX_PORTS];
+static __inline__ int request_dma(unsigned int dmanr, const char *device_id)
+{
+ if (dmanr >= PARPORT_PC_MAX_PORTS)
+ return -EINVAL;
+ if (xchg(&sparc_ebus_dmas[dmanr].lock, 1) != 0)
+ return -EBUSY;
+ return 0;
+}
+
+static __inline__ void free_dma(unsigned int dmanr)
+{
+ if (dmanr >= PARPORT_PC_MAX_PORTS) {
+ printk(KERN_WARNING "Trying to free DMA%d\n", dmanr);
+ return;
+ }
+ if (xchg(&sparc_ebus_dmas[dmanr].lock, 0) == 0) {
+ printk(KERN_WARNING "Trying to free free DMA%d\n", dmanr);
+ return;
+ }
+}
+
static __inline__ void enable_dma(unsigned int dmanr)
{
ebus_dma_enable(&sparc_ebus_dmas[dmanr].info, 1);