[RAMEN9610-20350][9610] drivers: muic: support bad TA
authorKim Taejeong <tj.kim@samsung.com>
Sun, 11 Aug 2019 06:45:49 +0000 (15:45 +0900)
committerrobot <robot@samsung.com>
Mon, 7 Oct 2019 05:07:04 +0000 (14:07 +0900)
Change-Id: I605bf8bbd5df0dfeea091836bd90cdeca5dfad34
Signed-off-by: Kim Taejeong <tj.kim@samsung.com>
Signed-off-by: Kim Gunho <gunho.kim@samsung.com>
drivers/muic/s2mu106-muic.c
include/linux/muic/s2mu106-muic.h

index 787beca9806afa90b2c2cf881bcc7ed4167f00ae..de9c3b42e59c1eaa989f36c2eb6bbd85ee7726f8 100644 (file)
@@ -644,8 +644,10 @@ static void s2mu106_muic_cable_timeout(struct work_struct *work)
        struct s2mu106_muic_data *muic_data =
                container_of(work, struct s2mu106_muic_data, cable_timeout.work);
        struct muic_platform_data *muic_pdata = muic_data->pdata;
+       int vbus = _s2mu106_muic_get_vbus_state(muic_data);
 
-       if (_s2mu106_muic_get_vbus_state(muic_data)) {
+       pr_info("%s vbus(%d)\n", __func__, vbus);
+       if (vbus) {
                if (muic_pdata->attached_dev == ATTACHED_DEV_NONE_MUIC ||
                                muic_pdata->attached_dev == ATTACHED_DEV_UNKNOWN_MUIC) {
                        pr_info("SPECOUT CHARGER DETECTED\n");
@@ -1248,19 +1250,6 @@ static int s2mu106_muic_detect_dev_bc1p2(struct s2mu106_muic_data *muic_data)
                muic_data->new_dev = ATTACHED_DEV_TA_MUIC;
                muic_data->afc_check = false;
                pr_info("CHG_TYPE DETECTED\n");
-#if IS_ENABLED(CONFIG_MUIC_MANAGER)
-               muic_if->is_dcdtmr_intr = true;
-               schedule_delayed_work(&muic_data->dcd_recheck, 0);
-#else
-               if (muic_data->bcd_rescanned) {
-                       muic_data->new_dev = ATTACHED_DEV_TA_MUIC;
-                       muic_data->afc_check = false;
-               } else {
-                       muic_data->bcd_rescanned = true;
-                       schedule_delayed_work(&muic_data->dcd_recheck, 0);
-                       return S2MU106_DETECT_SKIP;
-               }
-#endif
        }
 
 detect_done:
@@ -2491,6 +2480,7 @@ static int s2mu106_muic_probe(struct platform_device *pdev)
        INIT_DELAYED_WORK(&muic_data->dcd_recheck, s2mu106_muic_dcd_recheck);
 #if IS_ENABLED(CONFIG_S2MU106_SPECOUT_CHARGER)
        INIT_DELAYED_WORK(&muic_data->cable_timeout, s2mu106_muic_cable_timeout);
+       pr_info("%s support specout chg\n", __func__);
 #endif
 
 #if IS_ENABLED(CONFIG_S2MU106_TYPEC_WATER)
index 4c00fcd80a0c7a58f2b0d05bd1d0ee2767f366f9..ee83294290deb5a491504db28045d7c8e9061aca 100644 (file)
@@ -346,7 +346,7 @@ enum s2mu106_muic_registers {
 #define CHG_TYP_USB_MASK                               (0x1 << CHG_TYP_USB_SHIFT)
 #define CHG_TYP_CDPCHG_MASK                            (0x1 << CHG_TYP_CDPCHG_SHIFT)
 #define CHG_TYP_DCPCHG_MASK                            (0x1 << CHG_TYP_DCPCHG_SHIFT)
-#define DEV_TYPE_CHG_TYPE              (CHG_TYP_VBUS_R255_MASK | CHG_TYP_U200_MASK | CHG_TYP_SDP_1P8S_MASK)
+#define DEV_TYPE_CHG_TYPE              (CHG_TYP_VBUS_R255_MASK | CHG_TYP_U200_MASK | CHG_TYP_SDP_1P8S_MASK | CHG_TYP_DP_3V_SDP_MASK)
 
 /* S2MU106 MUIC DEVICE_APPLE Register (0x4E) */
 #define DEVICE_APPLE_APPLE0P5A_CHG_SHIFT       7