From patchwork Wed Sep 7 21:35:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 75695 Delivered-To: patch@linaro.org Received: by 10.140.106.11 with SMTP id d11csp526007qgf; Wed, 7 Sep 2016 14:36:06 -0700 (PDT) X-Received: by 10.66.135.175 with SMTP id pt15mr22760404pab.134.1473284166177; Wed, 07 Sep 2016 14:36:06 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xn1si40335838pab.38.2016.09.07.14.35.58; Wed, 07 Sep 2016 14:36:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757508AbcIGVfv (ORCPT + 8 others); Wed, 7 Sep 2016 17:35:51 -0400 Received: from mail-pf0-f169.google.com ([209.85.192.169]:35604 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757202AbcIGVfb (ORCPT ); Wed, 7 Sep 2016 17:35:31 -0400 Received: by mail-pf0-f169.google.com with SMTP id w87so10452014pfk.2 for ; Wed, 07 Sep 2016 14:35:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uch56ZvhF5xp5y6dvw/o5yQzsyDzQXKAfAJl8gmsyJk=; b=VS2aZJ/Co5Mc90gn155hUHAc19IwDqlxnjVimmfkP4lpIkHNj57ELtRAJ1ZmlNt8Va 7NKWXUg6KQ/062X19MpPNU1I4Uuvl3qxoG+i4SDxm5JasM6QWgvX2P2qJAcc/Ws+Iebe pDIbPmGfc/9VNoE90oiepN9PG6g/rr7zZYaYI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uch56ZvhF5xp5y6dvw/o5yQzsyDzQXKAfAJl8gmsyJk=; b=fhTTBkaE9E/OvHKGZpmQSQKf/icniqXfxzPZpGK/18gNzMKhNQuLLYOxbT6udNeprZ 5FjIZmgbqJ4IcAtAbJwRjYkTWmnoAvlrEkymoDAKgb66NNdYnCJLTIuPawZ4utCPgsu0 Jc/TBgghbCEu1wCXDsVefFHatW4GPAkv3mmLBY/gFTpZ7JepDkbc9u4R6+TtrbCCZ9lA pbArsa9PgnulVBltoZFBYtw1ZfjFiR/FSL0riCjYcLwbb0Gbg8eQmUa3QBGdcC+S0NKw UG4IzzAXqct+E8P9jWch5g9yqCNkdIWLLGyUr0cjtYZjWPZtI2WK+ZbZqiiqWM7iHBeL YMtA== X-Gm-Message-State: AE9vXwNah6DUO8ubqEWuCArZa9J9Bn95tyvbrQsQ/KE8VfQLeHb0PBOoJJZ+A1w+lNoMMi8W X-Received: by 10.98.57.151 with SMTP id u23mr86114244pfj.4.1473284130726; Wed, 07 Sep 2016 14:35:30 -0700 (PDT) Received: from localhost.localdomain (ip68-101-172-78.sd.sd.cox.net. [68.101.172.78]) by smtp.gmail.com with ESMTPSA id 75sm51015417pfw.92.2016.09.07.14.35.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Sep 2016 14:35:30 -0700 (PDT) From: Stephen Boyd To: linux-usb@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Andy Gross , Bjorn Andersson , Neil Armstrong , Arnd Bergmann , Felipe Balbi , Peter Chen , Greg Kroah-Hartman Subject: [PATCH v4 07/22] usb: chipidea: Notify events when switching host mode Date: Wed, 7 Sep 2016 14:35:04 -0700 Message-Id: <20160907213519.27340-8-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.9.0.rc2.8.ga28705d In-Reply-To: <20160907213519.27340-1-stephen.boyd@linaro.org> References: <20160907213519.27340-1-stephen.boyd@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The chipidea/udc.c file sends a CI_HDRC_CONTROLLER_RESET_EVENT to the wrapper drivers when it calls hw_device_reset(), but that function is not called from chipidea/host.c. And the udc.c file sends the CI_HDRC_CONTROLLER_STOPPED_EVENT but the host.c file doesn't do anything. The intent of the reset event is to allow the wrapper driver to do any wrapper specific things after the reset bit has been set in the usb command register. Therefore, add this event hook in the host role after we toggle that bit. Similarly, the intent of the stopped event is to allow the wrapper driver to do any wrapper specific things after the device is stopped. So when we stop the host role, send the stopped event. Acked-by: Peter Chen Cc: Greg Kroah-Hartman Signed-off-by: Stephen Boyd --- drivers/usb/chipidea/host.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.9.0.rc2.8.ga28705d -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c index 053bac9d983c..a1d8551ca79d 100644 --- a/drivers/usb/chipidea/host.c +++ b/drivers/usb/chipidea/host.c @@ -87,6 +87,9 @@ static int ehci_ci_reset(struct usb_hcd *hcd) if (ret) return ret; + if (ci->platdata->notify_event) + ci->platdata->notify_event(ci, CI_HDRC_CONTROLLER_RESET_EVENT); + ci_platform_configure(ci); return ret; @@ -184,6 +187,9 @@ static void host_stop(struct ci_hdrc *ci) struct usb_hcd *hcd = ci->hcd; if (hcd) { + if (ci->platdata->notify_event) + ci->platdata->notify_event(ci, + CI_HDRC_CONTROLLER_STOPPED_EVENT); usb_remove_hcd(hcd); usb_put_hcd(hcd); if (ci->platdata->reg_vbus && !ci_otg_is_fsm_mode(ci) &&