Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp291511ybj; Wed, 6 May 2020 17:53:16 -0700 (PDT) X-Google-Smtp-Source: APiQypLjZ0Yb4A7F+KIHbwg5C9rCxVP/P9tCRyiGcRzNEPWKsa1hHL9a0YjxdH5TvlIUUfNE5bFj X-Received: by 2002:a05:6402:221c:: with SMTP id cq28mr9075692edb.50.1588812796241; Wed, 06 May 2020 17:53:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588812796; cv=none; d=google.com; s=arc-20160816; b=byntVBx+DPR1Mgb+3WoHOK+xeKdGS7MKhxK6gxW/TOG0TqTfbODN9/FhoHORaCv93B ZrozKNGONAy9D60DZZKdC8hWgZ3q1vimjCuIpPSbcB+1KbciLWrQHabySZ5jd2RwGdXZ QgIEASbO27PLl0oWDf2HYWqkWSuUKM93wx/R/+Xq/pUHZHsVbvBy5s/khrhjURn6gtDd sC2UaRA1P3qkLRmg7ok9uyvucBmBtAT1XJZerT6NIJo2Vl4+ipGVyBfMAFNJcUAe2NiT arVtoazR89XynJmetGRwYhFj0PEfkquoViQ7xaiHFTBXVgLnqPaxLPngfHqIq/UmK+u2 RyIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=if/GOdDEQauNBp7mgMAjt53Kb3xN09kmGHW2/oJkKvI=; b=bc5jG8P4NHKcjg1IXov53N5lS4F0ifuJ9vZKhmMmfQsJVvQwK6pH0nkewGIIUjymKw lc8/BJOjjaGQgE2IFRD/7XF3uT9KRr7/a8mb9MEZe+APlgd+TYx6lMrvBnCHfPmp8vzV Vcx6DFx4IpRwsZ3fpfGC3eltO/ujqx/txgPT69xz2fBtwH2bParsMW7SfQkEaN7RaV5H vo9JCEAQ/rJnFCTtJBcv5HV4ANQOGu4i44A04RVzyA62sNGDASw+D8zJXUClHaA75Hlt Pyh6kKpNFeHfa0lbb+/haU9mXeHkw13r7Pz28HvADIrQfzUbpVMgUfqyqCJsNzgzX92I S9xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aC4XblCA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t4si2105890ejr.418.2020.05.06.17.52.52; Wed, 06 May 2020 17:53:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aC4XblCA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727970AbgEGAtg (ORCPT + 99 others); Wed, 6 May 2020 20:49:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:45854 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725887AbgEGAtf (ORCPT ); Wed, 6 May 2020 20:49:35 -0400 Received: from localhost.localdomain (unknown [180.171.74.255]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 809F020736; Thu, 7 May 2020 00:49:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588812575; bh=6dM9PvAApVzyT0m8Cbbv9yowJQZ8Y9LI5uoElqgxx2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aC4XblCAXelcpdT4g5npOeH0svbcWQnL9zwy+1a5AogvuNDzvRENS1pL0Y4X1sOnN esDustmO4MR+8PzyZKkVoGTvvoDD+9P7FD139/HMXdYX019p4evUijHQGNQca2CDGT V1jy1ciCsuvvrV0yMnvkxTGg2gO/oTK6GAI0evM4= From: Peter Chen To: gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, Bryan O'Donoghue , Peter Chen , Philipp Zabel , linux-kernel@vger.kernel.org, Stephen Boyd , Peter Chen Subject: [PATCH 1/1] usb: chipidea: msm: Ensure proper controller reset using role switch API Date: Thu, 7 May 2020 08:49:18 +0800 Message-Id: <20200507004918.25975-2-peter.chen@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200507004918.25975-1-peter.chen@kernel.org> References: <20200507004918.25975-1-peter.chen@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bryan O'Donoghue Currently we check to make sure there is no error state on the extcon handle for VBUS when writing to the HS_PHY_GENCONFIG_2 register. When using the USB role-switch API we still need to write to this register absent an extcon handle. This patch makes the appropriate update to ensure the write happens if role-switching is true. Fixes: 05559f10ed79 ("usb: chipidea: add role switch class support") Cc: Peter Chen Cc: Greg Kroah-Hartman Cc: Philipp Zabel Cc: linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Stephen Boyd Signed-off-by: Bryan O'Donoghue Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci_hdrc_msm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c index af648ba6544d..46105457e1ca 100644 --- a/drivers/usb/chipidea/ci_hdrc_msm.c +++ b/drivers/usb/chipidea/ci_hdrc_msm.c @@ -114,7 +114,7 @@ static int ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) hw_write_id_reg(ci, HS_PHY_GENCONFIG_2, HS_PHY_ULPI_TX_PKT_EN_CLR_FIX, 0); - if (!IS_ERR(ci->platdata->vbus_extcon.edev)) { + if (!IS_ERR(ci->platdata->vbus_extcon.edev) || ci->role_switch) { hw_write_id_reg(ci, HS_PHY_GENCONFIG_2, HS_PHY_SESS_VLD_CTRL_EN, HS_PHY_SESS_VLD_CTRL_EN); -- 2.17.1