Merge branch 'tty-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 21 Jan 2011 00:39:23 +0000 (16:39 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 21 Jan 2011 00:39:23 +0000 (16:39 -0800)
* 'tty-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6:
  tty: update MAINTAINERS file due to driver movement
  tty: move drivers/serial/ to drivers/tty/serial/
  tty: move hvc drivers to drivers/tty/hvc/

1  2 
MAINTAINERS
drivers/Makefile
drivers/tty/serial/atmel_serial.c
drivers/tty/serial/samsung.c
drivers/tty/serial/sh-sci.c
drivers/tty/serial/sh-sci.h

diff --combined MAINTAINERS
@@@ -162,7 -162,7 +162,7 @@@ L: linux-serial@vger.kernel.or
  W:    http://serial.sourceforge.net
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6.git
- F:    drivers/serial/8250*
+ F:    drivers/tty/serial/8250*
  F:    include/linux/serial_8250.h
  
  8390 NETWORK DRIVERS [WD80x3/SMC-ELITE, SMC-ULTRA, NE2000, 3C503, etc.]
@@@ -888,8 -888,8 +888,8 @@@ F: arch/arm/mach-msm
  F:    drivers/video/msm/
  F:    drivers/mmc/host/msm_sdcc.c
  F:    drivers/mmc/host/msm_sdcc.h
- F:    drivers/serial/msm_serial.h
- F:    drivers/serial/msm_serial.c
+ F:    drivers/tty/serial/msm_serial.h
+ F:    drivers/tty/serial/msm_serial.c
  T:    git git://codeaurora.org/quic/kernel/davidb/linux-msm.git
  S:    Maintained
  
@@@ -1256,7 -1256,7 +1256,7 @@@ F:      drivers/mmc/host/atmel-mci-regs.
  ATMEL AT91 / AT32 SERIAL DRIVER
  M:    Nicolas Ferre <nicolas.ferre@atmel.com>
  S:    Supported
- F:    drivers/serial/atmel_serial.c
+ F:    drivers/tty/serial/atmel_serial.c
  
  ATMEL LCDFB DRIVER
  M:    Nicolas Ferre <nicolas.ferre@atmel.com>
@@@ -1412,7 -1412,7 +1412,7 @@@ M:      Sonic Zhang <sonic.zhang@analog.com
  L:    uclinux-dist-devel@blackfin.uclinux.org
  W:    http://blackfin.uclinux.org
  S:    Supported
- F:    drivers/serial/bfin_5xx.c
+ F:    drivers/tty/serial/bfin_5xx.c
  
  BLACKFIN WATCHDOG DRIVER
  M:    Mike Frysinger <vapier.adi@gmail.com>
@@@ -1523,14 -1523,6 +1523,14 @@@ S:    Supporte
  F:    block/bsg.c
  F:    include/linux/bsg.h
  
 +BT87X AUDIO DRIVER
 +M:    Clemens Ladisch <clemens@ladisch.de>
 +L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
 +T:    git git://git.alsa-project.org/alsa-kernel.git
 +S:    Maintained
 +F:    Documentation/sound/alsa/Bt87x.txt
 +F:    sound/pci/bt87x.c
 +
  BT8XXGPIO DRIVER
  M:    Michael Buesch <mb@bu3sch.de>
  W:    http://bu3sch.de/btgpio.php
@@@ -1556,13 -1548,6 +1556,13 @@@ S:    Maintaine
  F:    Documentation/video4linux/bttv/
  F:    drivers/media/video/bt8xx/bttv*
  
 +C-MEDIA CMI8788 DRIVER
 +M:    Clemens Ladisch <clemens@ladisch.de>
 +L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
 +T:    git git://git.alsa-project.org/alsa-kernel.git
 +S:    Maintained
 +F:    sound/pci/oxygen/
 +
  CACHEFILES: FS-CACHE BACKEND FOR CACHING ON MOUNTED FILESYSTEMS
  M:    David Howells <dhowells@redhat.com>
  L:    linux-cachefs@redhat.com
@@@ -1877,7 -1862,7 +1877,7 @@@ L:      linux-cris-kernel@axis.co
  W:    http://developer.axis.com
  S:    Maintained
  F:    arch/cris/
- F:    drivers/serial/crisv10.*
+ F:    drivers/tty/serial/crisv10.*
  
  CRYPTO API
  M:    Herbert Xu <herbert@gondor.apana.org.au>
@@@ -2216,7 -2201,7 +2216,7 @@@ F:      drivers/net/wan/dscc4.
  DZ DECSTATION DZ11 SERIAL DRIVER
  M:    "Maciej W. Rozycki" <macro@linux-mips.org>
  S:    Maintained
- F:    drivers/serial/dz.*
+ F:    drivers/tty/serial/dz.*
  
  EATA-DMA SCSI DRIVER
  M:    Michael Neuffer <mike@i-Connect.Net>
@@@ -2354,13 -2339,6 +2354,13 @@@ W:    bluesmoke.sourceforge.ne
  S:    Maintained
  F:    drivers/edac/r82600_edac.c
  
 +EDIROL UA-101/UA-1000 DRIVER
 +M:    Clemens Ladisch <clemens@ladisch.de>
 +L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
 +T:    git git://git.alsa-project.org/alsa-kernel.git
 +S:    Maintained
 +F:    sound/usb/misc/ua101.c
 +
  EEEPC LAPTOP EXTRAS DRIVER
  M:    Corentin Chary <corentincj@iksaif.net>
  L:    acpi4asus-user@lists.sourceforge.net
@@@ -2643,7 -2621,7 +2643,7 @@@ FREESCALE QUICC ENGINE UCC UART DRIVE
  M:    Timur Tabi <timur@freescale.com>
  L:    linuxppc-dev@lists.ozlabs.org
  S:    Supported
- F:    drivers/serial/ucc_uart.c
+ F:    drivers/tty/serial/ucc_uart.c
  
  FREESCALE SOC SOUND DRIVERS
  M:    Timur Tabi <timur@freescale.com>
