Loading drivers/usb/pd/policy_engine.c +15 −1 Original line number Diff line number Diff line Loading @@ -1201,7 +1201,6 @@ static void usbpd_set_state(struct usbpd *pd, enum usbpd_state next_state) .msg_rx_cb = phy_msg_received, .shutdown_cb = phy_shutdown, .frame_filter_val = FRAME_FILTER_EN_SOP | FRAME_FILTER_EN_SOPI | FRAME_FILTER_EN_HARD_RESET, }; union power_supply_propval val = {0}; Loading Loading @@ -1263,6 +1262,10 @@ static void usbpd_set_state(struct usbpd *pd, enum usbpd_state next_state) phy_params.data_role = pd->current_dr; phy_params.power_role = pd->current_pr; if (pd->vconn_enabled) phy_params.frame_filter_val |= FRAME_FILTER_EN_SOPI; ret = pd_phy_open(&phy_params); if (ret) { WARN_ON_ONCE(1); Loading Loading @@ -1450,6 +1453,10 @@ static void usbpd_set_state(struct usbpd *pd, enum usbpd_state next_state) phy_params.data_role = pd->current_dr; phy_params.power_role = pd->current_pr; if (pd->vconn_enabled) phy_params.frame_filter_val |= FRAME_FILTER_EN_SOPI; ret = pd_phy_open(&phy_params); if (ret) { WARN_ON_ONCE(1); Loading Loading @@ -2008,6 +2015,9 @@ static void vconn_swap(struct usbpd *pd) int ret; if (pd->vconn_enabled) { pd_phy_update_frame_filter(FRAME_FILTER_EN_SOP | FRAME_FILTER_EN_HARD_RESET); pd->current_state = PE_VCS_WAIT_FOR_VCONN; kick_sm(pd, VCONN_ON_TIME); } else { Loading @@ -2026,6 +2036,10 @@ static void vconn_swap(struct usbpd *pd) pd->vconn_enabled = true; pd_phy_update_frame_filter(FRAME_FILTER_EN_SOP | FRAME_FILTER_EN_SOPI | FRAME_FILTER_EN_HARD_RESET); /* * Small delay to ensure Vconn has ramped up. This is well * below tVCONNSourceOn (100ms) so we still send PS_RDY within Loading drivers/usb/pd/qpnp-pdphy.c +8 −0 Original line number Diff line number Diff line Loading @@ -347,6 +347,14 @@ int pd_phy_update_roles(enum data_role dr, enum power_role pr) } EXPORT_SYMBOL(pd_phy_update_roles); int pd_phy_update_frame_filter(u8 frame_filter_val) { struct usb_pdphy *pdphy = __pdphy; return pdphy_reg_write(pdphy, USB_PDPHY_FRAME_FILTER, frame_filter_val); } EXPORT_SYMBOL(pd_phy_update_frame_filter); int pd_phy_open(struct pd_phy_params *params) { int ret; Loading drivers/usb/pd/usbpd.h +6 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ int pd_phy_signal(enum pd_sig_type sig); int pd_phy_write(u16 hdr, const u8 *data, size_t data_len, enum pd_sop_type sop); int pd_phy_update_roles(enum data_role dr, enum power_role pr); int pd_phy_update_frame_filter(u8 frame_filter_val); void pd_phy_close(void); #else static inline int pd_phy_open(struct pd_phy_params *params) Loading @@ -100,6 +101,11 @@ static inline int pd_phy_update_roles(enum data_role dr, enum power_role pr) return -ENODEV; } static inline int pd_phy_update_frame_filter(u8 frame_filter_val) { return -ENODEV; } static inline void pd_phy_close(void) { } Loading Loading
drivers/usb/pd/policy_engine.c +15 −1 Original line number Diff line number Diff line Loading @@ -1201,7 +1201,6 @@ static void usbpd_set_state(struct usbpd *pd, enum usbpd_state next_state) .msg_rx_cb = phy_msg_received, .shutdown_cb = phy_shutdown, .frame_filter_val = FRAME_FILTER_EN_SOP | FRAME_FILTER_EN_SOPI | FRAME_FILTER_EN_HARD_RESET, }; union power_supply_propval val = {0}; Loading Loading @@ -1263,6 +1262,10 @@ static void usbpd_set_state(struct usbpd *pd, enum usbpd_state next_state) phy_params.data_role = pd->current_dr; phy_params.power_role = pd->current_pr; if (pd->vconn_enabled) phy_params.frame_filter_val |= FRAME_FILTER_EN_SOPI; ret = pd_phy_open(&phy_params); if (ret) { WARN_ON_ONCE(1); Loading Loading @@ -1450,6 +1453,10 @@ static void usbpd_set_state(struct usbpd *pd, enum usbpd_state next_state) phy_params.data_role = pd->current_dr; phy_params.power_role = pd->current_pr; if (pd->vconn_enabled) phy_params.frame_filter_val |= FRAME_FILTER_EN_SOPI; ret = pd_phy_open(&phy_params); if (ret) { WARN_ON_ONCE(1); Loading Loading @@ -2008,6 +2015,9 @@ static void vconn_swap(struct usbpd *pd) int ret; if (pd->vconn_enabled) { pd_phy_update_frame_filter(FRAME_FILTER_EN_SOP | FRAME_FILTER_EN_HARD_RESET); pd->current_state = PE_VCS_WAIT_FOR_VCONN; kick_sm(pd, VCONN_ON_TIME); } else { Loading @@ -2026,6 +2036,10 @@ static void vconn_swap(struct usbpd *pd) pd->vconn_enabled = true; pd_phy_update_frame_filter(FRAME_FILTER_EN_SOP | FRAME_FILTER_EN_SOPI | FRAME_FILTER_EN_HARD_RESET); /* * Small delay to ensure Vconn has ramped up. This is well * below tVCONNSourceOn (100ms) so we still send PS_RDY within Loading
drivers/usb/pd/qpnp-pdphy.c +8 −0 Original line number Diff line number Diff line Loading @@ -347,6 +347,14 @@ int pd_phy_update_roles(enum data_role dr, enum power_role pr) } EXPORT_SYMBOL(pd_phy_update_roles); int pd_phy_update_frame_filter(u8 frame_filter_val) { struct usb_pdphy *pdphy = __pdphy; return pdphy_reg_write(pdphy, USB_PDPHY_FRAME_FILTER, frame_filter_val); } EXPORT_SYMBOL(pd_phy_update_frame_filter); int pd_phy_open(struct pd_phy_params *params) { int ret; Loading
drivers/usb/pd/usbpd.h +6 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ int pd_phy_signal(enum pd_sig_type sig); int pd_phy_write(u16 hdr, const u8 *data, size_t data_len, enum pd_sop_type sop); int pd_phy_update_roles(enum data_role dr, enum power_role pr); int pd_phy_update_frame_filter(u8 frame_filter_val); void pd_phy_close(void); #else static inline int pd_phy_open(struct pd_phy_params *params) Loading @@ -100,6 +101,11 @@ static inline int pd_phy_update_roles(enum data_role dr, enum power_role pr) return -ENODEV; } static inline int pd_phy_update_frame_filter(u8 frame_filter_val) { return -ENODEV; } static inline void pd_phy_close(void) { } Loading