* [PATCH RESEND] usb: chipidea: msm: Use USB PHY API to control PHY state
@ 2014-08-15 9:21 Ivan T. Ivanov
2014-08-19 19:06 ` Felipe Balbi
0 siblings, 1 reply; 3+ messages in thread
From: Ivan T. Ivanov @ 2014-08-15 9:21 UTC (permalink / raw)
To: Peter Chen
Cc: Ivan T. Ivanov, Greg Kroah-Hartman, Tim Bird, balbi, linux-usb,
linux-arm-msm, linux-kernel
From: "Ivan T. Ivanov" <iivanov@mm-sol.com>
PHY drivers keep track of the current state of the hardware,
so don't change PHY settings under it.
Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
---
drivers/usb/chipidea/ci_hdrc_msm.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c
index d72b9d2..81de834 100644
--- a/drivers/usb/chipidea/ci_hdrc_msm.c
+++ b/drivers/usb/chipidea/ci_hdrc_msm.c
@@ -20,13 +20,11 @@
static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event)
{
struct device *dev = ci->gadget.dev.parent;
- int val;
switch (event) {
case CI_HDRC_CONTROLLER_RESET_EVENT:
dev_dbg(dev, "CI_HDRC_CONTROLLER_RESET_EVENT received\n");
- writel(0, USB_AHBBURST);
- writel(0, USB_AHBMODE);
+ usb_phy_init(ci->transceiver);
break;
case CI_HDRC_CONTROLLER_STOPPED_EVENT:
dev_dbg(dev, "CI_HDRC_CONTROLLER_STOPPED_EVENT received\n");
@@ -34,10 +32,7 @@ static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event)
* Put the transceiver in non-driving mode. Otherwise host
* may not detect soft-disconnection.
*/
- val = usb_phy_io_read(ci->transceiver, ULPI_FUNC_CTRL);
- val &= ~ULPI_FUNC_CTRL_OPMODE_MASK;
- val |= ULPI_FUNC_CTRL_OPMODE_NONDRIVING;
- usb_phy_io_write(ci->transceiver, val, ULPI_FUNC_CTRL);
+ usb_phy_notify_disconnect(ci->transceiver, USB_SPEED_UNKNOWN);
break;
default:
dev_dbg(dev, "unknown ci_hdrc event\n");
--
1.8.3.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH RESEND] usb: chipidea: msm: Use USB PHY API to control PHY state
2014-08-15 9:21 [PATCH RESEND] usb: chipidea: msm: Use USB PHY API to control PHY state Ivan T. Ivanov
@ 2014-08-19 19:06 ` Felipe Balbi
2014-08-25 8:49 ` Ivan T. Ivanov
0 siblings, 1 reply; 3+ messages in thread
From: Felipe Balbi @ 2014-08-19 19:06 UTC (permalink / raw)
To: Ivan T. Ivanov
Cc: Peter Chen, Greg Kroah-Hartman, Tim Bird, balbi, linux-usb,
linux-arm-msm, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1937 bytes --]
On Fri, Aug 15, 2014 at 12:21:19PM +0300, Ivan T. Ivanov wrote:
> From: "Ivan T. Ivanov" <iivanov@mm-sol.com>
>
> PHY drivers keep track of the current state of the hardware,
> so don't change PHY settings under it.
>
> Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
looks correct to me from a PHY API perspective, so:
Acked-by: Felipe Balbi <balbi@ti.com>
However, it doesn't look like msm_phy_init() is equivalent to the lines
removes. Care to comment ?
> ---
> drivers/usb/chipidea/ci_hdrc_msm.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c
> index d72b9d2..81de834 100644
> --- a/drivers/usb/chipidea/ci_hdrc_msm.c
> +++ b/drivers/usb/chipidea/ci_hdrc_msm.c
> @@ -20,13 +20,11 @@
> static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event)
> {
> struct device *dev = ci->gadget.dev.parent;
> - int val;
>
> switch (event) {
> case CI_HDRC_CONTROLLER_RESET_EVENT:
> dev_dbg(dev, "CI_HDRC_CONTROLLER_RESET_EVENT received\n");
> - writel(0, USB_AHBBURST);
> - writel(0, USB_AHBMODE);
> + usb_phy_init(ci->transceiver);
> break;
> case CI_HDRC_CONTROLLER_STOPPED_EVENT:
> dev_dbg(dev, "CI_HDRC_CONTROLLER_STOPPED_EVENT received\n");
> @@ -34,10 +32,7 @@ static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event)
> * Put the transceiver in non-driving mode. Otherwise host
> * may not detect soft-disconnection.
> */
> - val = usb_phy_io_read(ci->transceiver, ULPI_FUNC_CTRL);
> - val &= ~ULPI_FUNC_CTRL_OPMODE_MASK;
> - val |= ULPI_FUNC_CTRL_OPMODE_NONDRIVING;
> - usb_phy_io_write(ci->transceiver, val, ULPI_FUNC_CTRL);
> + usb_phy_notify_disconnect(ci->transceiver, USB_SPEED_UNKNOWN);
> break;
> default:
> dev_dbg(dev, "unknown ci_hdrc event\n");
> --
> 1.8.3.2
>
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH RESEND] usb: chipidea: msm: Use USB PHY API to control PHY state
2014-08-19 19:06 ` Felipe Balbi
@ 2014-08-25 8:49 ` Ivan T. Ivanov
0 siblings, 0 replies; 3+ messages in thread
From: Ivan T. Ivanov @ 2014-08-25 8:49 UTC (permalink / raw)
To: balbi
Cc: Peter Chen, Greg Kroah-Hartman, Tim Bird, linux-usb,
linux-arm-msm, linux-kernel
On Tue, 2014-08-19 at 14:06 -0500, Felipe Balbi wrote:
> On Fri, Aug 15, 2014 at 12:21:19PM +0300, Ivan T. Ivanov wrote:
> > From: "Ivan T. Ivanov" <iivanov@mm-sol.com>
> >
> > PHY drivers keep track of the current state of the hardware,
> > so don't change PHY settings under it.
> >
> > Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
>
> looks correct to me from a PHY API perspective, so:
>
> Acked-by: Felipe Balbi <balbi@ti.com>
>
Thanks.
> However, it doesn't look like msm_phy_init() is equivalent to the lines
> removes. Care to comment ?
>
What I have to actually do is just add phy_init(). No need to remove
controller reinitialization. Tested and is working. Will post 2 new
patches shortly.
Regards,
Ivan
> > ---
> > drivers/usb/chipidea/ci_hdrc_msm.c | 9 ++-------
> > 1 file changed, 2 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c
> > index d72b9d2..81de834 100644
> > --- a/drivers/usb/chipidea/ci_hdrc_msm.c
> > +++ b/drivers/usb/chipidea/ci_hdrc_msm.c
> > @@ -20,13 +20,11 @@
> > static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event)
> > {
> > struct device *dev = ci->gadget.dev.parent;
> > - int val;
> >
> > switch (event) {
> > case CI_HDRC_CONTROLLER_RESET_EVENT:
> > dev_dbg(dev, "CI_HDRC_CONTROLLER_RESET_EVENT received\n");
> > - writel(0, USB_AHBBURST);
> > - writel(0, USB_AHBMODE);
> > + usb_phy_init(ci->transceiver);
> > break;
> > case CI_HDRC_CONTROLLER_STOPPED_EVENT:
> > dev_dbg(dev, "CI_HDRC_CONTROLLER_STOPPED_EVENT received\n");
> > @@ -34,10 +32,7 @@ static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event)
> > * Put the transceiver in non-driving mode. Otherwise host
> > * may not detect soft-disconnection.
> > */
> > - val = usb_phy_io_read(ci->transceiver, ULPI_FUNC_CTRL);
> > - val &= ~ULPI_FUNC_CTRL_OPMODE_MASK;
> > - val |= ULPI_FUNC_CTRL_OPMODE_NONDRIVING;
> > - usb_phy_io_write(ci->transceiver, val, ULPI_FUNC_CTRL);
> > + usb_phy_notify_disconnect(ci->transceiver, USB_SPEED_UNKNOWN);
> > break;
> > default:
> > dev_dbg(dev, "unknown ci_hdrc event\n");
> > --
> > 1.8.3.2
> >
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-08-25 8:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-15 9:21 [PATCH RESEND] usb: chipidea: msm: Use USB PHY API to control PHY state Ivan T. Ivanov
2014-08-19 19:06 ` Felipe Balbi
2014-08-25 8:49 ` Ivan T. Ivanov
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).