Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751744AbdH1RYQ (ORCPT ); Mon, 28 Aug 2017 13:24:16 -0400 Received: from mail-pf0-f175.google.com ([209.85.192.175]:35551 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751385AbdH1RYO (ORCPT ); Mon, 28 Aug 2017 13:24:14 -0400 X-Google-Smtp-Source: ADKCNb4ISRJg3j47lpTD4VQ9VgOg+kQgtTDyh9svl6ixxjjtE4Gf1zTdqNQT5Ex/80Pe75TkehXWQg== From: Badhri Jagan Sridharan X-Google-Original-From: Badhri Jagan Sridharan To: Greg Kroah-Hartman , Guenter Roeck Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Badhri Jagan Sridharan Subject: [PATCH 11/11 v3] staging: typec: tcpm: Switch to PORT_RESET instead of SNK_UNATTACHED Date: Mon, 28 Aug 2017 10:23:22 -0700 Message-Id: <20170828172322.7166-11-Badhri@google.com> X-Mailer: git-send-email 2.14.1.342.g6490525c54-goog In-Reply-To: <20170828172322.7166-1-Badhri@google.com> References: <20170828172322.7166-1-Badhri@google.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1341 Lines: 37 When VBUS is not discovered within PD_T_PS_SOURCE_ON although Rp is detected on CC, TCPM switches the port to SNK_UNATTACHED state. SNK_UNATTACHED, however does not force TYPEC_CC_OPEN which makes the partner(source) to think that it is connected. To overcome this issue, force the port into PORT_RESET state to make sure the CC lines are open. Signed-off-by: Badhri Jagan Sridharan Reviewed-by: Guenter Roeck --- Changelog since previous version: - Only one previous version of the patch was sent. Numbering this V3 instead of V2 to keep the sequence number in sync with the rest of the patches in the patch list. - added Reviewed-by: Guenter Roeck - fixed version/sequence numbers drivers/staging/typec/tcpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/typec/tcpm.c b/drivers/staging/typec/tcpm.c index 9e0111dea7c4..47b8fec5ea36 100644 --- a/drivers/staging/typec/tcpm.c +++ b/drivers/staging/typec/tcpm.c @@ -2380,7 +2380,7 @@ static void run_state_machine(struct tcpm_port *port) 0); else /* Wait for VBUS, but not forever */ - tcpm_set_state(port, SNK_UNATTACHED, PD_T_PS_SOURCE_ON); + tcpm_set_state(port, PORT_RESET, PD_T_PS_SOURCE_ON); break; case SRC_TRY: -- 2.14.1.342.g6490525c54-goog