]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/serial/sh-sci.c
PCI: remove quirk_sis_96x_compatible()
[linux-2.6-omap-h63xx.git] / drivers / serial / sh-sci.c
index f336ba6778dd6bdbbffe4fd2a9f37a930021544d..c53b69610a51005c0b845eb9a63c00e900a311e7 100644 (file)
@@ -20,7 +20,6 @@
 
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/timer.h>
@@ -320,6 +319,28 @@ static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag)
 
        sci_out(port, SCFCR, fcr_val);
 }
+#elif defined(CONFIG_CPU_SUBTYPE_SH7722)
+static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag)
+{
+       unsigned int fcr_val = 0;
+
+       if (cflag & CRTSCTS) {
+               fcr_val |= SCFCR_MCE;
+
+               ctrl_outw(0x0000, PORT_PSCR);
+       } else {
+               unsigned short data;
+
+               data = ctrl_inw(PORT_PSCR);
+               data &= 0x033f;
+               data |= 0x0400;
+               ctrl_outw(data, PORT_PSCR);
+
+               ctrl_outw(ctrl_inw(SCSPTR0) & 0x17, SCSPTR0);
+       }
+
+       sci_out(port, SCFCR, fcr_val);
+}
 #else
 /* For SH7750 */
 static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag)
@@ -447,8 +468,7 @@ static void sci_transmit_chars(struct uart_port *port)
 /* On SH3, SCIF may read end-of-break as a space->mark char */
 #define STEPFN(c)  ({int __c=(c); (((__c-1)|(__c)) == -1); })
 
-static inline void sci_receive_chars(struct uart_port *port,
-                                    struct pt_regs *regs)
+static inline void sci_receive_chars(struct uart_port *port)
 {
        struct sci_port *sci_port = (struct sci_port *)port;
        struct tty_struct *tty = port->info->tty;
@@ -477,7 +497,7 @@ static inline void sci_receive_chars(struct uart_port *port,
 
                if (port->type == PORT_SCI) {
                        char c = sci_in(port, SCxRDR);
-                       if (uart_handle_sysrq_char(port, c, regs) || sci_port->break_flag)
+                       if (uart_handle_sysrq_char(port, c) || sci_port->break_flag)
                                count = 0;
                        else {
                                tty_insert_flip_char(tty, c, TTY_NORMAL);
@@ -505,7 +525,7 @@ static inline void sci_receive_chars(struct uart_port *port,
                                        }
                                }
 #endif /* CONFIG_CPU_SH3 */
-                               if (uart_handle_sysrq_char(port, c, regs)) {
+                               if (uart_handle_sysrq_char(port, c)) {
                                        count--; i--;
                                        continue;
                                }
@@ -653,18 +673,18 @@ static inline int sci_handle_breaks(struct uart_port *port)
        return copied;
 }
 
-static irqreturn_t sci_rx_interrupt(int irq, void *port, struct pt_regs *regs)
+static irqreturn_t sci_rx_interrupt(int irq, void *port)
 {
        /* I think sci_receive_chars has to be called irrespective
         * of whether the I_IXOFF is set, otherwise, how is the interrupt
         * to be disabled?
         */
-       sci_receive_chars(port, regs);
+       sci_receive_chars(port);
 
        return IRQ_HANDLED;
 }
 
-static irqreturn_t sci_tx_interrupt(int irq, void *ptr, struct pt_regs *regs)
+static irqreturn_t sci_tx_interrupt(int irq, void *ptr)
 {
        struct uart_port *port = ptr;
 
@@ -675,7 +695,7 @@ static irqreturn_t sci_tx_interrupt(int irq, void *ptr, struct pt_regs *regs)
        return IRQ_HANDLED;
 }
 
-static irqreturn_t sci_er_interrupt(int irq, void *ptr, struct pt_regs *regs)
+static irqreturn_t sci_er_interrupt(int irq, void *ptr)
 {
        struct uart_port *port = ptr;
 
@@ -697,18 +717,18 @@ static irqreturn_t sci_er_interrupt(int irq, void *ptr, struct pt_regs *regs)
                        pr_debug("scif: overrun error\n");
                }
 #endif
-               sci_rx_interrupt(irq, ptr, regs);
+               sci_rx_interrupt(irq, ptr);
        }
 
        sci_out(port, SCxSR, SCxSR_ERROR_CLEAR(port));
 
        /* Kick the transmission */
-       sci_tx_interrupt(irq, ptr, regs);
+       sci_tx_interrupt(irq, ptr);
 
        return IRQ_HANDLED;
 }
 
-static irqreturn_t sci_br_interrupt(int irq, void *ptr, struct pt_regs *regs)
+static irqreturn_t sci_br_interrupt(int irq, void *ptr)
 {
        struct uart_port *port = ptr;
 
@@ -725,7 +745,7 @@ static irqreturn_t sci_br_interrupt(int irq, void *ptr, struct pt_regs *regs)
        return IRQ_HANDLED;
 }
 
-static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr, struct pt_regs *regs)
+static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr)
 {
         unsigned short ssr_status, scr_status;
         struct uart_port *port = ptr;
@@ -735,16 +755,16 @@ static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr, struct pt_regs *regs)
 
        /* Tx Interrupt */
         if ((ssr_status & 0x0020) && (scr_status & 0x0080))