@@@ -3350,7 -3328,7 +3350,7 @@@ IOC3 SERIAL DRIVE
  M:    Pat Gefre <pfg@sgi.com>
  L:    linux-serial@vger.kernel.org
  S:    Maintained
- F:    drivers/serial/ioc3_serial.c
+ F:    drivers/tty/serial/ioc3_serial.c
  
  IP MASQUERADING
  M:    Juanjo Ciarlante <jjciarla@raiz.uncu.edu.ar>
@@@ -3527,15 -3505,8 +3527,15 @@@ JSM Neo PCI based serial car
  M:    Breno Leitao <leitao@linux.vnet.ibm.com>
  L:    linux-serial@vger.kernel.org
  S:    Maintained
- F:    drivers/serial/jsm/
+ F:    drivers/tty/serial/jsm/
  
 +K10TEMP HARDWARE MONITORING DRIVER
 +M:    Clemens Ladisch <clemens@ladisch.de>
 +L:    lm-sensors@lm-sensors.org
 +S:    Maintained
 +F:    Documentation/hwmon/k10temp
 +F:    drivers/hwmon/k10temp.c
 +
  K8TEMP HARDWARE MONITORING DRIVER
  M:    Rudolf Marek <r.marek@assembler.cz>
  L:    lm-sensors@lm-sensors.org
@@@ -3677,14 -3648,14 +3677,14 @@@ L:   kgdb-bugreport@lists.sourceforge.ne
  S:    Maintained
  F:    Documentation/DocBook/kgdb.tmpl
  F:    drivers/misc/kgdbts.c
- F:    drivers/serial/kgdboc.c
+ F:    drivers/tty/serial/kgdboc.c
  F:    include/linux/kdb.h
  F:    include/linux/kgdb.h
  F:    kernel/debug/
  
  KMEMCHECK
  M:    Vegard Nossum <vegardno@ifi.uio.no>
 -M:    Pekka Enberg <penberg@cs.helsinki.fi>
 +M:    Pekka Enberg <penberg@kernel.org>
  S:    Maintained
  F:    Documentation/kmemcheck.txt
  F:    arch/x86/include/asm/kmemcheck.h
@@@ -4566,13 -4537,6 +4566,13 @@@ F:    drivers/o
  F:    include/linux/of*.h
  K:    of_get_property
  
 +OPL4 DRIVER
 +M:    Clemens Ladisch <clemens@ladisch.de>
 +L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
 +T:    git git://git.alsa-project.org/alsa-kernel.git
 +S:    Maintained
 +F:    sound/drivers/opl4/
 +
  OPROFILE
  M:    Robert Richter <robert.richter@amd.com>
  L:    oprofile-list@lists.sf.net
@@@ -5272,7 -5236,8 +5272,7 @@@ S:      Supporte
  F:    drivers/s390/net/
  
  S390 ZCRYPT DRIVER
 -M:    Felix Beck <felix.beck@de.ibm.com>
 -M:    Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
 +M:    Holger Dengler <hd@linux.vnet.ibm.com>
  M:    linux390@de.ibm.com
  L:    linux-s390@vger.kernel.org
  W:    http://www.ibm.com/developerworks/linux/linux390/
@@@ -5318,7 -5283,7 +5318,7 @@@ SAMSUNG AUDIO (ASoC) DRIVER
  M:    Jassi Brar <jassi.brar@samsung.com>
  L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
  S:    Supported
 -F:    sound/soc/s3c24xx
 +F:    sound/soc/samsung
  
  TIMEKEEPING, NTP
  M:    John Stultz <johnstul@us.ibm.com>
@@@ -5545,7 -5510,7 +5545,7 @@@ M:      Pat Gefre <pfg@sgi.com
  L:    linux-ia64@vger.kernel.org
  S:    Supported
  F:    Documentation/ia64/serial.txt
- F:    drivers/serial/ioc?_serial.c
+ F:    drivers/tty/serial/ioc?_serial.c
  F:    include/linux/ioc?.h
  
  SGI VISUAL WORKSTATION 320 AND 540
@@@ -5567,7 -5532,7 +5567,7 @@@ L:      linux-arm-kernel@lists.infradead.or
  S:    Maintained
  F:    Documentation/arm/Sharp-LH/ADC-LH7-Touchscreen
  F:    arch/arm/mach-lh7a40x/
- F:    drivers/serial/serial_lh7a40x.c
+ F:    drivers/tty/serial/serial_lh7a40x.c
  F:    drivers/usb/gadget/lh7a40*
  F:    drivers/usb/host/ohci-lh7a40*
  
@@@ -5646,7 -5611,7 +5646,7 @@@ F:      drivers/net/sky2.
  
  SLAB ALLOCATOR
  M:    Christoph Lameter <cl@linux-foundation.org>
 -M:    Pekka Enberg <penberg@cs.helsinki.fi>
 +M:    Pekka Enberg <penberg@kernel.org>
  M:    Matt Mackall <mpm@selenic.com>
  L:    linux-mm@kvack.org
  S:    Maintained
@@@ -5787,14 -5752,14 +5787,14 @@@ L:   sparclinux@vger.kernel.or
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6.git
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6.git
  S:    Maintained
- F:    drivers/serial/suncore.c
- F:    drivers/serial/suncore.h
- F:    drivers/serial/sunhv.c
- F:    drivers/serial/sunsab.c
- F:    drivers/serial/sunsab.h
- F:    drivers/serial/sunsu.c
- F:    drivers/serial/sunzilog.c
- F:    drivers/serial/sunzilog.h
+ F:    drivers/tty/serial/suncore.c
+ F:    drivers/tty/serial/suncore.h
+ F:    drivers/tty/serial/sunhv.c
+ F:    drivers/tty/serial/sunsab.c
+ F:    drivers/tty/serial/sunsab.h
+ F:    drivers/tty/serial/sunsu.c
+ F:    drivers/tty/serial/sunzilog.c
+ F:    drivers/tty/serial/sunzilog.h
  
  SPEAR PLATFORM SUPPORT
  M:    Viresh Kumar <viresh.kumar@st.com>
