Revert "usbpd:Samsung usbpd too many detachment issue fix"
authora17671 <a17671@motorola.com>
Tue, 4 Dec 2018 08:32:58 +0000 (16:32 +0800)
committerlingsen1 <lingsen1@lenovo.com>
Sun, 7 Feb 2021 09:36:51 +0000 (17:36 +0800)
Reorg the fix of the detachment issue
Make sure rebooting with usb attached
does not break the adb
Mot-CR-fixed:(CR)

This reverts commit e2d064f8cb59ecf123cdaa8edc1c278397455153.

Change-Id: I052ed981f388c27ae98ce33024cd74c61e6b3981
Reviewed-on: https://gerrit.mot.com/1278905
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key

drivers/ccic/s2mu106-usbpd.c

index 1fa48de7d266ce1c9d2544462279b6e5ddea1f63..e0d1e7b8b5643fe49bcc00c76cd4a30a8db8f146 100644 (file)
@@ -2231,6 +2231,12 @@ static void s2mu106_usbpd_notify_detach(struct s2mu106_usbpd_data *pdic_data)
 {
        struct device *dev = pdic_data->dev;
 #if defined(CONFIG_IFCONN_NOTIFIER)
+       /* MUIC */
+       ifconn_event_work(pdic_data, IFCONN_NOTIFY_MUIC, IFCONN_NOTIFY_ID_ATTACH,
+                                                               IFCONN_NOTIFY_EVENT_DETACH, NULL);
+
+       ifconn_event_work(pdic_data, IFCONN_NOTIFY_MUIC, IFCONN_NOTIFY_ID_RID,
+                                                               IFCONN_NOTIFY_EVENT_DETACH, NULL);
 
        if (pdic_data->is_host > HOST_OFF || pdic_data->is_client > CLIENT_OFF) {
 #if defined(CONFIG_DUAL_ROLE_USB_INTF)
@@ -2259,6 +2265,10 @@ static void s2mu106_usbpd_notify_detach(struct s2mu106_usbpd_data *pdic_data)
                }
                pdic_data->typec_power_role = TYPEC_SINK;
                pdic_data->typec_data_role = TYPEC_DEVICE;
+               /* USB */
+               ifconn_event_work(pdic_data, IFCONN_NOTIFY_USB, IFCONN_NOTIFY_ID_USB,
+                                                                               IFCONN_NOTIFY_EVENT_DETACH, NULL);
+
 #endif
        }
 #else