Lines Matching full:baud

56 #define CDNS_UART_BAUDGEN	0x18  /* Baud Rate Generator */
63 #define CDNS_UART_BAUDDIV 0x34 /* Baud Rate Divider */
183 /* baud dividers min/max values */
195 * @baud: Current baud rate
209 unsigned int baud;
503 * cdns_uart_calc_baud_divs - Calculate baud rate divisors
505 * @baud: Desired baud rate
509 * Return: baud rate, requested baud when possible, or actual baud when there
512 * Formula to obtain baud rate is
519 * baud rate generate register
520 * baud rate clock divisor register
523 unsigned int baud, u32 *rbdiv, u32 *rcd, int *div8)
531 if (baud < clk / ((CDNS_UART_BDIV_MAX + 1) * CDNS_UART_CD_MAX)) {
539 cd = DIV_ROUND_CLOSEST(clk, baud * (bdiv + 1));
545 if (baud > calc_baud)
546 bauderror = baud - calc_baud;
548 bauderror = calc_baud - baud;
558 if (((besterror * 100) / baud) < 3)
559 bestbaud = baud;
565 * cdns_uart_set_baud_rate - Calculate and set the baud rate
567 * @baud: Baud rate to set
568 * Return: baud rate, requested baud when possible, or actual baud when there
572 unsigned int baud)
580 calc_baud = cdns_uart_calc_baud_divs(port->uartclk, baud, &bdiv, &cd,
592 cdns_uart->baud = baud;
626 * Find out if current baud-rate can be achieved with new clock
629 if (!cdns_uart_calc_baud_divs(ndata->new_rate, cdns_uart->baud,
637 /* Disable the TX and RX to set baud rate */
648 * Set clk dividers to generate correct baud with new clock
657 cdns_uart->baud = cdns_uart_set_baud_rate(cdns_uart->port,
658 cdns_uart->baud);
810 * stop bits, flow control, baud rate
820 unsigned int baud, minbaud, maxbaud;
826 /* Disable the TX and RX to set baud rate */
832 * Min baud rate = 6bps and Max Baud Rate is 10Mbps for 100Mhz clk
833 * min and max baud should be calculated here based on port->uartclk.
834 * this way we get a valid baud and can safely call set_baud()
839 baud = uart_get_baud_rate(port, termios, old, minbaud, maxbaud);
840 baud = cdns_uart_set_baud_rate(port, baud);
842 tty_termios_encode_baud_rate(termios, baud, baud);
845 uart_update_timeout(port, termios->c_cflag, baud);
1337 /* only set baud if specified on command line - otherwise
1340 if (port->uartclk && device->baud) {
1345 cdns_uart_calc_baud_divs(port->uartclk, device->baud,
1423 int baud = 9600;
1436 uart_parse_options(options, &baud, &parity, &bits, &flow);
1445 return uart_set_options(port, co, baud, parity, bits, flow);