• Home
  • Raw
  • Download

Lines Matching full:baud

572  * Returns the nearest supported baud rate that can be set directly without
575 static speed_t pl2303_get_supported_baud_rate(speed_t baud) in pl2303_get_supported_baud_rate() argument
586 if (baud_sup[i] > baud) in pl2303_get_supported_baud_rate()
591 baud = baud_sup[i - 1]; in pl2303_get_supported_baud_rate()
592 else if (i > 0 && (baud_sup[i] - baud) > (baud - baud_sup[i - 1])) in pl2303_get_supported_baud_rate()
593 baud = baud_sup[i - 1]; in pl2303_get_supported_baud_rate()
595 baud = baud_sup[i]; in pl2303_get_supported_baud_rate()
597 return baud; in pl2303_get_supported_baud_rate()
601 * NOTE: If unsupported baud rates are set directly, the PL2303 seems to
602 * use 9600 baud.
605 speed_t baud) in pl2303_encode_baud_rate_direct() argument
607 put_unaligned_le32(baud, buf); in pl2303_encode_baud_rate_direct()
609 return baud; in pl2303_encode_baud_rate_direct()
613 speed_t baud) in pl2303_encode_baud_rate_divisor() argument
625 mantissa = baseline / baud; in pl2303_encode_baud_rate_divisor()
627 mantissa = 1; /* Avoid dividing by zero if baud > 32*12M. */ in pl2303_encode_baud_rate_divisor()
645 /* Calculate and return the exact baud rate. */ in pl2303_encode_baud_rate_divisor()
646 baud = (baseline / mantissa) >> (exponent << 1); in pl2303_encode_baud_rate_divisor()
648 return baud; in pl2303_encode_baud_rate_divisor()
652 speed_t baud) in pl2303_encode_baud_rate_divisor_alt() argument
664 mantissa = baseline / baud; in pl2303_encode_baud_rate_divisor_alt()
666 mantissa = 1; /* Avoid dividing by zero if baud > 32*12M. */ in pl2303_encode_baud_rate_divisor_alt()
684 /* Calculate and return the exact baud rate. */ in pl2303_encode_baud_rate_divisor_alt()
685 baud = (baseline / mantissa) >> exponent; in pl2303_encode_baud_rate_divisor_alt()
687 return baud; in pl2303_encode_baud_rate_divisor_alt()
697 speed_t baud; in pl2303_encode_baud_rate() local
699 baud = tty_get_baud_rate(tty); in pl2303_encode_baud_rate()
700 dev_dbg(&port->dev, "baud requested = %u\n", baud); in pl2303_encode_baud_rate()
701 if (!baud) in pl2303_encode_baud_rate()
705 baud = min_t(speed_t, baud, spriv->type->max_baud_rate); in pl2303_encode_baud_rate()
707 * Use direct method for supported baud rates, otherwise use divisors. in pl2303_encode_baud_rate()
711 baud_sup = baud; in pl2303_encode_baud_rate()
713 baud_sup = pl2303_get_supported_baud_rate(baud); in pl2303_encode_baud_rate()
715 if (baud == baud_sup) in pl2303_encode_baud_rate()
716 baud = pl2303_encode_baud_rate_direct(buf, baud); in pl2303_encode_baud_rate()
718 baud = pl2303_encode_baud_rate_divisor_alt(buf, baud); in pl2303_encode_baud_rate()
720 baud = pl2303_encode_baud_rate_divisor(buf, baud); in pl2303_encode_baud_rate()
722 /* Save resulting baud rate */ in pl2303_encode_baud_rate()
723 tty_encode_baud_rate(tty, baud, baud); in pl2303_encode_baud_rate()
724 dev_dbg(&port->dev, "baud set = %u\n", baud); in pl2303_encode_baud_rate()
822 /* For reference buf[0]:buf[3] baud rate value */ in pl2303_set_termios()
879 * as a previously requested baud rate may differ from the one in pl2303_set_termios()