All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <stephen.boyd@linaro.org>
To: Peter Chen <peter.chen@nxp.com>, Kishon Vijay Abraham I <kishon@ti.com>
Cc: Felipe Balbi <balbi@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	Neil Armstrong <narmstrong@baylibre.com>,
	linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Andy Gross <andy.gross@linaro.org>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH v7 4/5] usb: chipidea: Signal vbus state to phy
Date: Fri, 20 Jan 2017 10:50:56 -0800	[thread overview]
Message-ID: <20170120185057.16206-5-stephen.boyd@linaro.org> (raw)
In-Reply-To: <20170120185057.16206-1-stephen.boyd@linaro.org>

Some USB PHYs need to be told about vbus changing state
explicitly. For example the qcom USB HS PHY needs to toggle a bit
when vbus goes from low to high (VBUSVLDEXT) to cause the
"session valid" signal to toggle. This signal will pull up D+
when the phy starts running. Add the appropriate phy_set_vbus()
call here to signal vbus state changes to the phy.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
---

New patch

 drivers/usb/chipidea/otg.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/chipidea/otg.c b/drivers/usb/chipidea/otg.c
index 10236fe71522..6ea702beed48 100644
--- a/drivers/usb/chipidea/otg.c
+++ b/drivers/usb/chipidea/otg.c
@@ -134,10 +134,13 @@ void ci_handle_vbus_change(struct ci_hdrc *ci)
 	if (!ci->is_otg)
 		return;
 