@@@ -6124,8 -6089,8 +6124,8 @@@ TTY LAYE
  M:    Greg Kroah-Hartman <gregkh@suse.de>
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6.git
- F:    drivers/char/tty_*
- F:    drivers/serial/serial_core.c
+ F:    drivers/tty/*
+ F:    drivers/tty/serial/serial_core.c
  F:    include/linux/serial_core.h
  F:    include/linux/serial.h
  F:    include/linux/tty.h
@@@ -6326,13 -6291,6 +6326,13 @@@ S:    Maintaine
  W:    http://www.one-eyed-alien.net/~mdharm/linux-usb/
  F:    drivers/usb/storage/
  
 +USB MIDI DRIVER
 +M:    Clemens Ladisch <clemens@ladisch.de>
 +L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
 +T:    git git://git.alsa-project.org/alsa-kernel.git
 +S:    Maintained
 +F:    sound/usb/midi.*
 +
  USB OHCI DRIVER
  M:    David Brownell <dbrownell@users.sourceforge.net>
  L:    linux-usb@vger.kernel.org
@@@ -6591,12 -6549,13 +6591,12 @@@ F:   Documentation/i2c/busses/i2c-viapr
  F:    drivers/i2c/busses/i2c-viapro.c
  
  VIA SD/MMC CARD CONTROLLER DRIVER
 -M:    Joseph Chan <JosephChan@via.com.tw>
 +M:    Bruce Chang <brucechang@via.com.tw>
  M:    Harald Welte <HaraldWelte@viatech.com>
  S:    Maintained
  F:    drivers/mmc/host/via-sdmmc.c
  
  VIA UNICHROME(PRO)/CHROME9 FRAMEBUFFER DRIVER
 -M:    Joseph Chan <JosephChan@via.com.tw>
  M:    Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
  L:    linux-fbdev@vger.kernel.org
  S:    Maintained
@@@ -6870,7 -6829,7 +6870,7 @@@ XILINX UARTLITE SERIAL DRIVE
  M:    Peter Korsgaard <jacmet@sunsite.dk>
  L:    linux-serial@vger.kernel.org
  S:    Maintained
- F:    drivers/serial/uartlite.c
+ F:    drivers/tty/serial/uartlite.c
  
  YAM DRIVER FOR AX.25
  M:    Jean-Paul Roubelat <jpr@f6fbb.org>
@@@ -6916,7 -6875,7 +6916,7 @@@ F:      drivers/media/video/zoran
  ZS DECSTATION Z85C30 SERIAL DRIVER
  M:    "Maciej W. Rozycki" <macro@linux-mips.org>
  S:    Maintained
- F:    drivers/serial/zs.*
+ F:    drivers/tty/serial/zs.*
  
  GRE DEMULTIPLEXER DRIVER
  M:    Dmitry Kozlov <xeb@mail.ru>
diff --combined drivers/Makefile
@@@ -24,7 -24,7 +24,7 @@@ obj-$(CONFIG_XEN)             += xen
  # regulators early, since some subsystems rely on them to initialize
  obj-$(CONFIG_REGULATOR)               += regulator/
  
- # char/ comes before serial/ etc so that the VT console is the boot-time
+ # tty/ comes before char/ so that the VT console is the boot-time
  # default.
  obj-y                         += tty/
  obj-y                         += char/
@@@ -38,7 -38,6 +38,6 @@@ obj-$(CONFIG_CONNECTOR)               += connector
  obj-$(CONFIG_FB_I810)           += video/i810/
  obj-$(CONFIG_FB_INTEL)          += video/intelfb/
  
- obj-y                         += serial/
  obj-$(CONFIG_PARPORT)         += parport/
  obj-y                         += base/ block/ misc/ mfd/ nfc/
  obj-$(CONFIG_NUBUS)           += nubus/
@@@ -46,7 -45,6 +45,7 @@@ obj-y                         += macintosh
  obj-$(CONFIG_IDE)             += ide/
  obj-$(CONFIG_SCSI)            += scsi/
  obj-$(CONFIG_ATA)             += ata/
 +obj-$(CONFIG_TARGET_CORE)     += target/
  obj-$(CONFIG_MTD)             += mtd/
  obj-$(CONFIG_SPI)             += spi/
  obj-y                         += net/
@@@ -1732,11 -1732,6 +1732,11 @@@ static int __devinit atmel_serial_probe
        device_init_wakeup(&pdev->dev, 1);
        platform_set_drvdata(pdev, port);
  
 +      if (port->rs485.flags & SER_RS485_ENABLED) {
 +              UART_PUT_MR(&port->uart, ATMEL_US_USMODE_NORMAL);
 +              UART_PUT_CR(&port->uart, ATMEL_US_RTSEN);
 +      }
 +
        return 0;
  
  err_add_port:
@@@ -883,10 -883,10 +883,10 @@@ static struct uart_ops s3c24xx_serial_o
  
  static struct uart_driver s3c24xx_uart_drv = {
        .owner          = THIS_MODULE,
 -      .dev_name       = "s3c2410_serial",
 +      .driver_name    = "s3c2410_serial",
        .nr             = CONFIG_SERIAL_SAMSUNG_UARTS,
        .cons           = S3C24XX_SERIAL_CONSOLE,
 -      .driver_name    = S3C24XX_SERIAL_NAME,
 +      .dev_name       = S3C24XX_SERIAL_NAME,
        .major          = S3C24XX_SERIAL_MAJOR,
        .minor          = S3C24XX_SERIAL_MINOR,
  };
@@@ -3,7 -3,7 +3,7 @@@
   *
   * SuperH on-chip serial module support.  (SCI with no FIFO / with FIFO)
   *
 - *  Copyright (C) 2002 - 2008  Paul Mundt
 + *  Copyright (C) 2002 - 2011  Paul Mundt
   *  Modified to support SH7720 SCIF. Markus Brunner, Mark Jonas (Jul 2007).
   *
   * based off of the old drivers/char/sh-sci.c by:
@@@ -81,22 -81,14 +81,22 @@@ struct sci_port 
        struct timer_list       break_timer;
        int                     break_flag;
  
 +      /* SCSCR initialization */
 +      unsigned int            scscr;
 +
 +      /* SCBRR calculation algo */
 +      unsigned int            scbrr_algo_id;
 +
        /* Interface clock */
        struct clk              *iclk;
        /* Function clock */
        struct clk              *fclk;
  
        struct list_head        node;
 +
        struct dma_chan                 *chan_tx;
        struct dma_chan                 *chan_rx;
 +
  #ifdef CONFIG_SERIAL_SH_SCI_DMA
        struct device                   *dma_dev;
        unsigned int                    slave_tx;
