[RFC 2/7][PATCH] AMBA DMA: Implement /proc/dma for arm DMA

[RFC 2/7][PATCH] AMBA DMA: Implement /proc/dma for arm DMA

Post by Peter Pear » Tue, 31 Oct 2006 21:10:12


Adds the necessary functions to arch/arm/kernel/dma.c.

Signed-off-by: Peter M Pearse < XXXX@XXXXX.COM >

---
diff -purN arm_amba/arch/arm/kernel/dma.c
arm_amba_proc_dma/arch/arm/kernel/dma.c
--- arm_amba/arch/arm/kernel/dma.c 2006-10-17 13:28:37.000000000 +0100
+++ arm_amba_proc_dma/arch/arm/kernel/dma.c 2006-10-17
17:05:21.000000000 +0100
@@ -15,6 +15,7 @@
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/errno.h>
+#include <linux/proc_fs.h>

#include <asm/dma.h>

@@ -258,6 +259,47 @@ int get_dma_residue(dmach_t channel)
}
EXPORT_SYMBOL(get_dma_residue);

+#ifdef CONFIG_PROC_FS
+static int proc_dma_show(struct seq_file *m, void *v)
+{
+ int i;
+
+ for (i = 0 ; i < MAX_DMA_CHANNELS ; i++) {
+ if (dma_chan[i].lock) {
+ seq_printf(m, "%2d: %14s %s\n", i,
+ dma_chan[i].d_ops->type,
dma_chan[i].device_id);
+ }
+ }
+ return 0;
+}
+static int proc_dma_open(struct inode *inode, struct file *file)
+{
+ return single_open(file, proc_dma_show, NULL);
+}
+
+static struct file_operations proc_dma_operations = {
+ .open = proc_dma_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = single_release,
+};
+
+static int __init proc_dma_init(void)
+{
+ if(MAX_DMA_CHANNELS > 0){
+ struct proc_dir_entry *e;
+
+ e = create_proc_entry("dma", 0, NULL);
+ if (e)
+ e->proc_fops = &proc_dma_operations;
+ }
+ return 0;
+}
+
+__initcall(proc_dma_init);
+
+#endif
+
static int __init init_dma(void)
{
arch_dma_init(dma_chan);



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/
 
 
 

1. [RFC 4/7][PATCH] AMBA DMA: Add a driver module for the DMA controller.

2. [RFC 4/7][PATCH] AMBA DMA: Add a driver module for the DMA controller.


this looks very very wrong to me.
It's racey for one, and for another, module names sound wrong. You want
to be using the symbol it provides instead, and then use __symbol_get()
and friends...

--
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
Test the interaction between Linux and your BIOS via http://www.yqcomputer.com/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/

3. [PATCH 1/8] ARM i.MX dma: implement wrapper for dma functions

4. [RFC 1/7][PATCH] AMBA DMA: Provide drivers/amba/Kconfig.

5. [RFC 0/7][PATCH] AMBA DMA: Request for comments.

6. [RFC 5/7][PATCH] AMBA DMA: Check the result of a probe of the pl080.

7. [PATCH] DMA: TXx9 Soc DMA Controller driver (v2)

8. DMA mapping (was [PATCH] cciss 2.6; replaces DMA masks with kernel defines)

9. [PATCH] dmaengine: sh: Add support DMA-Engine driver for DMA of SuperH

10. [PATCH] DMA: TXx9 Soc DMA Controller driver (v3)

11. [PATCH] dma-mapping-broken.h: flesh-out DMA API stubs

12. DMA mapping (was [PATCH] cciss 2.6; replaces DMA masks with kernel defines)

13. [PATCH] dmaengine: sh: Add support DMA-Engine driver for DMA of SuperH

14. [PATCH] Match DMA blacklist entries between ide-dma.c and libata-core.c

15. [PATCH] dma : EG20T PCH: Fix miss-setting DMA descriptor