Lines Matching refs:baud
482 * Returns the nearest supported baud rate that can be set directly without
485 static speed_t pl2303_get_supported_baud_rate(speed_t baud)
496 if (baud_sup[i] > baud)
501 baud = baud_sup[i - 1];
502 else if (i > 0 && (baud_sup[i] - baud) > (baud - baud_sup[i - 1]))
503 baud = baud_sup[i - 1];
505 baud = baud_sup[i];
507 return baud;
511 * NOTE: If unsupported baud rates are set directly, the PL2303 seems to
512 * use 9600 baud.
515 speed_t baud)
517 put_unaligned_le32(baud, buf);
519 return baud;
523 speed_t baud)
535 mantissa = baseline / baud;
537 mantissa = 1; /* Avoid dividing by zero if baud > 32*12M. */
555 /* Calculate and return the exact baud rate. */
556 baud = (baseline / mantissa) >> (exponent << 1);
558 return baud;
568 speed_t baud;
570 baud = tty_get_baud_rate(tty);
571 dev_dbg(&port->dev, "baud requested = %u\n", baud);
572 if (!baud)
576 baud = min_t(speed_t, baud, spriv->type->max_baud_rate);
578 * Use direct method for supported baud rates, otherwise use divisors.
582 baud_sup = baud;
584 baud_sup = pl2303_get_supported_baud_rate(baud);
586 if (baud == baud_sup)
587 baud = pl2303_encode_baud_rate_direct(buf, baud);
589 baud = pl2303_encode_baud_rate_divisor(buf, baud);
591 /* Save resulting baud rate */
592 tty_encode_baud_rate(tty, baud, baud);
593 dev_dbg(&port->dev, "baud set = %u\n", baud);
703 /* For reference buf[0]:buf[3] baud rate value */
760 * as a previously requested baud rate may differ from the one