Skip to content

Commit cae6731

Browse files
Johan Carlssonkartben
authored andcommitted
usb-c: ignore VDM messaged when using PD 2.0
according to PD 2.0 sepecification VDM should be ignored if not supported. Signed-off-by: Johan Carlsson <johan.carlsson@teenage.engineering>
1 parent 0fa9ef8 commit cae6731

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

subsys/usb/usb_c/usbc_pe_snk_states.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,15 @@ void pe_snk_ready_run(void *obj)
432432
case PD_DATA_SOURCE_CAP:
433433
pe_set_state(dev, PE_SNK_EVALUATE_CAPABILITY);
434434
break;
435+
case PD_DATA_VENDOR_DEF:
436+
/**
437+
* VDM is unsupported. PD2.0 ignores and PD3.0
438+
* reply with not supported.
439+
*/
440+
if (prl_get_rev(dev, PD_PACKET_SOP) > PD_REV20) {
441+
pe_set_state(dev, PE_SEND_NOT_SUPPORTED);
442+
}
443+
break;
435444
default:
436445
pe_set_state(dev, PE_SEND_NOT_SUPPORTED);
437446
}

subsys/usb/usb_c/usbc_pe_src_states.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,15 @@ void pe_src_ready_run(void *obj)
408408
case PD_DATA_REQUEST:
409409
pe_set_state(dev, PE_SRC_NEGOTIATE_CAPABILITY);
410410
break;
411+
case PD_DATA_VENDOR_DEF:
412+
/**
413+
* VDM is unsupported. PD2.0 ignores and PD3.0
414+
* reply with not supported.
415+
*/
416+
if (prl_get_rev(dev, PD_PACKET_SOP) > PD_REV20) {
417+
pe_set_state(dev, PE_SEND_NOT_SUPPORTED);
418+
}
419+
break;
411420
default:
412421
pe_set_state(dev, PE_SEND_NOT_SUPPORTED);
413422
}

0 commit comments

Comments
 (0)