diff options
Diffstat (limited to 'board/samus_pd/usb_pd_policy.c')
-rw-r--r-- | board/samus_pd/usb_pd_policy.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/board/samus_pd/usb_pd_policy.c b/board/samus_pd/usb_pd_policy.c index bf24b2eb07..97bab9338f 100644 --- a/board/samus_pd/usb_pd_policy.c +++ b/board/samus_pd/usb_pd_policy.c @@ -154,6 +154,7 @@ int pd_board_checks(void) int pd_custom_vdm(int port, int cnt, uint32_t *payload, uint32_t **rpayload) { int cmd = PD_VDO_CMD(payload[0]); + uint8_t dev_id = 0; ccprintf("VDM/%d [%d] %08x\n", cnt, cmd, payload[0]); /* make sure we have some payload */ @@ -167,16 +168,17 @@ int pd_custom_vdm(int port, int cnt, uint32_t *payload, uint32_t **rpayload) ccprintf("version: %s\n", (char *)(payload+1)); break; case VDO_CMD_READ_INFO: - /* copy hash */ - if (cnt >= 6) - pd_dev_store_rw_hash(port, payload + 1); - /* if last word is present, it contains lots of info */ - if (cnt == 7) - ccprintf("Dev:%d SW:%d RW:%d\n", - VDO_INFO_HW_DEV_ID(payload[6]), + if (cnt == 7) { + dev_id = VDO_INFO_HW_DEV_ID(payload[6]); + ccprintf("Dev:%d SW:%d RW:%d\n", dev_id, VDO_INFO_SW_DBG_VER(payload[6]), VDO_INFO_IS_RW(payload[6])); + } + /* copy hash */ + if (cnt >= 6) + pd_dev_store_rw_hash(port, dev_id, payload + 1); + break; case VDO_CMD_CURRENT: ccprintf("Current: %dmA\n", payload[1]); |