Lines Matching refs:baud

569  * Returns the nearest supported baud rate that can be set directly without
572 static speed_t pl2303_get_supported_baud_rate(speed_t baud)
583 if (baud_sup[i] > baud)
588 baud = baud_sup[i - 1];
589 else if (i > 0 && (baud_sup[i] - baud) > (baud - baud_sup[i - 1]))
590 baud = baud_sup[i - 1];
592 baud = baud_sup[i];
594 return baud;
598 * NOTE: If unsupported baud rates are set directly, the PL2303 seems to
599 * use 9600 baud.
602 speed_t baud)
604 put_unaligned_le32(baud, buf);
606 return baud;
610 speed_t baud)
622 mantissa = baseline / baud;
624 mantissa = 1; /* Avoid dividing by zero if baud > 32*12M. */
642 /* Calculate and return the exact baud rate. */
643 baud = (baseline / mantissa) >> (exponent << 1);
645 return baud;
649 speed_t baud)
661 mantissa = baseline / baud;
663 mantissa = 1; /* Avoid dividing by zero if baud > 32*12M. */
681 /* Calculate and return the exact baud rate. */
682 baud = (baseline / mantissa) >> exponent;
684 return baud;
694 speed_t baud;
696 baud = tty_get_baud_rate(tty);
697 dev_dbg(&port->dev, "baud requested = %u\n", baud);
698 if (!baud)
702 baud = min_t(speed_t, baud, spriv->type->max_baud_rate);
704 * Use direct method for supported baud rates, otherwise use divisors.
708 baud_sup = baud;
710 baud_sup = pl2303_get_supported_baud_rate(baud);
712 if (baud == baud_sup)
713 baud = pl2303_encode_baud_rate_direct(buf, baud);
715 baud = pl2303_encode_baud_rate_divisor_alt(buf, baud);
717 baud = pl2303_encode_baud_rate_divisor(buf, baud);
719 /* Save resulting baud rate */
720 tty_encode_baud_rate(tty, baud, baud);
721 dev_dbg(&port->dev, "baud set = %u\n", baud);
819 /* For reference buf[0]:buf[3] baud rate value */
876 * as a previously requested baud rate may differ from the one