void pd_execute_data_swap(int port, int data_role) { /* Do nothing */ } void pd_check_pr_role(int port, int pr_role, int flags) { } void pd_check_dr_role(int port, int dr_role, int flags) { } /* ----------------- Vendor Defined Messages ------------------ */ const uint32_t vdo_idh = VDO_IDH(0, /* data caps as USB host */ 1, /* data caps as USB device */ IDH_PTYPE_AMA, /* Alternate mode */ 1, /* supports alt modes */ USB_VID_GOOGLE); const uint32_t vdo_product = VDO_PRODUCT(CONFIG_USB_PID, CONFIG_USB_BCD_DEV); const uint32_t vdo_ama = VDO_AMA(CONFIG_USB_PD_IDENTITY_HW_VERS, CONFIG_USB_PD_IDENTITY_SW_VERS, 0, 0, 0, 0, /* SS[TR][12] */ 0, /* Vconn power */ 0, /* Vconn power required */ 1, /* Vbus power required */ AMA_USBSS_BBONLY /* USB SS support */); static int svdm_response_identity(int port, uint32_t *payload) {
/* cut the power output */ pd_power_supply_reset(0); /* record a special fault */ fault = FAULT_FAST_OCP; /* pd_board_checks() will record the timeout later */ } /* clear ADC irq so we don't get a second interrupt */ task_clear_pending_irq(STM32_IRQ_ADC_COMP); } DECLARE_IRQ(STM32_IRQ_ADC_COMP, pd_adc_interrupt, 1); /* ----------------- Vendor Defined Messages ------------------ */ const uint32_t vdo_idh = VDO_IDH(0, /* data caps as USB host */ 0, /* data caps as USB device */ IDH_PTYPE_UNDEF, /* Undefined */ 1, /* supports alt modes */ USB_VID_GOOGLE); const uint32_t vdo_product = VDO_PRODUCT(CONFIG_USB_PID, CONFIG_USB_BCD_DEV); /* When set true, we are in GFU mode */ static int gfu_mode; static int svdm_response_identity(int port, uint32_t *payload) { payload[VDO_I(IDH)] = vdo_idh; payload[VDO_I(CSTAT)] = VDO_CSTAT(0); payload[VDO_I(PRODUCT)] = vdo_product; return VDO_I(PRODUCT) + 1; }