]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - drivers/serial/pxa.c
floppy: fix hibernation
[linux-2.6.git] / drivers / serial / pxa.c
index f7a0d37c42219678bf1d7c8d64bb79deced586ab..a48a8a13d87bb7c00cd26c6522cba54c61fa8de4 100644 (file)
 #include <linux/tty_flip.h>
 #include <linux/serial_core.h>
 #include <linux/clk.h>
-
-#include <asm/io.h>
-#include <mach/hardware.h>
-#include <asm/irq.h>
-#include <mach/pxa-regs.h>
-
+#include <linux/io.h>
 
 struct uart_pxa_port {
        struct uart_port        port;
@@ -490,7 +485,7 @@ serial_pxa_set_termios(struct uart_port *port, struct ktermios *termios,
         * Ensure the port will be enabled.
         * This is required especially for serial console.
         */
-       up->ier |= IER_UUE;
+       up->ier |= UART_IER_UUE;
 
        /*
         * Update the per-port timeout.
@@ -534,6 +529,11 @@ serial_pxa_set_termios(struct uart_port *port, struct ktermios *termios,
 
        serial_out(up, UART_IER, up->ier);
 
+       if (termios->c_cflag & CRTSCTS)
+               up->mcr |= UART_MCR_AFE;
+       else
+               up->mcr &= ~UART_MCR_AFE;
+
        serial_out(up, UART_LCR, cval | UART_LCR_DLAB);/* set DLAB */
        serial_out(up, UART_DLL, quot & 0xff);          /* LS of divisor */
        serial_out(up, UART_DLM, quot >> 8);            /* MS of divisor */
@@ -761,7 +761,7 @@ static int serial_pxa_probe(struct platform_device *dev)
        if (!sport)
                return -ENOMEM;
 
-       sport->clk = clk_get(&dev->dev, "UARTCLK");
+       sport->clk = clk_get(&dev->dev, NULL);
        if (IS_ERR(sport->clk)) {
                ret = PTR_ERR(sport->clk);
                goto err_free;
@@ -778,19 +778,15 @@ static int serial_pxa_probe(struct platform_device *dev)
        sport->port.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF;
        sport->port.uartclk = clk_get_rate(sport->clk);
 
-       /*
-        * Is it worth keeping this?
-        */
-       if (mmres->start == __PREG(FFUART))
-               sport->name = "FFUART";
-       else if (mmres->start == __PREG(BTUART))
-               sport->name = "BTUART";
-       else if (mmres->start == __PREG(STUART))
-               sport->name = "STUART";
-       else if (mmres->start == __PREG(HWUART))
-               sport->name = "HWUART";
-       else
+       switch (dev->id) {
+       case 0: sport->name = "FFUART"; break;
+       case 1: sport->name = "BTUART"; break;
+       case 2: sport->name = "STUART"; break;
+       case 3: sport->name = "HWUART"; break;
+       default:
                sport->name = "???";
+               break;
+       }
 
        sport->port.membase = ioremap(mmres->start, mmres->end - mmres->start + 1);
        if (!sport->port.membase) {