@@@ -423,9 -415,9 +423,9 @@@ static void sci_transmit_chars(struct u
        if (!(status & SCxSR_TDxE(port))) {
                ctrl = sci_in(port, SCSCR);
                if (uart_circ_empty(xmit))
 -                      ctrl &= ~SCI_CTRL_FLAGS_TIE;
 +                      ctrl &= ~SCSCR_TIE;
                else
 -                      ctrl |= SCI_CTRL_FLAGS_TIE;
 +                      ctrl |= SCSCR_TIE;
                sci_out(port, SCSCR, ctrl);
                return;
        }
                        sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port));
                }
  
 -              ctrl |= SCI_CTRL_FLAGS_TIE;
 +              ctrl |= SCSCR_TIE;
                sci_out(port, SCSCR, ctrl);
        }
  }
@@@ -716,7 -708,7 +716,7 @@@ static irqreturn_t sci_rx_interrupt(in
                        disable_irq_nosync(irq);
                        scr |= 0x4000;
                } else {
 -                      scr &= ~SCI_CTRL_FLAGS_RIE;
 +                      scr &= ~SCSCR_RIE;
                }
                sci_out(port, SCSCR, scr);
                /* Clear current interrupt */
@@@ -785,18 -777,6 +785,18 @@@ static irqreturn_t sci_br_interrupt(in
        return IRQ_HANDLED;
  }
  
 +static inline unsigned long port_rx_irq_mask(struct uart_port *port)
 +{
 +      /*
 +       * Not all ports (such as SCIFA) will support REIE. Rather than
 +       * special-casing the port type, we check the port initialization
 +       * IRQ enable mask to see whether the IRQ is desired at all. If
 +       * it's unset, it's logically inferred that there's no point in
 +       * testing for it.
 +       */
 +      return SCSCR_RIE | (to_sci_port(port)->scscr & SCSCR_REIE);
 +}
 +
  static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr)
  {
        unsigned short ssr_status, scr_status, err_enabled;
  
        ssr_status = sci_in(port, SCxSR);
        scr_status = sci_in(port, SCSCR);
 -      err_enabled = scr_status & (SCI_CTRL_FLAGS_REIE | SCI_CTRL_FLAGS_RIE);
 +      err_enabled = scr_status & port_rx_irq_mask(port);
  
        /* Tx Interrupt */
 -      if ((ssr_status & SCxSR_TDxE(port)) && (scr_status & SCI_CTRL_FLAGS_TIE) &&
 +      if ((ssr_status & SCxSR_TDxE(port)) && (scr_status & SCSCR_TIE) &&
            !s->chan_tx)
                ret = sci_tx_interrupt(irq, ptr);
 +
        /*
         * Rx Interrupt: if we're using DMA, the DMA controller clears RDF /
         * DR flags
         */
        if (((ssr_status & SCxSR_RDxF(port)) || s->chan_rx) &&
 -          (scr_status & SCI_CTRL_FLAGS_RIE))
 +          (scr_status & SCSCR_RIE))
                ret = sci_rx_interrupt(irq, ptr);
 +
        /* Error Interrupt */
        if ((ssr_status & SCxSR_ERRORS(port)) && err_enabled)
                ret = sci_er_interrupt(irq, ptr);
 +
        /* Break Interrupt */
        if ((ssr_status & SCxSR_BRK(port)) && err_enabled)
                ret = sci_br_interrupt(irq, ptr);
@@@ -974,7 -951,7 +974,7 @@@ static void sci_dma_tx_complete(void *a
                schedule_work(&s->work_tx);
        } else if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) {
                u16 ctrl = sci_in(port, SCSCR);
 -              sci_out(port, SCSCR, ctrl & ~SCI_CTRL_FLAGS_TIE);
 +              sci_out(port, SCSCR, ctrl & ~SCSCR_TIE);
        }
  
        spin_unlock_irqrestore(&port->lock, flags);
@@@ -1237,16 -1214,14 +1237,16 @@@ static void sci_start_tx(struct uart_po
                if (new != scr)
                        sci_out(port, SCSCR, new);
        }
 +
        if (s->chan_tx && !uart_circ_empty(&s->port.state->xmit) &&
            s->cookie_tx < 0)
                schedule_work(&s->work_tx);
  #endif
 +
        if (!s->chan_tx || port->type == PORT_SCIFA || port->type == PORT_SCIFB) {
                /* Set TIE (Transmit Interrupt Enable) bit in SCSCR */
                ctrl = sci_in(port, SCSCR);
 -              sci_out(port, SCSCR, ctrl | SCI_CTRL_FLAGS_TIE);
 +              sci_out(port, SCSCR, ctrl | SCSCR_TIE);
        }
  }
  
@@@ -1256,24 -1231,20 +1256,24 @@@ static void sci_stop_tx(struct uart_por
  
        /* Clear TIE (Transmit Interrupt Enable) bit in SCSCR */
        ctrl = sci_in(port, SCSCR);
 +
        if (port->type == PORT_SCIFA || port->type == PORT_SCIFB)
                ctrl &= ~0x8000;
 -      ctrl &= ~SCI_CTRL_FLAGS_TIE;
 +
 +      ctrl &= ~SCSCR_TIE;
 +
        sci_out(port, SCSCR, ctrl);
  }
  
  static void sci_start_rx(struct uart_port *port)
  {
 -      unsigned short ctrl = SCI_CTRL_FLAGS_RIE | SCI_CTRL_FLAGS_REIE;
 +      unsigned short ctrl;
 +
 +      ctrl = sci_in(port, SCSCR) | port_rx_irq_mask(port);
  
 -      /* Set RIE (Receive Interrupt Enable) bit in SCSCR */
 -      ctrl |= sci_in(port, SCSCR);
        if (port->type == PORT_SCIFA || port->type == PORT_SCIFB)
                ctrl &= ~0x4000;
 +
        sci_out(port, SCSCR, ctrl);
  }
  
