linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jun Li <jun.li@nxp.com>
To: Peter Chen <peter.chen@nxp.com>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>
Subject: [1/2] usb: chipiea: add flags for id and vbus from external block
Date: Mon, 25 Feb 2019 06:27:40 +0000	[thread overview]
Message-ID: <1551074807-27792-1-git-send-email-jun.li@nxp.com> (raw)

Add 2 flags for id and vbus if the state is from external blocks
instead of OTG block inside of USB controller.

Signed-off-by: Li Jun <jun.li@nxp.com>
---
 drivers/usb/chipidea/core.c  | 2 ++
 include/linux/usb/chipidea.h | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 7bfcbb2..0bfa850 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -706,6 +706,7 @@ static int ci_get_platdata(struct device *dev,
 	cable->edev = ext_vbus;
 
 	if (!IS_ERR(ext_vbus)) {
+		platdata->ext_vbus = true;
 		ret = extcon_get_state(cable->edev, EXTCON_USB);
 		if (ret)
 			cable->connected = true;
@@ -718,6 +719,7 @@ static int ci_get_platdata(struct device *dev,
 	cable->edev = ext_id;
 
 	if (!IS_ERR(ext_id)) {
+		platdata->ext_id = true;
 		ret = extcon_get_state(cable->edev, EXTCON_USB_HOST);
 		if (ret)
 			cable->connected = true;
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
index 911e05a..cd72d82 100644
--- a/include/linux/usb/chipidea.h
+++ b/include/linux/usb/chipidea.h
@@ -70,6 +70,10 @@ struct ci_hdrc_platform_data {
 	struct regulator	*reg_vbus;
 	struct usb_otg_caps	ci_otg_caps;
 	bool			tpl_support;
+	/* ID state is from external event out side of USB */
+	bool			ext_id;
+	/* VBUS state is from external event out side of USB */
+	bool			ext_vbus;
 	/* interrupt threshold setting */
 	u32			itc_setting;
 	u32			ahb_burst_config;

             reply	other threads:[~2019-02-25  6:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-25  6:27 Jun Li [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-02-26  6:52 [1/2] usb: chipiea: add flags for id and vbus from external block Peter Chen
2019-02-28  8:58 Jun Li
2019-03-01  3:03 Peter Chen
2019-03-05  7:09 Jun Li
2019-03-05  8:22 Peter Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1551074807-27792-1-git-send-email-jun.li@nxp.com \
    --to=jun.li@nxp.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.chen@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).