Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[pandora-kernel.git] / drivers / serial / mcfserial.c
index 0ef648f..00d7859 100644 (file)
@@ -57,20 +57,16 @@ struct timer_list mcfrs_timer_struct;
  *     keep going.  Perhaps one day the cflag settings for the
  *     console can be used instead.
  */
-#if defined(CONFIG_ARNEWSH) || defined(CONFIG_FREESCALE) || \
-    defined(CONFIG_senTec) || defined(CONFIG_SNEHA)
-#define        CONSOLE_BAUD_RATE       19200
-#define        DEFAULT_CBAUD           B19200
-#endif
-
 #if defined(CONFIG_HW_FEITH)
 #define        CONSOLE_BAUD_RATE       38400
 #define        DEFAULT_CBAUD           B38400
-#endif
-
-#if defined(CONFIG_MOD5272) || defined(CONFIG_M5208EVB)
+#elif defined(CONFIG_MOD5272) || defined(CONFIG_M5208EVB) || defined(CONFIG_M5329EVB)
 #define CONSOLE_BAUD_RATE      115200
 #define DEFAULT_CBAUD          B115200
+#elif defined(CONFIG_ARNEWSH) || defined(CONFIG_FREESCALE) || \
+      defined(CONFIG_senTec) || defined(CONFIG_SNEHA) || defined(CONFIG_AVNET)
+#define        CONSOLE_BAUD_RATE       19200
+#define        DEFAULT_CBAUD           B19200
 #endif
 
 #ifndef CONSOLE_BAUD_RATE
@@ -97,7 +93,7 @@ static struct tty_driver *mcfrs_serial_driver;
 #undef SERIAL_DEBUG_FLOW
 
 #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
-    defined(CONFIG_M520x)
+    defined(CONFIG_M520x) || defined(CONFIG_M532x)
 #define        IRQBASE (MCFINT_VECBASE+MCFINT_UART0)
 #else
 #define        IRQBASE 73
@@ -350,7 +346,7 @@ static inline void receive_chars(struct mcf_serial *info)
                }
                tty_insert_flip_char(tty, ch, flag);
        }
-       tty_flip_buffer_push(tty);
+       tty_schedule_flip(tty);
        return;
 }
 
@@ -1549,6 +1545,28 @@ static void mcfrs_irqinit(struct mcf_serial *info)
                        *feci2c_par |=  MCF_GPIO_PAR_FECI2C_PAR_SCL_UTXD2
                                    | MCF_GPIO_PAR_FECI2C_PAR_SDA_URXD2;
                }
+#elif defined(CONFIG_M532x)
+       volatile unsigned char *uartp;
+       uartp = info->addr;
+       switch (info->line) {
+       case 0:
+               MCF_INTC0_ICR26 = 0x3;
+               MCF_INTC0_CIMR = 26;
+               /* GPIO initialization */
+               MCF_GPIO_PAR_UART |= 0x000F;
+               break;
+       case 1:
+               MCF_INTC0_ICR27 = 0x3;
+               MCF_INTC0_CIMR = 27;
+               /* GPIO initialization */
+               MCF_GPIO_PAR_UART |= 0x0FF0;
+               break;
+       case 2:
+               MCF_INTC0_ICR28 = 0x3;
+               MCF_INTC0_CIMR = 28;
+               /* GPIOs also must be initalized, depends on board */
+               break;
+       }
 #else
        volatile unsigned char  *icrp, *uartp;
 
@@ -1578,7 +1596,7 @@ static void mcfrs_irqinit(struct mcf_serial *info)
        /* Clear mask, so no surprise interrupts. */
        uartp[MCFUART_UIMR] = 0;
 
-       if (request_irq(info->irq, mcfrs_interrupt, SA_INTERRUPT,
+       if (request_irq(info->irq, mcfrs_interrupt, IRQF_DISABLED,
            "ColdFire UART", NULL)) {
                printk("MCFRS: Unable to attach ColdFire UART %d interrupt "
                        "vector=%d\n", info->line, info->irq);
@@ -1648,7 +1666,7 @@ static void show_serial_version(void)
        printk(mcfrs_drivername);
 }
 
-static struct tty_operations mcfrs_ops = {
+static const struct tty_operations mcfrs_ops = {
        .open = mcfrs_open,
        .close = mcfrs_close,
        .write = mcfrs_write,
@@ -1695,7 +1713,6 @@ mcfrs_init(void)
        /* Initialize the tty_driver structure */
        mcfrs_serial_driver->owner = THIS_MODULE;
        mcfrs_serial_driver->name = "ttyS";
-       mcfrs_serial_driver->devfs_name = "ttys/";
        mcfrs_serial_driver->driver_name = "serial";
        mcfrs_serial_driver->major = TTY_MAJOR;
        mcfrs_serial_driver->minor_start = 64;