summary refs log tree commit diff
path: root/drivers/tty/serial/mfd.c
diff options
context:
space:
mode:
authorFeng Tang <feng.tang@intel.com>2011-02-22 15:28:12 +0800
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-22 15:49:00 -0800
commitf023eab379821365bf265a0240f30c00cecaef7c (patch)
tree7c8f5f5b847d4200e346a384412932de151c0529 /drivers/tty/serial/mfd.c
parent085a4f758f0cf95e1865b63892bf4304a149f0ca (diff)
downloadlinux-f023eab379821365bf265a0240f30c00cecaef7c.tar.gz
serial: mfd: add a module parameter for setting each port's working mode
The three identical uart ports can work either in DMA or PIO mode. Adding such
a module parameter "hsu_dma_enable" will enable user to chose working modes for
each port. If the mfd driver is built in kernel, adding a "mfd.hsu_dma_enable=x"
in kernel command line has the same effect.

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/tty/serial/mfd.c')
-rw-r--r--drivers/tty/serial/mfd.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/tty/serial/mfd.c b/drivers/tty/serial/mfd.c
index 53ff6af16273..c111f36f5d21 100644
--- a/drivers/tty/serial/mfd.c
+++ b/drivers/tty/serial/mfd.c
@@ -47,6 +47,11 @@
 #define mfd_readl(obj, offset)		readl(obj->reg + offset)
 #define mfd_writel(obj, offset, val)	writel(val, obj->reg + offset)
 
+static int hsu_dma_enable;
+module_param(hsu_dma_enable, int, 0);
+MODULE_PARM_DESC(hsu_dma_enable, "It is a bitmap to set working mode, if \
+bit[x] is 1, then port[x] will work in DMA mode, otherwise in PIO mode.");
+
 struct hsu_dma_buffer {
 	u8		*buf;
 	dma_addr_t	dma_addr;
@@ -1367,6 +1372,12 @@ static void hsu_global_init(void)
 
 		serial_hsu_ports[i] = uport;
 		uport->index = i;
+
+		if (hsu_dma_enable & (1<<i))
+			uport->use_dma = 1;
+		else
+			uport->use_dma = 0;
+
 		uport++;
 	}