st-asc.c (651a88798412e216f337d70181127e847f00a4b7) st-asc.c (52bb1cb7118564166b04d52387bd8403632f5190)
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * st-asc.c: ST Asynchronous serial controller (ASC) driver
4 *
5 * Copyright (C) 2003-2013 STMicroelectronics (R&D) Limited
6 */
7
8#include <linux/module.h>

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

530
531 /* reset fifo rx & tx */
532 asc_out(port, ASC_TXRESET, 1);
533 asc_out(port, ASC_RXRESET, 1);
534
535 /* set character length */
536 if ((cflag & CSIZE) == CS7) {
537 ctrl_val |= ASC_CTL_MODE_7BIT_PAR;
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * st-asc.c: ST Asynchronous serial controller (ASC) driver
4 *
5 * Copyright (C) 2003-2013 STMicroelectronics (R&D) Limited
6 */
7
8#include <linux/module.h>

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

530
531 /* reset fifo rx & tx */
532 asc_out(port, ASC_TXRESET, 1);
533 asc_out(port, ASC_RXRESET, 1);
534
535 /* set character length */
536 if ((cflag & CSIZE) == CS7) {
537 ctrl_val |= ASC_CTL_MODE_7BIT_PAR;
538 cflag |= PARENB;
538 } else {
539 ctrl_val |= (cflag & PARENB) ? ASC_CTL_MODE_8BIT_PAR :
540 ASC_CTL_MODE_8BIT;
539 } else {
540 ctrl_val |= (cflag & PARENB) ? ASC_CTL_MODE_8BIT_PAR :
541 ASC_CTL_MODE_8BIT;
542 cflag &= ~CSIZE;
543 cflag |= CS8;
541 }
544 }
545 termios->c_cflag = cflag;
542
543 /* set stop bit */
544 ctrl_val |= (cflag & CSTOPB) ? ASC_CTL_STOP_2BIT : ASC_CTL_STOP_1BIT;
545
546 /* odd parity */
547 if (cflag & PARODD)
548 ctrl_val |= ASC_CTL_PARITYODD;
549

--- 457 unchanged lines hidden ---
546
547 /* set stop bit */
548 ctrl_val |= (cflag & CSTOPB) ? ASC_CTL_STOP_2BIT : ASC_CTL_STOP_1BIT;
549
550 /* odd parity */
551 if (cflag & PARODD)
552 ctrl_val |= ASC_CTL_PARITYODD;
553

--- 457 unchanged lines hidden ---