/drivers/usb/serial/ |
D | cp210x.c | 601 static unsigned int cp210x_quantise_baudrate(unsigned int baud) in cp210x_quantise_baudrate() argument 603 if (baud <= 300) in cp210x_quantise_baudrate() 604 baud = 300; in cp210x_quantise_baudrate() 605 else if (baud <= 600) baud = 600; in cp210x_quantise_baudrate() 606 else if (baud <= 1200) baud = 1200; in cp210x_quantise_baudrate() 607 else if (baud <= 1800) baud = 1800; in cp210x_quantise_baudrate() 608 else if (baud <= 2400) baud = 2400; in cp210x_quantise_baudrate() 609 else if (baud <= 4000) baud = 4000; in cp210x_quantise_baudrate() 610 else if (baud <= 4803) baud = 4800; in cp210x_quantise_baudrate() 611 else if (baud <= 7207) baud = 7200; in cp210x_quantise_baudrate() [all …]
|
D | pl2303.c | 336 static speed_t pl2303_get_supported_baud_rate(speed_t baud) in pl2303_get_supported_baud_rate() argument 347 if (baud_sup[i] > baud) in pl2303_get_supported_baud_rate() 352 baud = baud_sup[i - 1]; in pl2303_get_supported_baud_rate() 353 else if (i > 0 && (baud_sup[i] - baud) > (baud - baud_sup[i - 1])) in pl2303_get_supported_baud_rate() 354 baud = baud_sup[i - 1]; in pl2303_get_supported_baud_rate() 356 baud = baud_sup[i]; in pl2303_get_supported_baud_rate() 358 return baud; in pl2303_get_supported_baud_rate() 366 speed_t baud) in pl2303_encode_baud_rate_direct() argument 368 put_unaligned_le32(baud, buf); in pl2303_encode_baud_rate_direct() 370 return baud; in pl2303_encode_baud_rate_direct() [all …]
|
D | iuu_phoenix.c | 66 u32 baud; member 804 u32 baud; in iuu_uart_baud() local 817 baud = baud_base; in iuu_uart_baud() 819 if (baud < 1200 || baud > 230400) { in iuu_uart_baud() 823 if (baud > 977) { in iuu_uart_baud() 828 if (baud > 3906) { in iuu_uart_baud() 833 if (baud > 11718) { in iuu_uart_baud() 838 if (baud > 46875) { in iuu_uart_baud() 843 T1reload = 256 - (u8) (T1FrekvensHZ / (baud * 2)); in iuu_uart_baud() 907 int baud; in iuu_set_termios() local [all …]
|
D | console.c | 61 int baud = 9600; in usb_console_setup() local 74 baud = simple_strtoul(options, NULL, 10); in usb_console_setup() 87 if (baud == 0) in usb_console_setup() 88 baud = 9600; in usb_console_setup() 165 tty_termios_encode_baud_rate(&tty->termios, baud, baud); in usb_console_setup()
|
D | ftdi_sio.c | 1068 static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base); 1069 static unsigned short int ftdi_232am_baud_to_divisor(int baud); 1070 static __u32 ftdi_232bm_baud_base_to_divisor(int baud, int base); 1071 static __u32 ftdi_232bm_baud_to_divisor(int baud); 1072 static __u32 ftdi_2232h_baud_base_to_divisor(int baud, int base); 1073 static __u32 ftdi_2232h_baud_to_divisor(int baud); 1118 static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base) in ftdi_232am_baud_base_to_divisor() argument 1122 int divisor3 = base / 2 / baud; in ftdi_232am_baud_base_to_divisor() 1138 static unsigned short int ftdi_232am_baud_to_divisor(int baud) in ftdi_232am_baud_to_divisor() argument 1140 return ftdi_232am_baud_base_to_divisor(baud, 48000000); in ftdi_232am_baud_to_divisor() [all …]
|
D | ir-usb.c | 323 speed_t baud; in ir_set_termios() local 326 baud = tty_get_baud_rate(tty); in ir_set_termios() 334 switch (baud) { in ir_set_termios() 364 baud = 9600; in ir_set_termios() 374 tty_encode_baud_rate(tty, baud, baud); in ir_set_termios()
|
/drivers/tty/serial/8250/ |
D | 8250_mtk.c | 46 unsigned int baud, quot; in mtk8250_set_termios() local 63 baud = uart_get_baud_rate(port, termios, old, in mtk8250_set_termios() 67 if (baud <= 115200) { in mtk8250_set_termios() 69 quot = uart_get_divisor(port, baud); in mtk8250_set_termios() 70 } else if (baud <= 576000) { in mtk8250_set_termios() 74 if ((baud == 500000) || (baud == 576000)) in mtk8250_set_termios() 75 baud = 460800; in mtk8250_set_termios() 76 quot = DIV_ROUND_UP(port->uartclk, 4 * baud); in mtk8250_set_termios() 79 quot = DIV_ROUND_UP(port->uartclk, 256 * baud); in mtk8250_set_termios() 95 if (baud > 460800) { in mtk8250_set_termios() [all …]
|
/drivers/net/hamradio/ |
D | baycom_ser_fdx.c | 130 unsigned int baud, baud_us, baud_arbdiv, baud_uartdiv, baud_dcdtimeout; member 429 if (bc->baud < 300 || bc->baud > 4800) { in ser12_open() 440 bc->hdrv.par.bitrate = bc->baud; in ser12_open() 441 bc->baud_us = 1000000/bc->baud; in ser12_open() 442 bc->baud_uartdiv = (115200/8)/bc->baud; in ser12_open() 475 bc_drvname, dev->base_addr, dev->irq, bc->baud, uart_str[u]); in ser12_open() 523 unsigned int baud; in baycom_setmode() local 526 baud = simple_strtoul(modestr+3, NULL, 10); in baycom_setmode() 527 if (baud >= 3 && baud <= 48) in baycom_setmode() 528 bc->baud = baud*100; in baycom_setmode() [all …]
|
/drivers/tty/serial/ |
D | suncore.c | 88 int baud, bits, stop, cflag; in sunserial_console_termios() local 119 baud = simple_strtoul(s, NULL, 0); in sunserial_console_termios() 129 switch (baud) { in sunserial_console_termios() 143 default: baud = 9600; cflag |= B9600; break; in sunserial_console_termios() 170 int baud; member 185 for (i = 0; mouse_baud_table[i].baud != -1; i++) in suncore_mouse_baud_cflag_next() 190 if (mouse_baud_table[i].baud == -1) in suncore_mouse_baud_cflag_next() 193 *new_baud = mouse_baud_table[i].baud; in suncore_mouse_baud_cflag_next()
|
D | ar933x_uart.c | 204 unsigned int baud, in ar933x_uart_get_scale_step() argument 214 min_diff = baud; in ar933x_uart_get_scale_step() 219 tstep = baud * (tscale + 1); in ar933x_uart_get_scale_step() 226 diff = abs(ar933x_uart_get_baud(clk, tscale, tstep) - baud); in ar933x_uart_get_scale_step() 243 unsigned int baud, scale, step; in ar933x_uart_set_termios() local 265 baud = uart_get_baud_rate(port, new, old, up->min_baud, up->max_baud); in ar933x_uart_set_termios() 266 ar933x_uart_get_scale_step(port->uartclk, baud, &scale, &step); in ar933x_uart_set_termios() 279 uart_update_timeout(port, new->c_cflag, baud); in ar933x_uart_set_termios() 305 tty_termios_encode_baud_rate(new, baud, baud); in ar933x_uart_set_termios() 583 int baud = 115200; in ar933x_uart_console_setup() local [all …]
|
D | 21285.c | 213 unsigned int baud, quot, h_lcr, b; in serial21285_set_termios() local 229 baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); in serial21285_set_termios() 230 quot = uart_get_divisor(port, baud); in serial21285_set_termios() 265 uart_update_timeout(port, termios->c_cflag, baud); in serial21285_set_termios() 385 serial21285_get_options(struct uart_port *port, int *baud, in serial21285_get_options() argument 416 *baud = port->uartclk / (16 * (tmp + 1)); in serial21285_get_options() 423 int baud = 9600; in serial21285_console_setup() local 429 baud = 57600; in serial21285_console_setup() 437 uart_parse_options(options, &baud, &parity, &bits, &flow); in serial21285_console_setup() 439 serial21285_get_options(port, &baud, &parity, &bits); in serial21285_console_setup() [all …]
|
D | xilinx_uartps.c | 191 unsigned int baud; member 393 unsigned int baud, u32 *rbdiv, u32 *rcd, int *div8) in cdns_uart_calc_baud_divs() argument 401 if (baud < clk / ((CDNS_UART_BDIV_MAX + 1) * CDNS_UART_CD_MAX)) { in cdns_uart_calc_baud_divs() 409 cd = DIV_ROUND_CLOSEST(clk, baud * (bdiv + 1)); in cdns_uart_calc_baud_divs() 415 if (baud > calc_baud) in cdns_uart_calc_baud_divs() 416 bauderror = baud - calc_baud; in cdns_uart_calc_baud_divs() 418 bauderror = calc_baud - baud; in cdns_uart_calc_baud_divs() 428 if (((besterror * 100) / baud) < 3) in cdns_uart_calc_baud_divs() 429 bestbaud = baud; in cdns_uart_calc_baud_divs() 442 unsigned int baud) in cdns_uart_set_baud_rate() argument [all …]
|
D | vt8500_serial.c | 314 static int vt8500_set_baud_rate(struct uart_port *port, unsigned int baud) in vt8500_set_baud_rate() argument 322 div |= (uart_get_divisor(port, baud) - 1) & 0x3ff; in vt8500_set_baud_rate() 325 baud = port->uartclk / 16 / ((div & 0x3ff) + 1); in vt8500_set_baud_rate() 333 vt8500_write(port, mult_frac(baud, 4096, 1000000), VT8500_URBKR); in vt8500_set_baud_rate() 335 return baud; in vt8500_set_baud_rate() 377 unsigned int baud, lcr; in vt8500_set_termios() local 383 baud = uart_get_baud_rate(port, termios, old, 900, 921600); in vt8500_set_termios() 384 baud = vt8500_set_baud_rate(port, baud); in vt8500_set_termios() 386 tty_termios_encode_baud_rate(termios, baud, baud); in vt8500_set_termios() 428 uart_update_timeout(port, termios->c_cflag, baud); in vt8500_set_termios() [all …]
|
D | netx-serial.c | 340 unsigned int baud, quot; in netx_set_termios() local 372 baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); in netx_set_termios() 373 quot = baud * 4096; in netx_set_termios() 380 uart_update_timeout(port, termios->c_cflag, baud); in netx_set_termios() 551 netx_console_get_options(struct uart_port *port, int *baud, in netx_console_get_options() argument 556 *baud = (readl(port->membase + UART_BAUDDIV_MSB) << 8) | in netx_console_get_options() 558 *baud *= 1000; in netx_console_get_options() 559 *baud /= 4096; in netx_console_get_options() 560 *baud *= 1000; in netx_console_get_options() 561 *baud /= 256; in netx_console_get_options() [all …]
|
D | sunsab.c | 647 static void calc_ebrg(int baud, int *n_ret, int *m_ret) in calc_ebrg() argument 651 if (baud == 0) { in calc_ebrg() 662 n = (SAB_BASE_BAUD * 10) / baud; in calc_ebrg() 683 unsigned int iflag, unsigned int baud, in sunsab_convert_to_sab() argument 716 calc_ebrg(baud, &n, &m); in sunsab_convert_to_sab() 720 up->tec_timeout = (10 * 1000000) / baud; in sunsab_convert_to_sab() 787 unsigned int baud = uart_get_baud_rate(port, termios, old, 0, 4000000); in sunsab_set_termios() local 788 unsigned int quot = uart_get_divisor(port, baud); in sunsab_set_termios() 791 sunsab_convert_to_sab(up, termios->c_cflag, termios->c_iflag, baud, quot); in sunsab_set_termios() 883 unsigned int baud, quot; in sunsab_console_setup() local [all …]
|
D | arc_uart.c | 104 unsigned long baud; member 366 unsigned int baud, uartl, uarth, hw_val; in arc_serial_set_termios() local 376 baud = uart_get_baud_rate(port, new, old, 0, 460800); in arc_serial_set_termios() 378 hw_val = port->uartclk / (uart->baud * 4) - 1; in arc_serial_set_termios() 403 tty_termios_encode_baud_rate(new, baud, baud); in arc_serial_set_termios() 405 uart_update_timeout(port, new->c_cflag, baud); in arc_serial_set_termios() 494 int baud = 115200; in arc_serial_console_setup() local 511 uart_parse_options(options, &baud, &parity, &bits, &flow); in arc_serial_console_setup() 517 return uart_set_options(port, co, baud, parity, bits, flow); in arc_serial_console_setup() 569 hw_val = port->uartclk / (dev->baud * 4) - 1; in arc_early_console_setup() [all …]
|
D | serial_ks8695.c | 386 unsigned int baud, quot; in ks8695uart_set_termios() local 391 baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); in ks8695uart_set_termios() 392 quot = uart_get_divisor(port, baud); in ks8695uart_set_termios() 435 uart_update_timeout(port, termios->c_cflag, baud); in ks8695uart_set_termios() 578 static void __init ks8695_console_get_options(struct uart_port *port, int *baud, int *parity, int *… in ks8695_console_get_options() argument 609 *baud = port->uartclk / (UART_GET_BRDR(port) & 0x0FFF); in ks8695_console_get_options() 610 *baud /= 16; in ks8695_console_get_options() 611 *baud &= 0xFFFFFFF0; in ks8695_console_get_options() 617 int baud = 115200; in ks8695_console_setup() local 630 uart_parse_options(options, &baud, &parity, &bits, &flow); in ks8695_console_setup() [all …]
|
D | mpc52xx_uart.c | 297 unsigned int baud; in mpc5200_psc_set_baudrate() local 301 baud = uart_get_baud_rate(port, new, old, in mpc5200_psc_set_baudrate() 304 divisor = (port->uartclk + 16 * baud) / (32 * baud); in mpc5200_psc_set_baudrate() 308 return baud; in mpc5200_psc_set_baudrate() 315 unsigned int baud; in mpc5200b_psc_set_baudrate() local 321 baud = uart_get_baud_rate(port, new, old, in mpc5200b_psc_set_baudrate() 324 divisor = (port->uartclk + 2 * baud) / (4 * baud); in mpc5200b_psc_set_baudrate() 328 if (divisor > 0xffff || baud <= 115200) { in mpc5200b_psc_set_baudrate() 334 return baud; in mpc5200b_psc_set_baudrate() 543 unsigned int baud; in mpc512x_psc_set_baudrate() local [all …]
|
D | m32r_sio.c | 89 static inline void sio_set_baud_rate(unsigned long baud) in sio_set_baud_rate() argument 92 sbaud = (boot_cpu_data.bus_clock / (baud * 4))-1; in sio_set_baud_rate() 132 static inline void sio_set_baud_rate(unsigned long baud) in sio_set_baud_rate() argument 136 i = boot_cpu_data.bus_clock / (baud * 16); in sio_set_baud_rate() 137 j = (boot_cpu_data.bus_clock - (i * baud * 16)) / baud; in sio_set_baud_rate() 629 unsigned int baud) in m32r_sio_get_divisor() argument 631 return uart_get_divisor(port, baud); in m32r_sio_get_divisor() 641 unsigned int baud, quot; in m32r_sio_set_termios() local 674 baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/4); in m32r_sio_set_termios() 676 baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); in m32r_sio_set_termios() [all …]
|
D | apbuart.c | 240 unsigned int baud, quot; in apbuart_set_termios() local 243 baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16); in apbuart_set_termios() 244 if (baud == 0) in apbuart_set_termios() 248 quot = (uart_get_divisor(port, baud)) * 2; in apbuart_set_termios() 265 uart_update_timeout(port, termios->c_cflag, baud); in apbuart_set_termios() 454 apbuart_console_get_options(struct uart_port *port, int *baud, in apbuart_console_get_options() argument 472 *baud = port->uartclk / (16 * (quot + 1)); in apbuart_console_get_options() 479 int baud = 38400; in apbuart_console_setup() local 500 uart_parse_options(options, &baud, &parity, &bits, &flow); in apbuart_console_setup() 502 apbuart_console_get_options(port, &baud, &parity, &bits); in apbuart_console_setup() [all …]
|
D | dz.c | 508 static int dz_encode_baud_rate(unsigned int baud) in dz_encode_baud_rate() argument 510 switch (baud) { in dz_encode_baud_rate() 569 unsigned int cflag, baud; in dz_set_termios() local 596 baud = uart_get_baud_rate(uport, termios, old_termios, 50, 9600); in dz_set_termios() 597 bflag = dz_encode_baud_rate(baud); in dz_set_termios() 599 baud = uart_get_baud_rate(uport, old_termios, NULL, 50, 9600); in dz_set_termios() 600 bflag = dz_encode_baud_rate(baud); in dz_set_termios() 602 baud = 9600; in dz_set_termios() 605 tty_termios_encode_baud_rate(termios, baud, baud); in dz_set_termios() 614 uart_update_timeout(uport, termios->c_cflag, baud); in dz_set_termios() [all …]
|
D | max3100.c | 110 int baud; /* current baud rate */ member 432 int baud = 0; in max3100_set_termios() local 442 baud = tty_termios_baud_rate(termios); in max3100_set_termios() 444 switch (baud) { in max3100_set_termios() 447 baud = s->baud; in max3100_set_termios() 482 baud = s->baud; in max3100_set_termios() 485 baud = s->baud; in max3100_set_termios() 487 tty_termios_encode_baud_rate(termios, baud, baud); in max3100_set_termios() 488 s->baud = baud; in max3100_set_termios() 537 uart_update_timeout(port, termios->c_cflag, baud); in max3100_set_termios() [all …]
|
D | sccnxp.c | 251 int baud; member 284 static int sccnxp_set_baud(struct uart_port *port, int baud) in sccnxp_set_baud() argument 287 int div_std, tmp_baud, bestbaud = baud, besterr = -1; in sccnxp_set_baud() 292 for (i = 0; baud_std[i].baud && besterr; i++) { in sccnxp_set_baud() 295 div_std = DIV_ROUND_CLOSEST(chip->freq_std, baud_std[i].baud); in sccnxp_set_baud() 297 if (!sccnxp_update_best_err(baud, tmp_baud, &besterr)) { in sccnxp_set_baud() 316 if (baud != bestbaud) in sccnxp_set_baud() 318 baud, bestbaud); in sccnxp_set_baud() 613 int baud; in sccnxp_set_termios() local 676 baud = uart_get_baud_rate(port, termios, old, 50, in sccnxp_set_termios() [all …]
|
D | timbuart.c | 280 static int get_bindex(int baud) in get_bindex() argument 285 if (baud <= baudrates[i]) in get_bindex() 295 unsigned int baud; in timbuart_set_termios() local 299 baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16); in timbuart_set_termios() 300 bindex = get_bindex(baud); in timbuart_set_termios() 305 baud = baudrates[bindex]; in timbuart_set_termios() 311 tty_termios_encode_baud_rate(termios, baud, baud); in timbuart_set_termios() 315 uart_update_timeout(port, termios->c_cflag, baud); in timbuart_set_termios()
|
/drivers/power/reset/ |
D | qnap-poweroff.c | 29 u32 baud; member 34 .baud = 19200, 39 .baud = 9600, 60 const unsigned divisor = ((tclk + (8 * cfg->baud)) / (16 * cfg->baud)); in qnap_power_off()
|