-                sci_tx_interrupt(irq, ptr, regs);
+                sci_tx_interrupt(irq, ptr);
        /* Rx Interrupt */
         if ((ssr_status & 0x0002) && (scr_status & 0x0040))
-                sci_rx_interrupt(irq, ptr, regs);
+                sci_rx_interrupt(irq, ptr);
        /* Error Interrupt */
         if ((ssr_status & 0x0080) && (scr_status & 0x0400))
-                sci_er_interrupt(irq, ptr, regs);
+                sci_er_interrupt(irq, ptr);
        /* Break Interrupt */
         if ((ssr_status & 0x0010) && (scr_status & 0x0200))
-                sci_br_interrupt(irq, ptr, regs);
+                sci_br_interrupt(irq, ptr);
 
        return IRQ_HANDLED;
 }
@@ -777,7 +797,7 @@ static int sci_notifier(struct notifier_block *self,
                         *
                         * Clean this up later..
                         */
-                       clk = clk_get("module_clk");
+                       clk = clk_get(NULL, "module_clk");
                        port->uartclk = clk_get_rate(clk) * 16;
                        clk_put(clk);
                }
@@ -796,7 +816,7 @@ static struct notifier_block sci_nb = { &sci_notifier, NULL, 0 };
 static int sci_request_irq(struct sci_port *port)
 {
        int i;
-       irqreturn_t (*handlers[4])(int irq, void *ptr, struct pt_regs *regs) = {
+       irqreturn_t (*handlers[4])(int irq, void *ptr) = {
                sci_er_interrupt, sci_rx_interrupt, sci_tx_interrupt,
                sci_br_interrupt,
        };
@@ -810,7 +830,7 @@ static int sci_request_irq(struct sci_port *port)
                }
 
                if (request_irq(port->irqs[0], sci_mpxed_interrupt,
-                               SA_INTERRUPT, "sci", port)) {
+                               IRQF_DISABLED, "sci", port)) {
                        printk(KERN_ERR "sci: Cannot allocate irq.\n");
                        return -ENODEV;
                }
@@ -819,7 +839,7 @@ static int sci_request_irq(struct sci_port *port)
                        if (!port->irqs[i])
                                continue;
                        if (request_irq(port->irqs[i], handlers[i],
-                                       SA_INTERRUPT, desc[i], port)) {
+                                       IRQF_DISABLED, desc[i], port)) {
                                printk(KERN_ERR "sci: Cannot allocate irq.\n");
                                return -ENODEV;
                        }
@@ -945,8 +965,8 @@ static void sci_shutdown(struct uart_port *port)
                s->disable(port);
 }
 
-static void sci_set_termios(struct uart_port *port, struct termios *termios,
-                           struct termios *old)
+static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
+                           struct ktermios *old)
 {
        struct sci_port *s = &sci_ports[port->line];
        unsigned int status, baud, smr_val;
@@ -962,7 +982,7 @@ static void sci_set_termios(struct uart_port *port, struct termios *termios,
                default:
                {
 #if defined(CONFIG_SUPERH) && !defined(CONFIG_SUPERH64)
-                       struct clk *clk = clk_get("module_clk");
+                       struct clk *clk = clk_get(NULL, "module_clk");
                        t = SCBRR_VALUE(baud, clk_get_rate(clk));
                        clk_put(clk);
 #else
@@ -1130,7 +1150,7 @@ static void __init sci_init_ports(void)
                 * XXX: We should use a proper SCI/SCIF clock
                 */
                {
-                       struct clk *clk = clk_get("module_clk");
+                       struct clk *clk = clk_get(NULL, "module_clk");
                        sci_ports[i].port.uartclk = clk_get_rate(clk) * 16;
                        clk_put(clk);
                }