• Johan Hovold's avatar
    USB: serial: cp210x: honour device-type maximum line speed · d4706c05
    Johan Hovold authored
    Newer cp210x devices support higher line speeds than the older ones
    which supported a discrete set of speeds up to 921.6 kbaud.
    
    To support these higher speeds, we have for some time mapped speeds
    lower than 1 Mbaud to the speeds supported by older devices, while
    allowing the device to pick the closest possible rate for higher speeds
    (without trying to guess and report back what rate was actually chosen).
    
    As this implementation can lead to undefined behaviour for older devices
    which do not support the higher rates, let's use the later-added
    device-type detection to determine the maximum supported speed.
    
    This will also be useful when adding support for cp2102n which can
    handle rates up to 3 Mbaud.
    
    As per the data sheets the following maximum speeds are used
    
    	cp2101		921.6 kbaud
    	cp2102/3	1 Mbaud
    	cp2104/8	2 Mbaud
    	cp2105
    	 - ECI port	2 Mbaud
    	 - SCI port	921.6 kbaud
    
    while keeping the maximum 2 Mbaud for unknown device types in order to
    avoid any regressions.
    Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
    d4706c05
cp210x.c 47.3 KB