@@ -1570,12 +1570,13 @@ static inline void up_setusartint(struct up_dev_s *priv, uint16_t ie)
15701570 up_serialout (priv , STM32_USART_CR3_OFFSET , cr );
15711571}
15721572
1573+ #if !defined(SERIAL_HAVE_ONLY_DMA ) || defined(CONFIG_PM ) || \
1574+ defined(HAVE_RS485 )
1575+
15731576/****************************************************************************
15741577 * Name: up_restoreusartint
15751578 ****************************************************************************/
15761579
1577- #if !defined(SERIAL_HAVE_ONLY_DMA ) || defined(CONFIG_PM ) || \
1578- defined(HAVE_RS485 )
15791580static void up_restoreusartint (struct up_dev_s * priv , uint16_t ie )
15801581{
15811582 irqstate_t flags ;
@@ -1643,6 +1644,8 @@ static void up_disableusartint(struct up_dev_s *priv, uint16_t *ie)
16431644 spin_unlock_irqrestore (& priv -> lock , flags );
16441645}
16451646
1647+ #ifdef SERIAL_HAVE_RXDMA
1648+
16461649/****************************************************************************
16471650 * Name: up_dma_nextrx
16481651 *
@@ -1652,7 +1655,6 @@ static void up_disableusartint(struct up_dev_s *priv, uint16_t *ie)
16521655 *
16531656 ****************************************************************************/
16541657
1655- #ifdef SERIAL_HAVE_RXDMA
16561658static int up_dma_nextrx (struct up_dev_s * priv )
16571659{
16581660 size_t dmaresidual ;
@@ -1663,6 +1665,8 @@ static int up_dma_nextrx(struct up_dev_s *priv)
16631665}
16641666#endif
16651667
1668+ #ifdef CONFIG_PM
1669+
16661670/****************************************************************************
16671671 * Name: up_setsuspend
16681672 *
@@ -1671,7 +1675,6 @@ static int up_dma_nextrx(struct up_dev_s *priv)
16711675 *
16721676 ****************************************************************************/
16731677
1674- #ifdef CONFIG_PM
16751678static void up_setsuspend (struct uart_dev_s * dev , bool suspend )
16761679{
16771680 struct up_dev_s * priv = (struct up_dev_s * )dev -> priv ;
@@ -1776,6 +1779,8 @@ static void up_setsuspend(struct uart_dev_s *dev, bool suspend)
17761779}
17771780#endif
17781781
1782+ #ifdef CONFIG_PM
1783+
17791784/****************************************************************************
17801785 * Name: up_pm_setsuspend
17811786 *
@@ -1784,7 +1789,6 @@ static void up_setsuspend(struct uart_dev_s *dev, bool suspend)
17841789 *
17851790 ****************************************************************************/
17861791
1787- #ifdef CONFIG_PM
17881792static void up_pm_setsuspend (bool suspend )
17891793{
17901794 int n ;
@@ -2766,6 +2770,8 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
27662770 return ret ;
27672771}
27682772
2773+ #ifndef SERIAL_HAVE_ONLY_RXDMA
2774+
27692775/****************************************************************************
27702776 * Name: up_receive
27712777 *
@@ -2776,7 +2782,6 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
27762782 *
27772783 ****************************************************************************/
27782784
2779- #ifndef SERIAL_HAVE_ONLY_RXDMA
27802785static int up_receive (struct uart_dev_s * dev , unsigned int * status )
27812786{
27822787 struct up_dev_s * priv = (struct up_dev_s * )dev -> priv ;
@@ -2797,6 +2802,8 @@ static int up_receive(struct uart_dev_s *dev, unsigned int *status)
27972802}
27982803#endif
27992804
2805+ #ifndef SERIAL_HAVE_ONLY_RXDMA
2806+
28002807/****************************************************************************
28012808 * Name: up_rxint
28022809 *
@@ -2805,7 +2812,6 @@ static int up_receive(struct uart_dev_s *dev, unsigned int *status)
28052812 *
28062813 ****************************************************************************/
28072814
2808- #ifndef SERIAL_HAVE_ONLY_RXDMA
28092815static void up_rxint (struct uart_dev_s * dev , bool enable )
28102816{
28112817 struct up_dev_s * priv = (struct up_dev_s * )dev -> priv ;
@@ -2856,6 +2862,8 @@ static void up_rxint(struct uart_dev_s *dev, bool enable)
28562862}
28572863#endif
28582864
2865+ #ifndef SERIAL_HAVE_ONLY_RXDMA
2866+
28592867/****************************************************************************
28602868 * Name: up_rxavailable
28612869 *
@@ -2864,14 +2872,15 @@ static void up_rxint(struct uart_dev_s *dev, bool enable)
28642872 *
28652873 ****************************************************************************/
28662874
2867- #ifndef SERIAL_HAVE_ONLY_RXDMA
28682875static bool up_rxavailable (struct uart_dev_s * dev )
28692876{
28702877 struct up_dev_s * priv = (struct up_dev_s * )dev -> priv ;
28712878 return ((up_serialin (priv , STM32_USART_ISR_OFFSET ) & USART_ISR_RXNE ) != 0 );
28722879}
28732880#endif
28742881
2882+ #ifdef CONFIG_SERIAL_IFLOWCONTROL
2883+
28752884/****************************************************************************
28762885 * Name: up_rxflowcontrol
28772886 *
@@ -2895,7 +2904,6 @@ static bool up_rxavailable(struct uart_dev_s *dev)
28952904 *
28962905 ****************************************************************************/
28972906
2898- #ifdef CONFIG_SERIAL_IFLOWCONTROL
28992907static bool up_rxflowcontrol (struct uart_dev_s * dev ,
29002908 unsigned int nbuffered , bool upper )
29012909{
@@ -2968,6 +2976,8 @@ static bool up_rxflowcontrol(struct uart_dev_s *dev,
29682976}
29692977#endif
29702978
2979+ #ifdef SERIAL_HAVE_RXDMA
2980+
29712981/****************************************************************************
29722982 * Name: up_dma_receive
29732983 *
@@ -2978,7 +2988,6 @@ static bool up_rxflowcontrol(struct uart_dev_s *dev,
29782988 *
29792989 ****************************************************************************/
29802990
2981- #ifdef SERIAL_HAVE_RXDMA
29822991static int up_dma_receive (struct uart_dev_s * dev , unsigned int * status )
29832992{
29842993 struct up_dev_s * priv = (struct up_dev_s * )dev -> priv ;
@@ -3305,6 +3314,8 @@ static void up_send(struct uart_dev_s *dev, int ch)
33053314 up_serialout (priv , STM32_USART_TDR_OFFSET , (uint32_t )ch );
33063315}
33073316
3317+
3318+ #ifdef SERIAL_HAVE_TXDMA
33083319/****************************************************************************
33093320 * Name: up_dma_txint
33103321 *
@@ -3313,7 +3324,7 @@ static void up_send(struct uart_dev_s *dev, int ch)
33133324 *
33143325 ****************************************************************************/
33153326
3316- #ifdef SERIAL_HAVE_TXDMA
3327+
33173328static void up_dma_txint (struct uart_dev_s * dev , bool enable )
33183329{
33193330 /* Nothing to do. */
0 commit comments