| .. | .. |
|---|
| 156 | 156 | up->dl_write(up, value); |
|---|
| 157 | 157 | } |
|---|
| 158 | 158 | |
|---|
| 159 | | -static inline void serial8250_set_IER(struct uart_8250_port *up, |
|---|
| 160 | | - unsigned char ier) |
|---|
| 161 | | -{ |
|---|
| 162 | | - struct uart_port *port = &up->port; |
|---|
| 163 | | - unsigned int flags; |
|---|
| 164 | | - bool is_console; |
|---|
| 165 | | - |
|---|
| 166 | | - is_console = uart_console(port); |
|---|
| 167 | | - |
|---|
| 168 | | - if (is_console) |
|---|
| 169 | | - console_atomic_lock(&flags); |
|---|
| 170 | | - |
|---|
| 171 | | - serial_out(up, UART_IER, ier); |
|---|
| 172 | | - |
|---|
| 173 | | - if (is_console) |
|---|
| 174 | | - console_atomic_unlock(flags); |
|---|
| 175 | | -} |
|---|
| 176 | | - |
|---|
| 177 | | -static inline unsigned char serial8250_clear_IER(struct uart_8250_port *up) |
|---|
| 178 | | -{ |
|---|
| 179 | | - struct uart_port *port = &up->port; |
|---|
| 180 | | - unsigned int clearval = 0; |
|---|
| 181 | | - unsigned int prior; |
|---|
| 182 | | - unsigned int flags; |
|---|
| 183 | | - bool is_console; |
|---|
| 184 | | - |
|---|
| 185 | | - is_console = uart_console(port); |
|---|
| 186 | | - |
|---|
| 187 | | - if (up->capabilities & UART_CAP_UUE) |
|---|
| 188 | | - clearval = UART_IER_UUE; |
|---|
| 189 | | - |
|---|
| 190 | | - if (is_console) |
|---|
| 191 | | - console_atomic_lock(&flags); |
|---|
| 192 | | - |
|---|
| 193 | | - prior = serial_port_in(port, UART_IER); |
|---|
| 194 | | - serial_port_out(port, UART_IER, clearval); |
|---|
| 195 | | - |
|---|
| 196 | | - if (is_console) |
|---|
| 197 | | - console_atomic_unlock(flags); |
|---|
| 198 | | - |
|---|
| 199 | | - return prior; |
|---|
| 200 | | -} |
|---|
| 201 | | - |
|---|
| 202 | 159 | static inline bool serial8250_set_THRI(struct uart_8250_port *up) |
|---|
| 203 | 160 | { |
|---|
| 204 | 161 | if (up->ier & UART_IER_THRI) |
|---|
| .. | .. |
|---|
| 207 | 164 | #if defined(CONFIG_ARCH_ROCKCHIP) && defined(CONFIG_NO_GKI) |
|---|
| 208 | 165 | up->ier |= UART_IER_PTIME; |
|---|
| 209 | 166 | #endif |
|---|
| 210 | | - serial8250_set_IER(up, up->ier); |
|---|
| 167 | + serial_out(up, UART_IER, up->ier); |
|---|
| 211 | 168 | return true; |
|---|
| 212 | 169 | } |
|---|
| 213 | 170 | |
|---|
| .. | .. |
|---|
| 219 | 176 | #if defined(CONFIG_ARCH_ROCKCHIP) && defined(CONFIG_NO_GKI) |
|---|
| 220 | 177 | up->ier &= ~UART_IER_PTIME; |
|---|
| 221 | 178 | #endif |
|---|
| 222 | | - serial8250_set_IER(up, up->ier); |
|---|
| 179 | + serial_out(up, UART_IER, up->ier); |
|---|
| 223 | 180 | return true; |
|---|
| 224 | 181 | } |
|---|
| 225 | 182 | |
|---|
| .. | .. |
|---|
| 385 | 342 | extern void serial8250_rx_dma_flush(struct uart_8250_port *); |
|---|
| 386 | 343 | extern int serial8250_request_dma(struct uart_8250_port *); |
|---|
| 387 | 344 | extern void serial8250_release_dma(struct uart_8250_port *); |
|---|
| 345 | + |
|---|
| 346 | +static inline bool serial8250_tx_dma_running(struct uart_8250_port *p) |
|---|
| 347 | +{ |
|---|
| 348 | + struct uart_8250_dma *dma = p->dma; |
|---|
| 349 | + |
|---|
| 350 | + return dma && dma->tx_running; |
|---|
| 351 | +} |
|---|
| 388 | 352 | #else |
|---|
| 389 | 353 | static inline int serial8250_tx_dma(struct uart_8250_port *p) |
|---|
| 390 | 354 | { |
|---|
| .. | .. |
|---|
| 406 | 370 | return -1; |
|---|
| 407 | 371 | } |
|---|
| 408 | 372 | static inline void serial8250_release_dma(struct uart_8250_port *p) { } |
|---|
| 373 | + |
|---|
| 374 | +static inline bool serial8250_tx_dma_running(struct uart_8250_port *p) |
|---|
| 375 | +{ |
|---|
| 376 | + return false; |
|---|
| 377 | +} |
|---|
| 409 | 378 | #endif |
|---|
| 410 | 379 | |
|---|
| 411 | 380 | static inline int ns16550a_goto_highspeed(struct uart_8250_port *up) |
|---|