From c08890f85e997ca546a3a71871405b3f8e21294f Mon Sep 17 00:00:00 2001 From: Kim Taejeong Date: Fri, 9 Aug 2019 15:43:11 +0900 Subject: [PATCH] [9610] drivers: muic: support bad TA Change-Id: I7ea2024f5800325daf4922aa3542b5d30bc4c006 Signed-off-by: Kim Taejeong --- drivers/muic/s2mu106-muic.c | 18 ++++-------------- include/linux/muic/s2mu106-muic.h | 2 +- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/muic/s2mu106-muic.c b/drivers/muic/s2mu106-muic.c index 787beca9806a..de9c3b42e59c 100644 --- a/drivers/muic/s2mu106-muic.c +++ b/drivers/muic/s2mu106-muic.c @@ -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) diff --git a/include/linux/muic/s2mu106-muic.h b/include/linux/muic/s2mu106-muic.h index 4c00fcd80a0c..ee83294290de 100644 --- a/include/linux/muic/s2mu106-muic.h +++ b/include/linux/muic/s2mu106-muic.h @@ -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 -- 2.20.1