linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Feng Tang <feng.tang@intel.com>
To: linux-serial@vger.kernel.org, greg@kroah.com, alan@linux.intel.com
Cc: chiau.ee.chew@intel.com, Feng Tang <feng.tang@intel.com>
Subject: [PATCH 2/2] serial: mfd: add a module parameter for setting each port's working mode
Date: Tue, 22 Feb 2011 15:28:12 +0800	[thread overview]
Message-ID: <1298359692-9182-1-git-send-email-feng.tang@intel.com> (raw)

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>
---
 drivers/tty/serial/mfd.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/tty/serial/mfd.c b/drivers/tty/serial/mfd.c
index 53ff6af..c111f36 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++;
 	}
 
-- 
1.7.0.4


                 reply	other threads:[~2011-02-22  7:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1298359692-9182-1-git-send-email-feng.tang@intel.com \
    --to=feng.tang@intel.com \
    --cc=alan@linux.intel.com \
    --cc=chiau.ee.chew@intel.com \
    --cc=greg@kroah.com \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).