uslcom: Both CP2104 and CP2105 can support up to 2Mbps baudrate
MFC after: 1 week
This commit is contained in:
parent
65df124845
commit
c653786de0
@ -612,7 +612,22 @@ uslcom_cfg_set_rts(struct ucom_softc *ucom, uint8_t onoff)
|
||||
static int
|
||||
uslcom_pre_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
if (t->c_ospeed <= 0 || t->c_ospeed > 921600)
|
||||
struct uslcom_softc *sc = ucom->sc_parent;
|
||||
uint32_t maxspeed;
|
||||
|
||||
switch (sc->sc_partnum) {
|
||||
case USLCOM_PARTNUM_CP2104:
|
||||
case USLCOM_PARTNUM_CP2105:
|
||||
maxspeed = 2000000;
|
||||
break;
|
||||
case USLCOM_PARTNUM_CP2101:
|
||||
case USLCOM_PARTNUM_CP2102:
|
||||
case USLCOM_PARTNUM_CP2103:
|
||||
default:
|
||||
maxspeed = 921600;
|
||||
break;
|
||||
}
|
||||
if (t->c_ospeed <= 0 || t->c_ospeed > maxspeed)
|
||||
return (EINVAL);
|
||||
return (0);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user