Lines Matching full:baud

477  * Returns the nearest supported baud rate that can be set directly without
480 static speed_t pl2303_get_supported_baud_rate(speed_t baud) in pl2303_get_supported_baud_rate() argument
491 if (baud_sup[i] > baud) in pl2303_get_supported_baud_rate()
496 baud = baud_sup[i - 1]; in pl2303_get_supported_baud_rate()
497 else if (i > 0 && (baud_sup[i] - baud) > (baud - baud_sup[i - 1])) in pl2303_get_supported_baud_rate()
498 baud = baud_sup[i - 1]; in pl2303_get_supported_baud_rate()
500 baud = baud_sup[i]; in pl2303_get_supported_baud_rate()
502 return baud; in pl2303_get_supported_baud_rate()
506 * NOTE: If unsupported baud rates are set directly, the PL2303 seems to
507 * use 9600 baud.
510 speed_t baud) in pl2303_encode_baud_rate_direct() argument
512 put_unaligned_le32(baud, buf); in pl2303_encode_baud_rate_direct()
514 return baud; in pl2303_encode_baud_rate_direct()
518 speed_t baud) in pl2303_encode_baud_rate_divisor() argument
530 mantissa = baseline / baud; in pl2303_encode_baud_rate_divisor()
532 mantissa = 1; /* Avoid dividing by zero if baud > 32*12M. */ in pl2303_encode_baud_rate_divisor()
550 /* Calculate and return the exact baud rate. */ in pl2303_encode_baud_rate_divisor()
551 baud = (baseline / mantissa) >> (exponent << 1); in pl2303_encode_baud_rate_divisor()
553 return baud; in pl2303_encode_baud_rate_divisor()
563 speed_t baud; in pl2303_encode_baud_rate() local
565 baud = tty_get_baud_rate(tty); in pl2303_encode_baud_rate()
566 dev_dbg(&port->dev, "baud requested = %u\n", baud); in pl2303_encode_baud_rate()
567 if (!baud) in pl2303_encode_baud_rate()
571 baud = min_t(speed_t, baud, spriv->type->max_baud_rate); in pl2303_encode_baud_rate()
573 * Use direct method for supported baud rates, otherwise use divisors. in pl2303_encode_baud_rate()
575 baud_sup = pl2303_get_supported_baud_rate(baud); in pl2303_encode_baud_rate()
577 if (baud == baud_sup) in pl2303_encode_baud_rate()
578 baud = pl2303_encode_baud_rate_direct(buf, baud); in pl2303_encode_baud_rate()
580 baud = pl2303_encode_baud_rate_divisor(buf, baud); in pl2303_encode_baud_rate()
582 /* Save resulting baud rate */ in pl2303_encode_baud_rate()
583 tty_encode_baud_rate(tty, baud, baud); in pl2303_encode_baud_rate()
584 dev_dbg(&port->dev, "baud set = %u\n", baud); in pl2303_encode_baud_rate()
694 /* For reference buf[0]:buf[3] baud rate value */ in pl2303_set_termios()
751 * as a previously requested baud rate may differ from the one in pl2303_set_termios()