lkml.org 
[lkml]   [2011]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3/3] tty: serial: Check UPF_FOURPORT, when CONFIG_SERIAL_8250_FOURPORT is defined
    Date
    When CONFIG_SERIAL_8250_FOURPORT is defined, driver uses UPF_FOURPORT in port.flags.
    Though CONFIG_SERIAL_8250_FOURPORT is not defined, there is a case to check UPF_FOURPORT.
    When CONFIG_SERIAL_8250_FOURPORT is defined only, this checks UPF_FOURPORT.

    Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
    Acked-by: Arnd Bergmann <arnd@arndb.de>
    ---
    drivers/tty/serial/8250.c | 13 +++++++++++--
    1 files changed, 11 insertions(+), 2 deletions(-)

    diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
    index 837bb39..6e16ce2 100644
    --- a/drivers/tty/serial/8250.c
    +++ b/drivers/tty/serial/8250.c
    @@ -1297,17 +1297,20 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
    static void autoconfig_irq(struct uart_8250_port *up)
    {
    unsigned char save_mcr, save_ier;
    - unsigned char save_ICP = 0;
    - unsigned int ICP = 0;
    unsigned long irqs;
    int irq;

    +#ifdef CONFIG_SERIAL_8250_FOURPORT
    + unsigned char save_ICP = 0;
    + unsigned int ICP = 0;
    +
    if (up->port.flags & UPF_FOURPORT) {
    ICP = (up->port.iobase & 0xfe0) | 0x1f;
    save_ICP = inb_p(ICP);
    outb_p(0x80, ICP);
    (void) inb_p(ICP);
    }
    +#endif /* CONFIG_SERIAL_8250_FOURPORT */

    /* forget possible initially masked and pending IRQ */
    probe_irq_off(probe_irq_on());
    @@ -1337,8 +1340,10 @@ static void autoconfig_irq(struct uart_8250_port *up)
    serial_outp(up, UART_MCR, save_mcr);
    serial_outp(up, UART_IER, save_ier);

    +#ifdef CONFIG_SERIAL_8250_FOURPORT
    if (up->port.flags & UPF_FOURPORT)
    outb_p(save_ICP, ICP);
    +#endif

    up->port.irq = (irq > 0) ? irq : 0;
    }
    @@ -2199,6 +2204,7 @@ dont_test_tx_en:
    up->ier = UART_IER_RLSI | UART_IER_RDI;
    serial_outp(up, UART_IER, up->ier);

    +#ifdef CONFIG_SERIAL_8250_FOURPORT
    if (up->port.flags & UPF_FOURPORT) {
    unsigned int icp;
    /*
    @@ -2208,6 +2214,7 @@ dont_test_tx_en:
    outb_p(0x80, icp);
    (void) inb_p(icp);
    }
    +#endif

    return 0;
    }
    @@ -2225,11 +2232,13 @@ static void serial8250_shutdown(struct uart_port *port)
    serial_outp(up, UART_IER, 0);

    spin_lock_irqsave(&up->port.lock, flags);
    +#ifdef CONFIG_SERIAL_8250_FOURPORT
    if (up->port.flags & UPF_FOURPORT) {
    /* reset interrupts on the AST Fourport board */
    inb((up->port.iobase & 0xfe0) | 0x1f);
    up->port.mctrl |= TIOCM_OUT1;
    } else
    +#endif
    up->port.mctrl &= ~TIOCM_OUT2;

    serial8250_set_mctrl(&up->port, up->port.mctrl);
    --
    1.7.2.3


    \
     
     \ /
      Last update: 2011-03-11 14:13    [W:0.022 / U:5.384 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site