Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1438971

[PATCH v2 07/22] usb: chipidea: Notify events when switching host mode

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod
From Stephen Boyd <stephen.boyd@linaro.org>
Newsgroups linux.kernel
Subject [PATCH v2 07/22] usb: chipidea: Notify events when switching host mode
Date Fri, 08 Jul 2016 00:30:02 +0200
Message-ID <rSpXY-4yB-45@gated-at.bofh.it> (permalink)
References <rSpXX-4yB-3@gated-at.bofh.it>
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=Bz7vuiHXmxfkH3+h6wmbnQQ8j9ZPDES12TXM5cV0PKYr788frAcKGkhNlsDRFjEUKe BU8AozSrR6iSLcjot9OR0O9pkhftLUTQP7ndn1J/WaDy+j0U1tGBetpEpsXa80Rb92Bg e4UC9AvKSB1TdcPbFMslCgfDQbcZ3Jayljf22zElmGKYcc/UPHw4KJtuHoISZU26PehM /BNmilYe41NmHHlQcqX80tnk0B9HGj6oRYye6DvyySzccZdwWaldq0nOwOJXKPKqNrnU gUMS3Lpixqlgt/U+NRdwvcdy+ewgVcOi+AL+p7XPv3nX9Quy5Xut0bZ+RNZRLyOYKlHB Sb6Q==
X-Gm-Message-State ALyK8tJ6pq9uysugSQKHWK96PZwkSDxdaAKv4rnjIHG8rLMP5gcyAcILXlXPD6cae0P60glg
X-Received by 10.98.67.7 with SMTP id q7mr4276599pfa.150.1467930088444; Thu, 07 Jul 2016 15:21:28 -0700 (PDT)
X-Mailer git-send-email 2.9.0.rc2.8.ga28705d
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 49
Organization linux.* mail to news gateway
X-Original-Cc linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Andy Gross <andy.gross@linaro.org>, Bjorn Andersson <bjorn.andersson@linaro.org>, Neil Armstrong <narmstrong@baylibre.com>, Arnd Bergmann <arnd@arndb.de>, Felipe Balbi <balbi@kernel.org>, Peter Chen <peter.chen@nxp.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>
X-Original-Date Thu, 7 Jul 2016 15:20:58 -0700
X-Original-Message-ID <20160707222114.1673-8-stephen.boyd@linaro.org>
X-Original-References <20160707222114.1673-1-stephen.boyd@linaro.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1438971

Show key headers only | View raw


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 <peter.chen@nxp.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
---
 drivers/usb/chipidea/host.c | 6 ++++++
 1 file changed, 6 insertions(+)

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) &&
-- 
2.9.0.rc2.8.ga28705d

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 07/22] usb: chipidea: Notify events when switching host mode Stephen Boyd <stephen.boyd@linaro.org> - 2016-07-08 00:30 +0200
  Re: [PATCH v2 07/22] usb: chipidea: Notify events when switching  host mode Peter Chen <hzpeterchen@gmail.com> - 2016-07-08 11:50 +0200

csiph-web