| @@ -526,6 +526,45 @@ static void atmel_enable_ms(struct uart_port *port) · 525 unmodified lines |
| 526 | UART_PUT_IER(port, ier); | 526 | UART_PUT_IER(port, ier); |
| 527 | } | 527 | } |
| 528 | | 528 | |
| | 529 | /* |
| | 530 | * Disable modem status interrupts |
| | 531 | */ |
| | 532 | static void atmel_disable_ms(struct uart_port *port) |
| | 533 | { |
| | 534 | struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); |
| | 535 | uint32_t idr = 0; |
| | 536 | |
| | 537 | /* |
| | 538 | * Interrupt should not be disabled twice |
| | 539 | */ |
| | 540 | if (!atmel_port->ms_irq_enabled) |
| | 541 | return; |
| | 542 | |
| | 543 | atmel_port->ms_irq_enabled = false; |
| | 544 | |
| | 545 | if (atmel_port->gpio_irq[UART_GPIO_CTS] >= 0) |
| | 546 | disable_irq(atmel_port->gpio_irq[UART_GPIO_CTS]); |
| | 547 | else |
| | 548 | idr |= ATMEL_US_CTSIC; |
| | 549 | |
| | 550 | if (atmel_port->gpio_irq[UART_GPIO_DSR] >= 0) |
| | 551 | disable_irq(atmel_port->gpio_irq[UART_GPIO_DSR]); |
| | 552 | else |
| | 553 | idr |= ATMEL_US_DSRIC; |
| | 554 | |
| | 555 | if (atmel_port->gpio_irq[UART_GPIO_RI] >= 0) |
| | 556 | disable_irq(atmel_port->gpio_irq[UART_GPIO_RI]); |
| | 557 | else |
| | 558 | idr |= ATMEL_US_RIIC; |
| | 559 | |
| | 560 | if (atmel_port->gpio_irq[UART_GPIO_DCD] >= 0) |
| | 561 | disable_irq(atmel_port->gpio_irq[UART_GPIO_DCD]); |
| | 562 | else |
| | 563 | idr |= ATMEL_US_DCDIC; |
| | 564 | |
| | 565 | UART_PUT_IDR(port, idr); |
| | 566 | } |
| | 567 | |
| 529 | /* | 568 | /* |
| 530 | * Control the transmission of a break signal | 569 | * Control the transmission of a break signal |
| 531 | */ | 570 | */ |
| @@ -1993,7 +2032,9 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, · 1461 unmodified lines |
| 1993 | | 2032 | |
| 1994 | /* CTS flow-control and modem-status interrupts */ | 2033 | /* CTS flow-control and modem-status interrupts */ |
| 1995 | if (UART_ENABLE_MS(port, termios->c_cflag)) | 2034 | if (UART_ENABLE_MS(port, termios->c_cflag)) |
| 1996 | port->ops->enable_ms(port); | 2035 | atmel_enable_ms(port); |
| | 2036 | else |
| | 2037 | atmel_disable_ms(port); |
| 1997 | | 2038 | |
| 1998 | spin_unlock_irqrestore(&port->lock, flags); | 2039 | spin_unlock_irqrestore(&port->lock, flags); |
| 1999 | } | 2040 | } |