stm32-usart.c (2a3bcfe03725472607110507b6860d823e0deb41) | stm32-usart.c (195437d14fb424a2ee50d51441181f16fd549789) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (C) Maxime Coquelin 2015 4 * Copyright (C) STMicroelectronics SA 2017 5 * Authors: Maxime Coquelin <mcoquelin.stm32@gmail.com> 6 * Gerald Baeza <gerald.baeza@foss.st.com> 7 * Erwan Le Ray <erwan.leray@foss.st.com> 8 * --- 463 unchanged lines hidden (view full) --- 472} 473 474static void stm32_usart_transmit_chars_dma(struct uart_port *port) 475{ 476 struct stm32_port *stm32port = to_stm32_port(port); 477 const struct stm32_usart_offsets *ofs = &stm32port->info->ofs; 478 struct circ_buf *xmit = &port->state->xmit; 479 struct dma_async_tx_descriptor *desc = NULL; | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (C) Maxime Coquelin 2015 4 * Copyright (C) STMicroelectronics SA 2017 5 * Authors: Maxime Coquelin <mcoquelin.stm32@gmail.com> 6 * Gerald Baeza <gerald.baeza@foss.st.com> 7 * Erwan Le Ray <erwan.leray@foss.st.com> 8 * --- 463 unchanged lines hidden (view full) --- 472} 473 474static void stm32_usart_transmit_chars_dma(struct uart_port *port) 475{ 476 struct stm32_port *stm32port = to_stm32_port(port); 477 const struct stm32_usart_offsets *ofs = &stm32port->info->ofs; 478 struct circ_buf *xmit = &port->state->xmit; 479 struct dma_async_tx_descriptor *desc = NULL; |
480 unsigned int count, i; | 480 unsigned int count; |
481 482 if (stm32_usart_tx_dma_started(stm32port)) { 483 if (!stm32_usart_tx_dma_enabled(stm32port)) 484 stm32_usart_set_bits(port, ofs->cr3, USART_CR3_DMAT); 485 return; 486 } 487 488 count = uart_circ_chars_pending(xmit); --- 48 unchanged lines hidden (view full) --- 537 538 stm32_usart_set_bits(port, ofs->cr3, USART_CR3_DMAT); 539 540 xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE - 1); 541 port->icount.tx += count; 542 return; 543 544fallback_err: | 481 482 if (stm32_usart_tx_dma_started(stm32port)) { 483 if (!stm32_usart_tx_dma_enabled(stm32port)) 484 stm32_usart_set_bits(port, ofs->cr3, USART_CR3_DMAT); 485 return; 486 } 487 488 count = uart_circ_chars_pending(xmit); --- 48 unchanged lines hidden (view full) --- 537 538 stm32_usart_set_bits(port, ofs->cr3, USART_CR3_DMAT); 539 540 xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE - 1); 541 port->icount.tx += count; 542 return; 543 544fallback_err: |
545 for (i = count; i > 0; i--) 546 stm32_usart_transmit_chars_pio(port); | 545 stm32_usart_transmit_chars_pio(port); |
547} 548 549static void stm32_usart_transmit_chars(struct uart_port *port) 550{ 551 struct stm32_port *stm32_port = to_stm32_port(port); 552 const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; 553 struct circ_buf *xmit = &port->state->xmit; 554 --- 1339 unchanged lines hidden --- | 546} 547 548static void stm32_usart_transmit_chars(struct uart_port *port) 549{ 550 struct stm32_port *stm32_port = to_stm32_port(port); 551 const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; 552 struct circ_buf *xmit = &port->state->xmit; 553 --- 1339 unchanged lines hidden --- |