sifive.c (4487cd3e5f94b8cde264d5a73d6f4b5a50494646) sifive.c (c069d2756c01ed36121fae6a42c14fdf1325c71d)
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * SiFive UART driver
4 * Copyright (C) 2018 Paul Walmsley <paul@pwsan.com>
5 * Copyright (C) 2018-2019 SiFive
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by

--- 650 unchanged lines hidden (view full) ---

659 struct ktermios *old)
660{
661 struct sifive_serial_port *ssp = port_to_sifive_serial_port(port);
662 unsigned long flags;
663 u32 v, old_v;
664 int rate;
665 char nstop;
666
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * SiFive UART driver
4 * Copyright (C) 2018 Paul Walmsley <paul@pwsan.com>
5 * Copyright (C) 2018-2019 SiFive
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by

--- 650 unchanged lines hidden (view full) ---

659 struct ktermios *old)
660{
661 struct sifive_serial_port *ssp = port_to_sifive_serial_port(port);
662 unsigned long flags;
663 u32 v, old_v;
664 int rate;
665 char nstop;
666
667 if ((termios->c_cflag & CSIZE) != CS8)
667 if ((termios->c_cflag & CSIZE) != CS8) {
668 dev_err_once(ssp->port.dev, "only 8-bit words supported\n");
668 dev_err_once(ssp->port.dev, "only 8-bit words supported\n");
669 termios->c_cflag &= ~CSIZE;
670 termios->c_cflag |= CS8;
671 }
669 if (termios->c_iflag & (INPCK | PARMRK))
670 dev_err_once(ssp->port.dev, "parity checking not supported\n");
671 if (termios->c_iflag & BRKINT)
672 dev_err_once(ssp->port.dev, "BREAK detection not supported\n");
672 if (termios->c_iflag & (INPCK | PARMRK))
673 dev_err_once(ssp->port.dev, "parity checking not supported\n");
674 if (termios->c_iflag & BRKINT)
675 dev_err_once(ssp->port.dev, "BREAK detection not supported\n");
676 termios->c_iflag &= ~(INPCK|PARMRK|BRKINT);
673
674 /* Set number of stop bits */
675 nstop = (termios->c_cflag & CSTOPB) ? 2 : 1;
676 __ssp_set_stop_bits(ssp, nstop);
677
678 /* Set line rate */
679 rate = uart_get_baud_rate(port, termios, old, 0,
680 ssp->port.uartclk / 16);

--- 419 unchanged lines hidden ---
677
678 /* Set number of stop bits */
679 nstop = (termios->c_cflag & CSTOPB) ? 2 : 1;
680 __ssp_set_stop_bits(ssp, nstop);
681
682 /* Set line rate */
683 rate = uart_get_baud_rate(port, termios, old, 0,
684 ssp->port.uartclk / 16);

--- 419 unchanged lines hidden ---