Lines Matching refs:up

89 static void mtk8250_rx_dma(struct uart_8250_port *up);
93 struct uart_8250_port *up = param; in mtk8250_dma_rx_complete() local
94 struct uart_8250_dma *dma = up->dma; in mtk8250_dma_rx_complete()
95 struct mtk8250_data *data = up->port.private_data; in mtk8250_dma_rx_complete()
96 struct tty_port *tty_port = &up->port.state->port; in mtk8250_dma_rx_complete()
105 spin_lock_irqsave(&up->port.lock, flags); in mtk8250_dma_rx_complete()
125 up->port.icount.rx += copied; in mtk8250_dma_rx_complete()
129 mtk8250_rx_dma(up); in mtk8250_dma_rx_complete()
131 spin_unlock_irqrestore(&up->port.lock, flags); in mtk8250_dma_rx_complete()
134 static void mtk8250_rx_dma(struct uart_8250_port *up) in mtk8250_rx_dma() argument
136 struct uart_8250_dma *dma = up->dma; in mtk8250_rx_dma()
148 desc->callback_param = up; in mtk8250_rx_dma()
155 static void mtk8250_dma_enable(struct uart_8250_port *up) in mtk8250_dma_enable() argument
157 struct uart_8250_dma *dma = up->dma; in mtk8250_dma_enable()
158 struct mtk8250_data *data = up->port.private_data; in mtk8250_dma_enable()
159 int lcr = serial_in(up, UART_LCR); in mtk8250_dma_enable()
170 serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | in mtk8250_dma_enable()
172 serial_out(up, MTK_UART_DMA_EN, in mtk8250_dma_enable()
175 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); in mtk8250_dma_enable()
176 serial_out(up, MTK_UART_EFR, UART_EFR_ECB); in mtk8250_dma_enable()
177 serial_out(up, UART_LCR, lcr); in mtk8250_dma_enable()
186 mtk8250_rx_dma(up); in mtk8250_dma_enable()
193 struct uart_8250_port *up = up_to_u8250p(port); in mtk8250_startup() local
198 up->dma = NULL; in mtk8250_startup()
200 if (up->dma) { in mtk8250_startup()
213 struct uart_8250_port *up = up_to_u8250p(port); in mtk8250_shutdown() local
216 if (up->dma) in mtk8250_shutdown()
223 static void mtk8250_disable_intrs(struct uart_8250_port *up, int mask) in mtk8250_disable_intrs() argument
226 lockdep_assert_held_once(&up->port.lock); in mtk8250_disable_intrs()
228 serial_out(up, UART_IER, serial_in(up, UART_IER) & (~mask)); in mtk8250_disable_intrs()
231 static void mtk8250_enable_intrs(struct uart_8250_port *up, int mask) in mtk8250_enable_intrs() argument
234 lockdep_assert_held_once(&up->port.lock); in mtk8250_enable_intrs()
236 serial_out(up, UART_IER, serial_in(up, UART_IER) | mask); in mtk8250_enable_intrs()
239 static void mtk8250_set_flow_ctrl(struct uart_8250_port *up, int mode) in mtk8250_set_flow_ctrl() argument
241 struct uart_port *port = &up->port; in mtk8250_set_flow_ctrl()
242 int lcr = serial_in(up, UART_LCR); in mtk8250_set_flow_ctrl()
247 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); in mtk8250_set_flow_ctrl()
248 serial_out(up, MTK_UART_EFR, UART_EFR_ECB); in mtk8250_set_flow_ctrl()
249 serial_out(up, UART_LCR, lcr); in mtk8250_set_flow_ctrl()
250 lcr = serial_in(up, UART_LCR); in mtk8250_set_flow_ctrl()
254 serial_out(up, MTK_UART_ESCAPE_DAT, MTK_UART_ESCAPE_CHAR); in mtk8250_set_flow_ctrl()
255 serial_out(up, MTK_UART_ESCAPE_EN, 0x00); in mtk8250_set_flow_ctrl()
256 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); in mtk8250_set_flow_ctrl()
257 serial_out(up, MTK_UART_EFR, serial_in(up, MTK_UART_EFR) & in mtk8250_set_flow_ctrl()
259 serial_out(up, UART_LCR, lcr); in mtk8250_set_flow_ctrl()
260 mtk8250_disable_intrs(up, MTK_UART_IER_XOFFI | in mtk8250_set_flow_ctrl()
265 serial_out(up, MTK_UART_ESCAPE_DAT, MTK_UART_ESCAPE_CHAR); in mtk8250_set_flow_ctrl()
266 serial_out(up, MTK_UART_ESCAPE_EN, 0x00); in mtk8250_set_flow_ctrl()
267 serial_out(up, UART_MCR, UART_MCR_RTS); in mtk8250_set_flow_ctrl()
268 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); in mtk8250_set_flow_ctrl()
271 serial_out(up, MTK_UART_EFR, MTK_UART_EFR_HW_FC | in mtk8250_set_flow_ctrl()
272 (serial_in(up, MTK_UART_EFR) & in mtk8250_set_flow_ctrl()
275 serial_out(up, UART_LCR, lcr); in mtk8250_set_flow_ctrl()
276 mtk8250_disable_intrs(up, MTK_UART_IER_XOFFI); in mtk8250_set_flow_ctrl()
277 mtk8250_enable_intrs(up, MTK_UART_IER_CTSI | MTK_UART_IER_RTSI); in mtk8250_set_flow_ctrl()
281 serial_out(up, MTK_UART_ESCAPE_DAT, MTK_UART_ESCAPE_CHAR); in mtk8250_set_flow_ctrl()
282 serial_out(up, MTK_UART_ESCAPE_EN, 0x01); in mtk8250_set_flow_ctrl()
283 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); in mtk8250_set_flow_ctrl()
286 serial_out(up, MTK_UART_EFR, MTK_UART_EFR_XON1_XOFF1 | in mtk8250_set_flow_ctrl()
287 (serial_in(up, MTK_UART_EFR) & in mtk8250_set_flow_ctrl()
290 serial_out(up, MTK_UART_XON1, START_CHAR(port->state->port.tty)); in mtk8250_set_flow_ctrl()
291 serial_out(up, MTK_UART_XOFF1, STOP_CHAR(port->state->port.tty)); in mtk8250_set_flow_ctrl()
292 serial_out(up, UART_LCR, lcr); in mtk8250_set_flow_ctrl()
293 mtk8250_disable_intrs(up, MTK_UART_IER_CTSI|MTK_UART_IER_RTSI); in mtk8250_set_flow_ctrl()
294 mtk8250_enable_intrs(up, MTK_UART_IER_XOFFI); in mtk8250_set_flow_ctrl()
311 struct uart_8250_port *up = up_to_u8250p(port); in mtk8250_set_termios() local
317 if (up->dma) { in mtk8250_set_termios()
319 devm_kfree(up->port.dev, up->dma); in mtk8250_set_termios()
320 up->dma = NULL; in mtk8250_set_termios()
322 mtk8250_dma_enable(up); in mtk8250_set_termios()
379 serial_port_out(port, UART_LCR, up->lcr | UART_LCR_DLAB); in mtk8250_set_termios()
380 serial_dl_write(up, quot); in mtk8250_set_termios()
383 serial_port_out(port, UART_LCR, up->lcr); in mtk8250_set_termios()
414 mtk8250_set_flow_ctrl(up, mode); in mtk8250_set_termios()
417 up->port.cons->cflag = termios->c_cflag; in mtk8250_set_termios()
428 struct uart_8250_port *up = serial8250_get_port(data->line); in mtk8250_runtime_suspend() local
432 (serial_in(up, MTK_UART_DEBUG0)); in mtk8250_runtime_suspend()