-	if (hw_read_otgsc(ci, OTGSC_BSV) && !ci->vbus_active)
+	if (hw_read_otgsc(ci, OTGSC_BSV) && !ci->vbus_active) {
 		usb_gadget_vbus_connect(&ci->gadget);
-	else if (!hw_read_otgsc(ci, OTGSC_BSV) && ci->vbus_active)
+		phy_set_vbus(ci->phy, 1);
+	} else if (!hw_read_otgsc(ci, OTGSC_BSV) && ci->vbus_active) {
+		phy_set_vbus(ci->phy, 0);
 		usb_gadget_vbus_disconnect(&ci->gadget);
+	}
 }
 
 /**
-- 
2.10.0.297.gf6727b0

WARNING: multiple messages have this Message-ID (diff)
From: stephen.boyd@linaro.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v7 4/5] usb: chipidea: Signal vbus state to phy
Date: Fri, 20 Jan 2017 10:50:56 -0800	[thread overview]
Message-ID: <20170120185057.16206-5-stephen.boyd@linaro.org> (raw)
In-Reply-To: <20170120185057.16206-1-stephen.boyd@linaro.org>

Some USB PHYs need to be told about vbus changing state
explicitly. For example the qcom USB HS PHY needs to toggle a bit
when vbus goes from low to high (VBUSVLDEXT) to cause the
"session valid" signal to toggle. This signal will pull up D+
when the phy starts running. Add the appropriate phy_set_vbus()
call here to signal vbus state changes to the phy.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
---

New patch

 drivers/usb/chipidea/otg.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/chipidea/otg.c b/drivers/usb/chipidea/otg.c
index 10236fe71522..6ea702beed48 100644
--- a/drivers/usb/chipidea/otg.c
+++ b/drivers/usb/chipidea/otg.c
@@ -134,10 +134,13 @@ void ci_handle_vbus_change(struct ci_hdrc *ci)
 	if (!ci->is_otg)
 		return;
 
-	if (hw_read_otgsc(ci, OTGSC_BSV) && !ci->vbus_active)
+	if (hw_read_otgsc(ci, OTGSC_BSV) && !ci->vbus_active) {
 		usb_gadget_vbus_connect(&ci->gadget);
-	else if (!hw_read_otgsc(ci, OTGSC_BSV) && ci->vbus_active)
+		phy_set_vbus(ci->phy, 1);
+	} else if (!hw_read_otgsc(ci, OTGSC_BSV) && ci->vbus_active) {
+		phy_set_vbus(ci->phy, 0);
 		usb_gadget_vbus_disconnect(&ci->gadget);
+	}
 }
 
 /**
-- 
2.10.0.297.gf6727b0

WARNING: multiple messages have this Message-ID (diff)
From: Stephen Boyd <stephen.boyd@linaro.org>
To: Peter Chen <peter.chen@nxp.com>, Kishon Vijay Abraham I <kishon@ti.com>
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>,
	linux-usb@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [PATCH v7 4/5] usb: chipidea: Signal vbus state to phy
Date: Fri, 20 Jan 2017 10:50:56 -0800	[thread overview]
Message-ID: <20170120185057.16206-5-stephen.boyd@linaro.org> (raw)
In-Reply-To: <20170120185057.16206-1-stephen.boyd@linaro.org>

Some USB PHYs need to be told about vbus changing state
explicitly. For example the qcom USB HS PHY needs to toggle a bit
when vbus goes from low to high (VBUSVLDEXT) to cause the
"session valid" signal to toggle. This signal will pull up D+
when the phy starts running. Add the appropriate phy_set_vbus()
call here to signal vbus state changes to the phy.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
---

New patch

 drivers/usb/chipidea/otg.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/chipidea/otg.c b/drivers/usb/chipidea/otg.c
index 10236fe71522..6ea702beed48 100644
--- a/drivers/usb/chipidea/otg.c
+++ b/drivers/usb/chipidea/otg.c
@@ -134,10 +134,13 @@ void ci_handle_vbus_change(struct ci_hdrc *ci)
 	if (!ci->is_otg)
 		return;
 
-	if (hw_read_otgsc(ci, OTGSC_BSV) && !ci->vbus_active)
+	if (hw_read_otgsc(ci, OTGSC_BSV) && !ci->vbus_active) {
 		usb_gadget_vbus_connect(&ci->gadget);
-	else if (!hw_read_otgsc(ci, OTGSC_BSV) && ci->vbus_active)
+		phy_set_vbus(ci->phy, 1);
+	} else if (!hw_read_otgsc(ci, OTGSC_BSV) && ci->vbus_active) {
+		phy_set_vbus(ci->phy, 0);
 		usb_gadget_vbus_disconnect(&ci->gadget);
+	}
 }
 
 /**
-- 
2.10.0.297.gf6727b0

  parent reply	other threads:[~2017-01-20 18:50 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-20 18:50 [PATCH v7 0/5] Support qcom's HSIC USB and rewrite USB2 HS support Stephen Boyd
2017-01-20 18:50 ` Stephen Boyd
2017-01-20 18:50 ` [PATCH v7 2/5] usb: chipidea: msm: Configure phy for appropriate mode Stephen Boyd
2017-01-20 18:50   ` Stephen Boyd
     [not found]   ` <20170120185057.16206-3-stephen.boyd-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-01-22  2:10     ` Peter Chen
2017-01-22  2:10       ` Peter Chen
2017-01-22  2:10       ` Peter Chen
2017-01-23 19:54       ` Stephen Boyd
2017-01-23 19:54         ` Stephen Boyd
     [not found] ` <20170120185057.16206-1-stephen.boyd-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-01-20 18:50   ` [PATCH v7 1/5] phy: Add support for Qualcomm's USB HSIC phy Stephen Boyd
2017-01-20 18:50     ` Stephen Boyd
2017-01-20 18:50     ` Stephen Boyd
2017-01-20 18:50   ` [PATCH v7 3/5] phy: Add set_vbus callback Stephen Boyd
2017-01-20 18:50     ` Stephen Boyd
2017-01-20 18:50     ` Stephen Boyd
2017-01-22  1:34     ` Peter Chen
2017-01-22  1:34       ` Peter Chen
2017-01-22  8:46     ` Kishon Vijay Abraham I
2017-01-22  8:46       ` Kishon Vijay Abraham I
2017-01-22  8:46       ` Kishon Vijay Abraham I
2017-01-23 19:58       ` Stephen Boyd
2017-01-23 19:58         ` Stephen Boyd
2017-01-24  9:23         ` Kishon Vijay Abraham I
2017-01-24  9:23           ` Kishon Vijay Abraham I
2017-01-24  9:23           ` Kishon Vijay Abraham I
2017-01-20 18:50 ` Stephen Boyd [this message]
2017-01-20 18:50   ` [PATCH v7 4/5] usb: chipidea: Signal vbus state to phy Stephen Boyd
2017-01-20 18:50   ` Stephen Boyd
2017-01-22  1:37   ` Peter Chen
2017-01-22  1:37     ` Peter Chen
2017-01-20 18:50 ` [PATCH v7 5/5] phy: Add support for Qualcomm's USB HS phy Stephen Boyd
2017-01-20 18:50   ` Stephen Boyd

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=20170120185057.16206-5-stephen.boyd@linaro.org \
    --to=stephen.boyd@linaro.org \
    --cc=andy.gross@linaro.org \
    --cc=arnd@arndb.de \
    --cc=balbi@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kishon@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=narmstrong@baylibre.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.