Lines Matching +full:auto +full:- +full:baud
1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2014-2016 Ricardo Ribalda, Qtechnology A/S
105 outb(reg, pdata->base_port + ADDR_PORT); in sio_read_reg()
106 return inb(pdata->base_port + DATA_PORT); in sio_read_reg()
111 outb(reg, pdata->base_port + ADDR_PORT); in sio_write_reg()
112 outb(data, pdata->base_port + DATA_PORT); in sio_write_reg()
127 return -EBUSY; in fintek_8250_enter_key()
149 return -ENODEV; in fintek_8250_check_id()
152 return -ENODEV; in fintek_8250_check_id()
167 return -ENODEV; in fintek_8250_check_id()
170 pdata->pid = chip; in fintek_8250_check_id()
177 switch (pdata->pid) { in fintek_8250_get_ldn_range()
194 return -ENODEV; in fintek_8250_get_ldn_range()
201 struct fintek_8250 *pdata = port->private_data; in fintek_8250_rs485_config()
204 return -EINVAL; in fintek_8250_rs485_config()
207 if (rs485->flags & SER_RS485_ENABLED) { in fintek_8250_rs485_config()
209 if (!(rs485->flags & SER_RS485_RTS_ON_SEND) == in fintek_8250_rs485_config()
210 !(rs485->flags & SER_RS485_RTS_AFTER_SEND)) in fintek_8250_rs485_config()
211 return -EINVAL; in fintek_8250_rs485_config()
215 if (rs485->delay_rts_before_send) { in fintek_8250_rs485_config()
216 rs485->delay_rts_before_send = 1; in fintek_8250_rs485_config()
220 if (rs485->delay_rts_after_send) { in fintek_8250_rs485_config()
221 rs485->delay_rts_after_send = 1; in fintek_8250_rs485_config()
225 if (rs485->flags & SER_RS485_RTS_ON_SEND) in fintek_8250_rs485_config()
228 if (fintek_8250_enter_key(pdata->base_port, pdata->key)) in fintek_8250_rs485_config()
229 return -EBUSY; in fintek_8250_rs485_config()
231 sio_write_reg(pdata, LDN, pdata->index); in fintek_8250_rs485_config()
233 fintek_8250_exit_key(pdata->base_port); in fintek_8250_rs485_config()
240 sio_write_reg(pdata, LDN, pdata->index); in fintek_8250_set_irq_mode()
242 switch (pdata->pid) { in fintek_8250_set_irq_mode()
269 switch (pdata->pid) { in fintek_8250_set_max_fifo()
288 struct fintek_8250 *pdata = port->private_data; in fintek_8250_set_termios()
289 unsigned int baud = tty_termios_baud_rate(termios); in fintek_8250_set_termios() local
298 * We'll use serial8250_do_set_termios() for baud = 0, otherwise It'll in fintek_8250_set_termios()
299 * crash on baudrate_table[i] % baud with "division by zero". in fintek_8250_set_termios()
301 if (!baud) in fintek_8250_set_termios()
304 switch (pdata->pid) { in fintek_8250_set_termios()
315 dev_warn(port->dev, in fintek_8250_set_termios()
317 __func__, pdata->pid); in fintek_8250_set_termios()
322 if (baud > baudrate_table[i] || baudrate_table[i] % baud != 0) in fintek_8250_set_termios()
325 if (port->uartclk == baudrate_table[i] * 16) in fintek_8250_set_termios()
328 if (fintek_8250_enter_key(pdata->base_port, pdata->key)) in fintek_8250_set_termios()
331 port->uartclk = baudrate_table[i] * 16; in fintek_8250_set_termios()
333 sio_write_reg(pdata, LDN, pdata->index); in fintek_8250_set_termios()
337 fintek_8250_exit_key(pdata->base_port); in fintek_8250_set_termios()
342 baud = tty_termios_baud_rate(old); in fintek_8250_set_termios()
343 tty_termios_encode_baud_rate(termios, baud, baud); in fintek_8250_set_termios()
352 struct fintek_8250 *pdata = uart->port.private_data; in fintek_8250_set_termios_handler()
354 switch (pdata->pid) { in fintek_8250_set_termios_handler()
359 uart->port.set_termios = fintek_8250_set_termios; in fintek_8250_set_termios_handler()
378 pdata->base_port = addr[i]; in probe_setup_port()
379 pdata->key = keys[j]; in probe_setup_port()
395 if (aux != uart->port.iobase) in probe_setup_port()
398 pdata->index = k; in probe_setup_port()
400 irq_data = irq_get_irq_data(uart->port.irq); in probe_setup_port()
417 return -ENODEV; in probe_setup_port()
433 struct fintek_8250 *pdata = uart->port.private_data; in fintek_8250_set_rs485_handler()
435 switch (pdata->pid) { in fintek_8250_set_rs485_handler()
441 uart->port.rs485_config = fintek_8250_rs485_config; in fintek_8250_set_rs485_handler()
442 if (!pdata->index) in fintek_8250_set_rs485_handler()
443 uart->port.rs485_supported = fintek_8250_rs485_supported_port0; in fintek_8250_set_rs485_handler()
445 uart->port.rs485_supported = fintek_8250_rs485_supported; in fintek_8250_set_rs485_handler()
449 uart->port.rs485_config = fintek_8250_rs485_config; in fintek_8250_set_rs485_handler()
450 uart->port.rs485_supported = fintek_8250_rs485_supported; in fintek_8250_set_rs485_handler()
453 default: /* No RS485 Auto direction functional */ in fintek_8250_set_rs485_handler()
464 return -ENODEV; in fintek_8250_probe()
466 pdata = devm_kzalloc(uart->port.dev, sizeof(*pdata), GFP_KERNEL); in fintek_8250_probe()
468 return -ENOMEM; in fintek_8250_probe()
471 uart->port.private_data = pdata; in fintek_8250_probe()