Skip to content

Commit

Permalink
USB: serial: pl2303: rename legacy PL2303H type
Browse files Browse the repository at this point in the history
Rename the legacy type which is supposedly a PL2303H which came in two
variants (and which we handle the same way).

Signed-off-by: Johan Hovold <johan@kernel.org>
  • Loading branch information
Johan Hovold committed Mar 17, 2021
1 parent 8a7bf75 commit ca82f64
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/usb/serial/pl2303.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ MODULE_DEVICE_TABLE(usb, id_table);
static void pl2303_set_break(struct usb_serial_port *port, bool enable);

enum pl2303_type {
TYPE_01, /* Type 0 and 1 (difference unknown) */
TYPE_H,
TYPE_HX,
TYPE_TA,
TYPE_TB,
Expand Down Expand Up @@ -203,7 +203,7 @@ struct pl2303_private {
};

static const struct pl2303_type_data pl2303_type_data[TYPE_COUNT] = {
[TYPE_01] = {
[TYPE_H] = {
.max_baud_rate = 1228800,
.quirks = PL2303_QUIRK_LEGACY,
.no_autoxonxoff = true,
Expand Down Expand Up @@ -382,16 +382,16 @@ static int pl2303_detect_type(struct usb_serial *serial)
u8 buf;

/*
* Legacy types 0 and 1, difference unknown.
* Legacy PL2303H, variants 0 and 1 (difference unknown).
*/
if (desc->bDeviceClass == 0x02)
return TYPE_01; /* type 0 */
return TYPE_H; /* variant 0 */

if (desc->bMaxPacketSize0 != 0x40) {
if (desc->bDeviceClass == 0x00 || desc->bDeviceClass == 0xff)
return TYPE_01; /* type 1 */
return TYPE_H; /* variant 1 */

return TYPE_01; /* type 0 */
return TYPE_H; /* variant 0 */
}

/*
Expand Down

0 comments on commit ca82f64

Please sign in to comment.