@@@ -1281,13 -1252,11 +1281,13 @@@ static void sci_stop_rx(struct uart_por
  {
        unsigned short ctrl;
  
 -      /* Clear RIE (Receive Interrupt Enable) bit in SCSCR */
        ctrl = sci_in(port, SCSCR);
 +
        if (port->type == PORT_SCIFA || port->type == PORT_SCIFB)
                ctrl &= ~0x4000;
 -      ctrl &= ~(SCI_CTRL_FLAGS_RIE | SCI_CTRL_FLAGS_REIE);
 +
 +      ctrl &= ~port_rx_irq_mask(port);
 +
        sci_out(port, SCSCR, ctrl);
  }
  
@@@ -1327,7 -1296,7 +1327,7 @@@ static void rx_timer_fn(unsigned long a
                scr &= ~0x4000;
                enable_irq(s->irqs[1]);
        }
 -      sci_out(port, SCSCR, scr | SCI_CTRL_FLAGS_RIE);
 +      sci_out(port, SCSCR, scr | SCSCR_RIE);
        dev_dbg(port->dev, "DMA Rx timed out\n");
        schedule_work(&s->work_rx);
  }
@@@ -1473,31 -1442,12 +1473,31 @@@ static void sci_shutdown(struct uart_po
                s->disable(port);
  }
  
 +static unsigned int sci_scbrr_calc(unsigned int algo_id, unsigned int bps,
 +                                 unsigned long freq)
 +{
 +      switch (algo_id) {
 +      case SCBRR_ALGO_1:
 +              return ((freq + 16 * bps) / (16 * bps) - 1);
 +      case SCBRR_ALGO_2:
 +              return ((freq + 16 * bps) / (32 * bps) - 1);
 +      case SCBRR_ALGO_3:
 +              return (((freq * 2) + 16 * bps) / (16 * bps) - 1);
 +      case SCBRR_ALGO_4:
 +              return (((freq * 2) + 16 * bps) / (32 * bps) - 1);
 +      case SCBRR_ALGO_5:
 +              return (((freq * 1000 / 32) / bps) - 1);
 +      }
 +
 +      /* Warn, but use a safe default */
 +      WARN_ON(1);
 +      return ((freq + 16 * bps) / (32 * bps) - 1);
 +}
 +
  static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
                            struct ktermios *old)
  {
 -#ifdef CONFIG_SERIAL_SH_SCI_DMA
        struct sci_port *s = to_sci_port(port);
 -#endif
        unsigned int status, baud, smr_val, max_baud;
        int t = -1;
        u16 scfcr = 0;
  
        baud = uart_get_baud_rate(port, termios, old, 0, max_baud);
        if (likely(baud && port->uartclk))
 -              t = SCBRR_VALUE(baud, port->uartclk);
 +              t = sci_scbrr_calc(s->scbrr_algo_id, baud, port->uartclk);
  
        do {
                status = sci_in(port, SCxSR);
        sci_out(port, SCSMR, smr_val);
  
        dev_dbg(port->dev, "%s: SMR %x, t %x, SCSCR %x\n", __func__, smr_val, t,
 -              SCSCR_INIT(port));
 +              s->scscr);
  
        if (t > 0) {
                if (t >= 256) {
        sci_init_pins(port, termios->c_cflag);
        sci_out(port, SCFCR, scfcr | ((termios->c_cflag & CRTSCTS) ? SCFCR_MCE : 0));
  
 -      sci_out(port, SCSCR, SCSCR_INIT(port));
 +      sci_out(port, SCSCR, s->scscr);
  
  #ifdef CONFIG_SERIAL_SH_SCI_DMA
        /*
@@@ -1729,11 -1679,9 +1729,11 @@@ static int __devinit sci_init_single(st
        port->mapbase   = p->mapbase;
        port->membase   = p->membase;
  
 -      port->irq       = p->irqs[SCIx_TXI_IRQ];
 -      port->flags     = p->flags;
 -      sci_port->type  = port->type = p->type;
 +      port->irq               = p->irqs[SCIx_TXI_IRQ];
 +      port->flags             = p->flags;
 +      sci_port->type          = port->type = p->type;
 +      sci_port->scscr         = p->scscr;
 +      sci_port->scbrr_algo_id = p->scbrr_algo_id;
  
  #ifdef CONFIG_SERIAL_SH_SCI_DMA
        sci_port->dma_dev       = p->dma_dev;
      defined(CONFIG_CPU_SUBTYPE_SH7709)
  # define SCPCR  0xA4000116 /* 16 bit SCI and SCIF */
  # define SCPDR  0xA4000136 /* 8  bit SCI and SCIF */
 -# define SCSCR_INIT(port)          0x30 /* TIE=0,RIE=0,TE=1,RE=1 */
  #elif defined(CONFIG_CPU_SUBTYPE_SH7705)
  # define SCIF0                0xA4400000
  # define SCIF2                0xA4410000
 -# define SCSMR_Ir     0xA44A0000
 -# define IRDA_SCIF    SCIF0
  # define SCPCR 0xA4000116
  # define SCPDR 0xA4000136
 -
 -/* Set the clock source,
 - * SCIF2 (0xA4410000) -> External clock, SCK pin used as clock input
 - * SCIF0 (0xA4400000) -> Internal clock, SCK pin as serial clock output
 - */
 -# define SCSCR_INIT(port) (port->mapbase == SCIF2) ? 0xF3 : 0xF0
  #elif defined(CONFIG_CPU_SUBTYPE_SH7720) || \
        defined(CONFIG_CPU_SUBTYPE_SH7721) || \
        defined(CONFIG_ARCH_SH73A0) || \
        defined(CONFIG_ARCH_SH7367) || \
        defined(CONFIG_ARCH_SH7377) || \
        defined(CONFIG_ARCH_SH7372)
 -# define SCSCR_INIT(port)  0x0030 /* TIE=0,RIE=0,TE=1,RE=1 */
  # define PORT_PTCR       0xA405011EUL
  # define PORT_PVCR       0xA4050122UL
  # define SCIF_ORER       0x0200   /* overrun error bit */
@@@ -33,6 -43,7 +33,6 @@@
  # define SCSPTR1 0xFFE0001C /* 8 bit SCIF */
  # define SCSPTR2 0xFFE80020 /* 16 bit SCIF */
  # define SCIF_ORER 0x0001   /* overrun error bit */
 -# define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
  #elif defined(CONFIG_CPU_SUBTYPE_SH7750)  || \
        defined(CONFIG_CPU_SUBTYPE_SH7750R) || \
        defined(CONFIG_CPU_SUBTYPE_SH7750S) || \
  # define SCSPTR1 0xffe0001c /* 8  bit SCI */
  # define SCSPTR2 0xFFE80020 /* 16 bit SCIF */
  # define SCIF_ORER 0x0001   /* overrun error bit */
 -# define SCSCR_INIT(port) (((port)->type == PORT_SCI) ? \
 -      0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ : \
 -      0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ )
  #elif defined(CONFIG_CPU_SUBTYPE_SH7760)
  # define SCSPTR0 0xfe600024 /* 16 bit SCIF */
  # define SCSPTR1 0xfe610024 /* 16 bit SCIF */
  # define SCSPTR2 0xfe620024 /* 16 bit SCIF */
  # define SCIF_ORER 0x0001  /* overrun error bit */
 -# define SCSCR_INIT(port)          0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
  #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
  # define SCSPTR0 0xA4400000     /* 16 bit SCIF */
  # define SCIF_ORER 0x0001   /* overrun error bit */
  # define PACR 0xa4050100
  # define PBCR 0xa4050102
 -# define SCSCR_INIT(port)          0x3B
  #elif defined(CONFIG_CPU_SUBTYPE_SH7343)
  # define SCSPTR0 0xffe00010   /* 16 bit SCIF */
  # define SCSPTR1 0xffe10010   /* 16 bit SCIF */
  # define SCSPTR2 0xffe20010   /* 16 bit SCIF */
  # define SCSPTR3 0xffe30010   /* 16 bit SCIF */
 -# define SCSCR_INIT(port) 0x32        /* TIE=0,RIE=0,TE=1,RE=1,REIE=0,CKE=1 */
  #elif defined(CONFIG_CPU_SUBTYPE_SH7722)
  # define PADR                 0xA4050120
  # define PSDR                 0xA405013e
  # define PWDR                 0xA4050166
  # define PSCR                 0xA405011E
  # define SCIF_ORER            0x0001  /* overrun error bit */
 -# define SCSCR_INIT(port)     0x0038  /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
  #elif defined(CONFIG_CPU_SUBTYPE_SH7366)
  # define SCPDR0                       0xA405013E      /* 16 bit SCIF0 PSDR */
  # define SCSPTR0              SCPDR0
  # define SCIF_ORER            0x0001  /* overrun error bit */
 -# define SCSCR_INIT(port)     0x0038  /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
  #elif defined(CONFIG_CPU_SUBTYPE_SH7723)
  # define SCSPTR0                0xa4050160
  # define SCSPTR1                0xa405013e
  # define SCSPTR4                0xa4050128
  # define SCSPTR5                0xa4050128
  # define SCIF_ORER              0x0001  /* overrun error bit */
 -# define SCSCR_INIT(port)       0x0038  /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
  #elif defined(CONFIG_CPU_SUBTYPE_SH7724)
  # define SCIF_ORER              0x0001  /* overrun error bit */
 -# define SCSCR_INIT(port) ((port)->type == PORT_SCIFA ? \
 -      0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ : \
 -      0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ )
  #elif defined(CONFIG_CPU_SUBTYPE_SH4_202)
  # define SCSPTR2 0xffe80020 /* 16 bit SCIF */
  # define SCIF_ORER 0x0001   /* overrun error bit */
 -# define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
  #elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103)
 -# define SCIF_BASE_ADDR    0x01030000
 -# define SCIF_ADDR_SH5     PHYS_PERIPHERAL_BLOCK+SCIF_BASE_ADDR
  # define SCIF_PTR2_OFFS    0x0000020
 -# define SCIF_LSR2_OFFS    0x0000024
  # define SCSPTR2           ((port->mapbase)+SCIF_PTR2_OFFS) /* 16 bit SCIF */
 -# define SCLSR2            ((port->mapbase)+SCIF_LSR2_OFFS) /* 16 bit SCIF */
 -# define SCSCR_INIT(port)  0x38               /* TIE=0,RIE=0, TE=1,RE=1,REIE=1 */
  #elif defined(CONFIG_H83007) || defined(CONFIG_H83068)
 -# define SCSCR_INIT(port)          0x30 /* TIE=0,RIE=0,TE=1,RE=1 */
  # define H8300_SCI_DR(ch) *(volatile char *)(P1DR + h8300_sci_pins[ch].port)
  #elif defined(CONFIG_H8S2678)
 -# define SCSCR_INIT(port)          0x30 /* TIE=0,RIE=0,TE=1,RE=1 */
  # define H8300_SCI_DR(ch) *(volatile char *)(P1DR + h8300_sci_pins[ch].port)
  #elif defined(CONFIG_CPU_SUBTYPE_SH7757)
  # define SCSPTR0 0xfe4b0020
  # define SCSPTR1 0xfe4b0020
  # define SCSPTR2 0xfe4b0020
  # define SCIF_ORER 0x0001
 -# define SCSCR_INIT(port)     0x38
  # define SCIF_ONLY
  #elif defined(CONFIG_CPU_SUBTYPE_SH7763)
  # define SCSPTR0 0xffe00024 /* 16 bit SCIF */
  # define SCSPTR1 0xffe08024 /* 16 bit SCIF */
  # define SCSPTR2 0xffe10020 /* 16 bit SCIF/IRDA */
  # define SCIF_ORER 0x0001  /* overrun error bit */
 -# define SCSCR_INIT(port)     0x38    /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
  #elif defined(CONFIG_CPU_SUBTYPE_SH7770)
  # define SCSPTR0 0xff923020 /* 16 bit SCIF */
  # define SCSPTR1 0xff924020 /* 16 bit SCIF */
  # define SCSPTR2 0xff925020 /* 16 bit SCIF */
  # define SCIF_ORER 0x0001  /* overrun error bit */
 -# define SCSCR_INIT(port)     0x3c /* TIE=0,RIE=0,TE=1,RE=1,REIE=1,cke=2 */
  #elif defined(CONFIG_CPU_SUBTYPE_SH7780)
  # define SCSPTR0      0xffe00024      /* 16 bit SCIF */
  # define SCSPTR1      0xffe10024      /* 16 bit SCIF */
  # define SCIF_ORER    0x0001          /* Overrun error bit */
 -
 -#if defined(CONFIG_SH_SH2007)
 -/* TIE=0,RIE=0,TE=1,RE=1,REIE=1,CKE1=0 */
 -# define SCSCR_INIT(port)     0x38
 -#else
 -/* TIE=0,RIE=0,TE=1,RE=1,REIE=1,CKE1=1 */
 -# define SCSCR_INIT(port)     0x3a
 -#endif
 -
  #elif defined(CONFIG_CPU_SUBTYPE_SH7785) || \
        defined(CONFIG_CPU_SUBTYPE_SH7786)
  # define SCSPTR0      0xffea0024      /* 16 bit SCIF */
  # define SCSPTR4      0xffee0024      /* 16 bit SCIF */
  # define SCSPTR5      0xffef0024      /* 16 bit SCIF */
  # define SCIF_ORER    0x0001          /* Overrun error bit */
 -# define SCSCR_INIT(port)     0x3a    /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
  #elif defined(CONFIG_CPU_SUBTYPE_SH7201) || \
        defined(CONFIG_CPU_SUBTYPE_SH7203) || \
        defined(CONFIG_CPU_SUBTYPE_SH7206) || \
  #  define SCSPTR6 0xfffeB020 /* 16 bit SCIF */
  #  define SCSPTR7 0xfffeB820 /* 16 bit SCIF */
  # endif
 -# define SCSCR_INIT(port)     0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
  #elif defined(CONFIG_CPU_SUBTYPE_SH7619)
  # define SCSPTR0 0xf8400020 /* 16 bit SCIF */
  # define SCSPTR1 0xf8410020 /* 16 bit SCIF */
  # define SCSPTR2 0xf8420020 /* 16 bit SCIF */
  # define SCIF_ORER 0x0001  /* overrun error bit */
 -# define SCSCR_INIT(port)     0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
  #elif defined(CONFIG_CPU_SUBTYPE_SHX3)
  # define SCSPTR0 0xffc30020           /* 16 bit SCIF */
  # define SCSPTR1 0xffc40020           /* 16 bit SCIF */
  # define SCSPTR2 0xffc50020           /* 16 bit SCIF */
  # define SCSPTR3 0xffc60020           /* 16 bit SCIF */
  # define SCIF_ORER 0x0001             /* Overrun error bit */
 -# define SCSCR_INIT(port)     0x38    /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
  #else
  # error CPU subtype not defined
  #endif
  
 -/* SCSCR */
 -#define SCI_CTRL_FLAGS_TIE  0x80 /* all */
 -#define SCI_CTRL_FLAGS_RIE  0x40 /* all */
 -#define SCI_CTRL_FLAGS_TE   0x20 /* all */
 -#define SCI_CTRL_FLAGS_RE   0x10 /* all */
 -#if defined(CONFIG_CPU_SUBTYPE_SH7750)  || \
 -    defined(CONFIG_CPU_SUBTYPE_SH7091)  || \
 -    defined(CONFIG_CPU_SUBTYPE_SH7750R) || \
 -    defined(CONFIG_CPU_SUBTYPE_SH7722)  || \
 -    defined(CONFIG_CPU_SUBTYPE_SH7750S) || \
 -    defined(CONFIG_CPU_SUBTYPE_SH7751)  || \
 -    defined(CONFIG_CPU_SUBTYPE_SH7751R) || \
 -    defined(CONFIG_CPU_SUBTYPE_SH7763)  || \
 -    defined(CONFIG_CPU_SUBTYPE_SH7780)  || \
 -    defined(CONFIG_CPU_SUBTYPE_SH7785)  || \
 -    defined(CONFIG_CPU_SUBTYPE_SH7786)  || \
 -    defined(CONFIG_CPU_SUBTYPE_SHX3)
 -#define SCI_CTRL_FLAGS_REIE 0x08 /* 7750 SCIF */
 -#elif defined(CONFIG_CPU_SUBTYPE_SH7724)
 -#define SCI_CTRL_FLAGS_REIE ((port)->type == PORT_SCIFA ? 0 : 8)
 -#else
 -#define SCI_CTRL_FLAGS_REIE 0
 -#endif
 -/*      SCI_CTRL_FLAGS_MPIE 0x08  * 7707 SCI, 7708 SCI, 7709 SCI, 7750 SCI */
 -/*      SCI_CTRL_FLAGS_TEIE 0x04  * 7707 SCI, 7708 SCI, 7709 SCI, 7750 SCI */
 -/*      SCI_CTRL_FLAGS_CKE1 0x02  * all */
 -/*      SCI_CTRL_FLAGS_CKE0 0x01  * 7707 SCI/SCIF, 7708 SCI, 7709 SCI/SCIF, 7750 SCI */
 -
  /* SCxSR SCI */
  #define SCI_TDRE  0x80 /* 7707 SCI, 7708 SCI, 7709 SCI, 7750 SCI */
  #define SCI_RDRF  0x40 /* 7707 SCI, 7708 SCI, 7709 SCI, 7750 SCI */
  /* SCFCR */
  #define SCFCR_RFRST 0x0002
  #define SCFCR_TFRST 0x0004
 -#define SCFCR_TCRST 0x4000
  #define SCFCR_MCE   0x0008
  
  #define SCI_MAJOR             204
  #define SCI_MINOR_START               8
  
 -/* Generic serial flags */
 -#define SCI_RX_THROTTLE               0x0000001
 -
 -#define SCI_MAGIC 0xbabeface
 -
 -/*
 - * Events are used to schedule things to happen at timer-interrupt
 - * time, instead of at rs interrupt time.
 - */
 -#define SCI_EVENT_WRITE_WAKEUP        0
 -
  #define SCI_IN(size, offset)                                  \
    if ((size) == 8) {                                          \
      return ioread8(port->membase + (offset));                 \
  SCIF_FNS(SCSMR,  0x00, 16)
  SCIF_FNS(SCBRR,  0x04,  8)
  SCIF_FNS(SCSCR,  0x08, 16)
 -SCIF_FNS(SCTDSR, 0x0c,  8)
 -SCIF_FNS(SCFER,  0x10, 16)
  SCIF_FNS(SCxSR,  0x14, 16)
  SCIF_FNS(SCFCR,  0x18, 16)
  SCIF_FNS(SCFDR,  0x1c, 16)
@@@ -387,6 -476,8 +387,6 @@@ SCIx_FNS(SCxTDR, 0x20,  8, 0x0c,  8
  SCIx_FNS(SCxSR,  0x14, 16, 0x10, 16)
  SCIx_FNS(SCxRDR, 0x24,  8, 0x14,  8)
  SCIx_FNS(SCSPTR, 0,     0,    0,  0)
 -SCIF_FNS(SCTDSR, 0x0c,  8)
 -SCIF_FNS(SCFER,  0x10, 16)
  SCIF_FNS(SCFCR,  0x18, 16)
  SCIF_FNS(SCFDR,  0x1c, 16)
  SCIF_FNS(SCLSR,  0x24, 16)
@@@ -412,6 -503,7 +412,6 @@@ SCIF_FNS(SCLSR,                            0,  0, 0x28, 16
  #elif defined(CONFIG_CPU_SUBTYPE_SH7763)
  SCIF_FNS(SCFDR,                               0,  0, 0x1C, 16)
  SCIF_FNS(SCSPTR2,                     0,  0, 0x20, 16)
 -SCIF_FNS(SCLSR2,                      0,  0, 0x24, 16)
  SCIF_FNS(SCTFDR,                   0x0e, 16, 0x1C, 16)
  SCIF_FNS(SCRFDR,                   0x0e, 16, 0x20, 16)
  SCIF_FNS(SCSPTR,                      0,  0, 0x24, 16)
@@@ -505,3 -597,64 +505,3 @@@ static inline int sci_rxd_in(struct uar
        return 1;
  }
  #endif
 -
 -/*
 - * Values for the BitRate Register (SCBRR)
 - *
 - * The values are actually divisors for a frequency which can
 - * be internal to the SH3 (14.7456MHz) or derived from an external
 - * clock source.  This driver assumes the internal clock is used;
 - * to support using an external clock source, config options or
 - * possibly command-line options would need to be added.
 - *
 - * Also, to support speeds below 2400 (why?) the lower 2 bits of
 - * the SCSMR register would also need to be set to non-zero values.
 - *
 - * -- Greg Banks 27Feb2000
 - *
 - * Answer: The SCBRR register is only eight bits, and the value in
 - * it gets larger with lower baud rates. At around 2400 (depending on
 - * the peripherial module clock) you run out of bits. However the
 - * lower two bits of SCSMR allow the module clock to be divided down,
 - * scaling the value which is needed in SCBRR.
 - *
 - * -- Stuart Menefy - 23 May 2000
 - *
 - * I meant, why would anyone bother with bitrates below 2400.
 - *
 - * -- Greg Banks - 7Jul2000
 - *
 - * You "speedist"!  How will I use my 110bps ASR-33 teletype with paper
 - * tape reader as a console!
 - *
 - * -- Mitch Davis - 15 Jul 2000
 - */
 -
 -#if (defined(CONFIG_CPU_SUBTYPE_SH7780)  || \
 -     defined(CONFIG_CPU_SUBTYPE_SH7785)  || \
 -     defined(CONFIG_CPU_SUBTYPE_SH7786)) && \
 -    !defined(CONFIG_SH_SH2007)
 -#define SCBRR_VALUE(bps, clk) ((clk+16*bps)/(16*bps)-1)
 -#elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \
 -      defined(CONFIG_CPU_SUBTYPE_SH7720) || \
 -      defined(CONFIG_CPU_SUBTYPE_SH7721) || \
 -      defined(CONFIG_ARCH_SH73A0) || \
 -      defined(CONFIG_ARCH_SH7367) || \
 -      defined(CONFIG_ARCH_SH7377) || \
 -      defined(CONFIG_ARCH_SH7372)
 -#define SCBRR_VALUE(bps, clk) (((clk*2)+16*bps)/(32*bps)-1)
 -#elif defined(CONFIG_CPU_SUBTYPE_SH7723) ||\
 -      defined(CONFIG_CPU_SUBTYPE_SH7724)
 -static inline int scbrr_calc(struct uart_port *port, int bps, int clk)
 -{
 -      if (port->type == PORT_SCIF)
 -              return (clk+16*bps)/(32*bps)-1;
 -      else
 -              return ((clk*2)+16*bps)/(16*bps)-1;
 -}
 -#define SCBRR_VALUE(bps, clk) scbrr_calc(port, bps, clk)
 -#elif defined(__H8300H__) || defined(__H8300S__)
 -#define SCBRR_VALUE(bps, clk) (((clk*1000/32)/bps)-1)
 -#else /* Generic SH */
 -#define SCBRR_VALUE(bps, clk) ((clk+16*bps)/(32*bps)-1)
 -#endif