From patchwork Thu Jul 7 22:20:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 71643 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp126838qgy; Thu, 7 Jul 2016 15:24:00 -0700 (PDT) X-Received: by 10.98.134.15 with SMTP id x15mr4208697pfd.21.1467930231876; Thu, 07 Jul 2016 15:23:51 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id 64si403008pfq.207.2016.07.07.15.23.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jul 2016 15:23:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; 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-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bLHh1-0008P7-9p; Thu, 07 Jul 2016 22:22:47 +0000 Received: from mail-pf0-x22d.google.com ([2607:f8b0:400e:c00::22d]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bLHg5-0007er-2r for linux-arm-kernel@lists.infradead.org; Thu, 07 Jul 2016 22:21:50 +0000 Received: by mail-pf0-x22d.google.com with SMTP id c2so9781214pfa.2 for ; Thu, 07 Jul 2016 15:21:28 -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=TRPHkws/AXOZ/9ruwjd/2FbidJySF8cv8S55LT2aLNs=; b=f0HlzbdrJhp57ZQd5dkkzAUsAZ2IwhYRlDUtbutdjHwzHwqfFM2gxJMuzyPXSeexOV oihfvieSQ5ut8QgbZ/ny+xu+X6yD3FiROwk9IXeTtsqlwC6DCsbNVDnUnSaCYj/H1ckq fOmWih+sTPS1bgf0/YJ2ngwl52aBppnpCVqoI= 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=TRPHkws/AXOZ/9ruwjd/2FbidJySF8cv8S55LT2aLNs=; b=Vroc3AIziAdNHbtS9X/w0OS+szTtObslu1j9oiQYDLUslZpMfek6xMF/uviOLnBiqb q2f4zAeqJbbIRYr1y3X5HMa0KDQ/i7OCt80ChKARDJfTQaeoyMCd3YRQlzNSmJamc05+ bbAOmYA2stIGIWgN7TYIpXM7M0fcFKLzKsnPZBxCxabiLURr/OIGVbdW5A5anm+twm7+ 1zkIZ0E69fuNXrGHJLI5xQvnarnDcp9E3RHpO/oDjfoswN1b9gHAoGeovvEye3tDm76c Y2WHWpl0vUX3cRaTWFpHZa1RBfuLLcaq7A0VpN1OxSSMvRZEGwARzIhK20mazOmjLOt3 ffuA== X-Gm-Message-State: ALyK8tLnoNUyMZsAHpbZ+dlSV66FVRrmjDHwoGfvRCqIvTEdFp+ixa3vccNE/cOEUHZUBISm X-Received: by 10.98.67.7 with SMTP id q7mr4276599pfa.150.1467930088444; Thu, 07 Jul 2016 15:21:28 -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 j8sm6781807paj.22.2016.07.07.15.21.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Jul 2016 15:21:27 -0700 (PDT) From: Stephen Boyd To: linux-usb@vger.kernel.org Subject: [PATCH v2 07/22] usb: chipidea: Notify events when switching host mode Date: Thu, 7 Jul 2016 15:20:58 -0700 Message-Id: <20160707222114.1673-8-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.9.0.rc2.8.ga28705d In-Reply-To: <20160707222114.1673-1-stephen.boyd@linaro.org> References: <20160707222114.1673-1-stephen.boyd@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160707_152149_272789_4825342A X-CRM114-Status: GOOD ( 15.05 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c00:0:0:0:22d listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Felipe Balbi , Arnd Bergmann , Neil Armstrong , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Andersson , Peter Chen , Greg Kroah-Hartman , Andy Gross , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.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. Cc: 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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) &&