From 68da0823e0ca20687b367707220ed6a486cb2d18 Mon Sep 17 00:00:00 2001 From: Junhan Date: Wed, 27 Nov 2019 12:41:11 +0900 Subject: [PATCH] [9610] usbpd change abnormal detection threshold/time Change-Id: I44cb561da55964d9f5861eef194f3756371428f5 Signed-off-by: Junhan --- drivers/ccic/s2mu106-usbpd.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/ccic/s2mu106-usbpd.c b/drivers/ccic/s2mu106-usbpd.c index 97a966e4582b..c5b277dd4b1b 100644 --- a/drivers/ccic/s2mu106-usbpd.c +++ b/drivers/ccic/s2mu106-usbpd.c @@ -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__); -- 2.20.1