[9610] usbpd change abnormal detection threshold/time
authorJunhan <junhan84.bae@samsung.com>
Wed, 27 Nov 2019 03:41:11 +0000 (12:41 +0900)
committerlingsen1 <lingsen1@lenovo.com>
Thu, 28 Nov 2019 05:32:04 +0000 (13:32 +0800)
Change-Id: I44cb561da55964d9f5861eef194f3756371428f5
Signed-off-by: Junhan <junhan84.bae@samsung.com>
drivers/ccic/s2mu106-usbpd.c

index 97a966e4582b0b9ac0c401907127c5c81a79c444..c5b277dd4b1b3551c5f38f617fd6cf8015f758ce 100644 (file)
@@ -2115,9 +2115,10 @@ static int s2mu106_usbpd_check_abnormal_attach(struct s2mu106_usbpd_data *pdic_d
        struct i2c_client *i2c = pdic_data->i2c;
        u8 data = 0;
 
-       s2mu106_usbpd_set_threshold(pdic_data, PLUG_CTRL_RP,
-                                                                               S2MU106_THRESHOLD_1285MV);
-       msleep(20);
+       pr_info("%s, try val=1100mV\n", __func__);
+
+       s2mu106_usbpd_set_threshold(pdic_data, PLUG_CTRL_RP, 30);
+       msleep(80);
 
        s2mu106_usbpd_read_reg(i2c, S2MU106_REG_PLUG_MON2, &data);
        if ((data & S2MU106_PR_MASK) == S2MU106_PDIC_SOURCE)
@@ -2417,6 +2418,7 @@ static int s2mu106_check_port_detect(struct s2mu106_usbpd_data *pdic_data)
                        dev_err(&i2c->dev, "%s, abnormal attach\n", __func__);
                        return -1;
                }
+               s2mu106_usbpd_write_reg(i2c, S2MU106_REG_PLUG_CTRL_SET_RP, S2MU106_THRESHOLD_2057MV);
                ret = s2mu106_usbpd_check_accessory(pdic_data);
                if (ret < 0) {
                        dev_info(&i2c->dev, "%s attach accessory\n", __func__);