Skip to content

Commit 4e9340b

Browse files
committed
USB: serial: cp210x: determine fw version for CP2105 and CP2108
CP2105, CP2108 and CP2102N have vendor requests that can be used to retrieve the firmware version. Having this information available is essential when trying to work around buggy firmware as a recent CP2102N regression showed. Determine and log the firmware version also for CP2105 and CP2108 during type detection at probe. Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Johan Hovold <[email protected]>
1 parent 33fb934 commit 4e9340b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/usb/serial/cp210x.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ struct cp210x_special_chars {
400400
};
401401

402402
/* CP210X_VENDOR_SPECIFIC values */
403+
#define CP210X_GET_FW_VER 0x000E
403404
#define CP210X_READ_2NCONFIG 0x000E
404405
#define CP210X_GET_FW_VER_2N 0x0010
405406
#define CP210X_READ_LATCH 0x00C2
@@ -2108,6 +2109,10 @@ static void cp210x_determine_type(struct usb_serial *serial)
21082109
}
21092110

21102111
switch (priv->partnum) {
2112+
case CP210X_PARTNUM_CP2105:
2113+
case CP210X_PARTNUM_CP2108:
2114+
cp210x_get_fw_version(serial, CP210X_GET_FW_VER);
2115+
break;
21112116
case CP210X_PARTNUM_CP2102N_QFN28:
21122117
case CP210X_PARTNUM_CP2102N_QFN24:
21132118
case CP210X_PARTNUM_CP2102N_QFN20:

0 commit comments

Comments
 (0)