[RAMEN9610-13626][COMMON][9610] drivers : fix pd communication timing for mac
authorJunhan Bae <junhan84.bae@samsung.com>
Wed, 20 Mar 2019 11:37:53 +0000 (20:37 +0900)
committerhskang <hs1218.kang@samsung.com>
Thu, 21 Mar 2019 08:00:50 +0000 (17:00 +0900)
Change-Id: I1a47f5803fba91e0050571be211427e3daaaf846
Signed-off-by: Junhan Bae <junhan84.bae@samsung.com>
drivers/ccic/s2mu106-usbpd.c
drivers/ccic/usbpd_policy.c

index 1188c4096015f9de0caee33509e00a122a8d573e..08ab1eb4562c728009d78035998e9b5adcd4e6ea 100644 (file)
@@ -907,6 +907,15 @@ static int s2mu106_receive_message(void *data)
        if (ret < 0)
                dev_err(dev, "%s read msg header error\n", __func__);
 
+       if (pdic_data->header.spec_revision < 2 &&
+                       pdic_data->header.num_data_objs > 0 &&
+                       pdic_data->header.msg_type == 6) {
+               usleep_range(500, 900);
+               ret = s2mu106_read_msg_header(i2c, &pdic_data->header);
+               if (ret < 0)
+                       dev_err(dev, "%s read msg header error\n", __func__);
+       }
+
        obj_num = pdic_data->header.num_data_objs;
 
        if (obj_num > 0) {
index 6cd419ed88952208b4c4f8d8eb2cfec203491af2..c89a5d7b9a41e1ba0969c776b5739352124b88b1 100644 (file)
@@ -1149,6 +1149,7 @@ policy_state usbpd_policy_snk_ready(struct policy_data *policy)
        CHECK_MSG(pd_data, MSG_VCONN_SWAP, PE_VCS_Evaluate_Swap);
        CHECK_MSG(pd_data, MSG_GET_SRC_CAP, PE_DR_SNK_Give_Source_Cap);
        CHECK_MSG(pd_data, MSG_BIST, PE_BIST_Receive_Mode);
+       CHECK_MSG(pd_data, MSG_SRC_CAP, PE_SNK_Evaluate_Capability);
 
 #if 0
        CHECK_MSG(pd_data, VDM_DISCOVER_IDENTITY, PE_UFP_VDM_Get_Identity);