Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Feng Tang and committed by
Greg Kroah-Hartman
f023eab3 085a4f75

+11
+11
drivers/tty/serial/mfd.c
··· 47 47 #define mfd_readl(obj, offset) readl(obj->reg + offset) 48 48 #define mfd_writel(obj, offset, val) writel(val, obj->reg + offset) 49 49 50 + static int hsu_dma_enable; 51 + module_param(hsu_dma_enable, int, 0); 52 + MODULE_PARM_DESC(hsu_dma_enable, "It is a bitmap to set working mode, if \ 53 + bit[x] is 1, then port[x] will work in DMA mode, otherwise in PIO mode."); 54 + 50 55 struct hsu_dma_buffer { 51 56 u8 *buf; 52 57 dma_addr_t dma_addr; ··· 1372 1367 1373 1368 serial_hsu_ports[i] = uport; 1374 1369 uport->index = i; 1370 + 1371 + if (hsu_dma_enable & (1<<i)) 1372 + uport->use_dma = 1; 1373 + else 1374 + uport->use_dma = 0; 1375 + 1375 1376 uport++; 1376 1377 } 1377 1378