2014-04-22 09:23:06

by Ivan T. Ivanov

[permalink] [raw]
Subject: [PATCH v6 15/19] usb: phy: msm: Fix PTS definitions for MSM USB controller

From: Tim Bird <[email protected]>

Fix the value used for Parallel Transceiver Select (PTS) for the MSM USB
controller. This is a standard chipidea PORTSC definition, where
a PHY_TYPE of 10b (<<30) is ULPI and 11b (<<30) is SERIAL.
Fix the definitions and use them correctly in the driver code.

Signed-off-by: Tim Bird <[email protected]>
---
drivers/usb/phy/phy-msm-usb.c | 8 +++++---
include/linux/usb/msm_hsusb_hw.h | 5 +++--
2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index dababf9..e83d13a 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -287,8 +287,9 @@ static int msm_link_reset(struct msm_otg *motg)
if (motg->phy_number)
writel(readl(USB_PHY_CTRL2) | BIT(16), USB_PHY_CTRL2);

+ /* put transciever in serial mode as part of reset */
val = readl(USB_PORTSC) & ~PORTSC_PTS_MASK;
- writel(val | PORTSC_PTS_ULPI, USB_PORTSC);
+ writel(val | PORTSC_PTS_SERIAL, USB_PORTSC);

return 0;
}
@@ -308,8 +309,9 @@ static int msm_otg_reset(struct usb_phy *phy)
if (cnt >= LINK_RESET_TIMEOUT_USEC)
return -ETIMEDOUT;

- /* select ULPI phy */
- writel(0x80000000, USB_PORTSC);
+ /* select ULPI phy and clear other status/control bits in PORTSC */
+ writel(PORTSC_PTS_ULPI, USB_PORTSC);
+
writel(0x0, USB_AHBBURST);
writel(0x08, USB_AHBMODE);

diff --git a/include/linux/usb/msm_hsusb_hw.h b/include/linux/usb/msm_hsusb_hw.h
index 575c743..98d3dd8 100644
--- a/include/linux/usb/msm_hsusb_hw.h
+++ b/include/linux/usb/msm_hsusb_hw.h
@@ -31,8 +31,9 @@
#define USB_USBINTR (MSM_USB_BASE + 0x0148)

#define PORTSC_PHCD (1 << 23) /* phy suspend mode */
-#define PORTSC_PTS_MASK (3 << 30)
-#define PORTSC_PTS_ULPI (3 << 30)
+#define PORTSC_PTS_MASK (3 << 30)
+#define PORTSC_PTS_ULPI (2 << 30)
+#define PORTSC_PTS_SERIAL (3 << 30)

#define USB_ULPI_VIEWPORT (MSM_USB_BASE + 0x0170)
#define ULPI_RUN (1 << 30)
--
1.8.3.2


2014-04-22 13:10:07

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH v6 15/19] usb: phy: msm: Fix PTS definitions for MSM USB controller

Hello.

On 22-04-2014 13:20, Ivan T. Ivanov wrote:

> From: Tim Bird <[email protected]>

> Fix the value used for Parallel Transceiver Select (PTS) for the MSM USB
> controller. This is a standard chipidea PORTSC definition, where
> a PHY_TYPE of 10b (<<30) is ULPI and 11b (<<30) is SERIAL.
> Fix the definitions and use them correctly in the driver code.

> Signed-off-by: Tim Bird <[email protected]>
> ---
> drivers/usb/phy/phy-msm-usb.c | 8 +++++---
> include/linux/usb/msm_hsusb_hw.h | 5 +++--
> 2 files changed, 8 insertions(+), 5 deletions(-)

> diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
> index dababf9..e83d13a 100644
> --- a/drivers/usb/phy/phy-msm-usb.c
> +++ b/drivers/usb/phy/phy-msm-usb.c
> @@ -287,8 +287,9 @@ static int msm_link_reset(struct msm_otg *motg)
> if (motg->phy_number)
> writel(readl(USB_PHY_CTRL2) | BIT(16), USB_PHY_CTRL2);
>
> + /* put transciever in serial mode as part of reset */

s/transciever/transceiver/

[...]

> diff --git a/include/linux/usb/msm_hsusb_hw.h b/include/linux/usb/msm_hsusb_hw.h
> index 575c743..98d3dd8 100644
> --- a/include/linux/usb/msm_hsusb_hw.h
> +++ b/include/linux/usb/msm_hsusb_hw.h
> @@ -31,8 +31,9 @@
> #define USB_USBINTR (MSM_USB_BASE + 0x0148)
>
> #define PORTSC_PHCD (1 << 23) /* phy suspend mode */
> -#define PORTSC_PTS_MASK (3 << 30)
> -#define PORTSC_PTS_ULPI (3 << 30)
> +#define PORTSC_PTS_MASK (3 << 30)
> +#define PORTSC_PTS_ULPI (2 << 30)
> +#define PORTSC_PTS_SERIAL (3 << 30)

Please use tabs, not spaces here.

WBR, Sergei

2014-04-23 13:25:35

by Ivan T. Ivanov

[permalink] [raw]
Subject: Re: [PATCH v6 15/19] usb: phy: msm: Fix PTS definitions for MSM USB controller

Hi,

On Tue, 2014-04-22 at 17:09 +0400, Sergei Shtylyov wrote:
> Hello.
>
> On 22-04-2014 13:20, Ivan T. Ivanov wrote:
>
> > From: Tim Bird <[email protected]>
>
> > Fix the value used for Parallel Transceiver Select (PTS) for the MSM USB
> > controller. This is a standard chipidea PORTSC definition, where
> > a PHY_TYPE of 10b (<<30) is ULPI and 11b (<<30) is SERIAL.
> > Fix the definitions and use them correctly in the driver code.
>
> > Signed-off-by: Tim Bird <[email protected]>
> > ---
> > drivers/usb/phy/phy-msm-usb.c | 8 +++++---
> > include/linux/usb/msm_hsusb_hw.h | 5 +++--
> > 2 files changed, 8 insertions(+), 5 deletions(-)
>
> > diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
> > index dababf9..e83d13a 100644
> > --- a/drivers/usb/phy/phy-msm-usb.c
> > +++ b/drivers/usb/phy/phy-msm-usb.c
> > @@ -287,8 +287,9 @@ static int msm_link_reset(struct msm_otg *motg)
> > if (motg->phy_number)
> > writel(readl(USB_PHY_CTRL2) | BIT(16), USB_PHY_CTRL2);
> >
> > + /* put transciever in serial mode as part of reset */
>
> s/transciever/transceiver/
>
> [...]
>
> > diff --git a/include/linux/usb/msm_hsusb_hw.h b/include/linux/usb/msm_hsusb_hw.h
> > index 575c743..98d3dd8 100644
> > --- a/include/linux/usb/msm_hsusb_hw.h
> > +++ b/include/linux/usb/msm_hsusb_hw.h
> > @@ -31,8 +31,9 @@
> > #define USB_USBINTR (MSM_USB_BASE + 0x0148)
> >
> > #define PORTSC_PHCD (1 << 23) /* phy suspend mode */
> > -#define PORTSC_PTS_MASK (3 << 30)
> > -#define PORTSC_PTS_ULPI (3 << 30)
> > +#define PORTSC_PTS_MASK (3 << 30)
> > +#define PORTSC_PTS_ULPI (2 << 30)
> > +#define PORTSC_PTS_SERIAL (3 << 30)
>
> Please use tabs, not spaces here.

Thanks, will fix and resend.

Ivan

>
> WBR, Sergei
>

2014-04-23 13:36:04

by Ivan T. Ivanov

[permalink] [raw]
Subject: Re: [PATCH v6 15/19] usb: phy: msm: Fix PTS definitions for MSM USB controller

On Wed, 2014-04-23 at 16:24 +0300, Ivan T. Ivanov wrote:

> > > --- a/include/linux/usb/msm_hsusb_hw.h
> > > +++ b/include/linux/usb/msm_hsusb_hw.h
> > > @@ -31,8 +31,9 @@
> > > #define USB_USBINTR (MSM_USB_BASE + 0x0148)
> > >
> > > #define PORTSC_PHCD (1 << 23) /* phy suspend mode */
> > > -#define PORTSC_PTS_MASK (3 << 30)
> > > -#define PORTSC_PTS_ULPI (3 << 30)
> > > +#define PORTSC_PTS_MASK (3 << 30)
> > > +#define PORTSC_PTS_ULPI (2 << 30)
> > > +#define PORTSC_PTS_SERIAL (3 << 30)
> >
> > Please use tabs, not spaces here.
>
> Thanks, will fix and resend.

I answered too quickly. File contain tabs and spaces for
indentation of definitions. Should I still use tabs here?

Regards,
Ivan

>
> Ivan
>
> >
> > WBR, Sergei
> >
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

2014-04-23 13:46:07

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH v6 15/19] usb: phy: msm: Fix PTS definitions for MSM USB controller

Hello.

On 23-04-2014 17:35, Ivan T. Ivanov wrote:

>>>> --- a/include/linux/usb/msm_hsusb_hw.h
>>>> +++ b/include/linux/usb/msm_hsusb_hw.h
>>>> @@ -31,8 +31,9 @@
>>>> #define USB_USBINTR (MSM_USB_BASE + 0x0148)
>>>>
>>>> #define PORTSC_PHCD (1 << 23) /* phy suspend mode */
>>>> -#define PORTSC_PTS_MASK (3 << 30)
>>>> -#define PORTSC_PTS_ULPI (3 << 30)
>>>> +#define PORTSC_PTS_MASK (3 << 30)
>>>> +#define PORTSC_PTS_ULPI (2 << 30)
>>>> +#define PORTSC_PTS_SERIAL (3 << 30)

>>> Please use tabs, not spaces here.

>> Thanks, will fix and resend.

> I answered too quickly. File contain tabs and spaces for
> indentation of definitions.

You mean tabs and spaces on one line? Or sometimes tabs, sometimes spaces?

> Should I still use tabs here?

If they are already used, why not?

> Regards,
> Ivan

WBR, Sergei

2014-04-23 13:54:04

by Ivan T. Ivanov

[permalink] [raw]
Subject: Re: [PATCH v6 15/19] usb: phy: msm: Fix PTS definitions for MSM USB controller

On Wed, 2014-04-23 at 17:45 +0400, Sergei Shtylyov wrote:
> Hello.
>
> On 23-04-2014 17:35, Ivan T. Ivanov wrote:
>
> >>>> --- a/include/linux/usb/msm_hsusb_hw.h
> >>>> +++ b/include/linux/usb/msm_hsusb_hw.h
> >>>> @@ -31,8 +31,9 @@
> >>>> #define USB_USBINTR (MSM_USB_BASE + 0x0148)
> >>>>
> >>>> #define PORTSC_PHCD (1 << 23) /* phy suspend mode */
> >>>> -#define PORTSC_PTS_MASK (3 << 30)
> >>>> -#define PORTSC_PTS_ULPI (3 << 30)
> >>>> +#define PORTSC_PTS_MASK (3 << 30)
> >>>> +#define PORTSC_PTS_ULPI (2 << 30)
> >>>> +#define PORTSC_PTS_SERIAL (3 << 30)
>
> >>> Please use tabs, not spaces here.
>
> >> Thanks, will fix and resend.
>
> > I answered too quickly. File contain tabs and spaces for
> > indentation of definitions.
>
> You mean tabs and spaces on one line? Or sometimes tabs, sometimes spaces?

In this particular hunk, original code uses spaces.

Ivan

>
> > Should I still use tabs here?
>
> If they are already used, why not?
>
> > Regards,
> > Ivan
>
> WBR, Sergei

2014-04-23 14:09:42

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH v6 15/19] usb: phy: msm: Fix PTS definitions for MSM USB controller

On 23-04-2014 17:53, Ivan T. Ivanov wrote:

>>>>>> --- a/include/linux/usb/msm_hsusb_hw.h
>>>>>> +++ b/include/linux/usb/msm_hsusb_hw.h
>>>>>> @@ -31,8 +31,9 @@
>>>>>> #define USB_USBINTR (MSM_USB_BASE + 0x0148)
>>>>>>
>>>>>> #define PORTSC_PHCD (1 << 23) /* phy suspend mode */
>>>>>> -#define PORTSC_PTS_MASK (3 << 30)
>>>>>> -#define PORTSC_PTS_ULPI (3 << 30)
>>>>>> +#define PORTSC_PTS_MASK (3 << 30)
>>>>>> +#define PORTSC_PTS_ULPI (2 << 30)
>>>>>> +#define PORTSC_PTS_SERIAL (3 << 30)

>>>>> Please use tabs, not spaces here.

>>>> Thanks, will fix and resend.

>>> I answered too quickly. File contain tabs and spaces for
>>> indentation of definitions.

>> You mean tabs and spaces on one line? Or sometimes tabs, sometimes spaces?

> In this particular hunk, original code uses spaces.

That I saw. 8-)
I was asking about this file in general.

> Ivan

>>> Should I still use tabs here?

>> If they are already used, why not?

>>> Regards,
>>> Ivan

WBR, Sergei

2014-04-23 14:15:16

by Ivan T. Ivanov

[permalink] [raw]
Subject: Re: [PATCH v6 15/19] usb: phy: msm: Fix PTS definitions for MSM USB controller

On Wed, 2014-04-23 at 18:09 +0400, Sergei Shtylyov wrote:
> On 23-04-2014 17:53, Ivan T. Ivanov wrote:
>
> >>>>>> --- a/include/linux/usb/msm_hsusb_hw.h
> >>>>>> +++ b/include/linux/usb/msm_hsusb_hw.h
> >>>>>> @@ -31,8 +31,9 @@
> >>>>>> #define USB_USBINTR (MSM_USB_BASE + 0x0148)
> >>>>>>
> >>>>>> #define PORTSC_PHCD (1 << 23) /* phy suspend mode */
> >>>>>> -#define PORTSC_PTS_MASK (3 << 30)
> >>>>>> -#define PORTSC_PTS_ULPI (3 << 30)
> >>>>>> +#define PORTSC_PTS_MASK (3 << 30)
> >>>>>> +#define PORTSC_PTS_ULPI (2 << 30)
> >>>>>> +#define PORTSC_PTS_SERIAL (3 << 30)
>
> >>>>> Please use tabs, not spaces here.
>
> >>>> Thanks, will fix and resend.
>
> >>> I answered too quickly. File contain tabs and spaces for
> >>> indentation of definitions.
>
> >> You mean tabs and spaces on one line? Or sometimes tabs, sometimes spaces?
>
> > In this particular hunk, original code uses spaces.
>
> That I saw. 8-)
> I was asking about this file in general.

Legacy :-) Could this be future cleanup?

Regards,
Ivan

2014-04-23 14:31:37

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH v6 15/19] usb: phy: msm: Fix PTS definitions for MSM USB controller

Hello.

On 23-04-2014 18:14, Ivan T. Ivanov wrote:

>>>>>>>> --- a/include/linux/usb/msm_hsusb_hw.h
>>>>>>>> +++ b/include/linux/usb/msm_hsusb_hw.h
>>>>>>>> @@ -31,8 +31,9 @@
>>>>>>>> #define USB_USBINTR (MSM_USB_BASE + 0x0148)
>>>>>>>>
>>>>>>>> #define PORTSC_PHCD (1 << 23) /* phy suspend mode */
>>>>>>>> -#define PORTSC_PTS_MASK (3 << 30)
>>>>>>>> -#define PORTSC_PTS_ULPI (3 << 30)
>>>>>>>> +#define PORTSC_PTS_MASK (3 << 30)
>>>>>>>> +#define PORTSC_PTS_ULPI (2 << 30)
>>>>>>>> +#define PORTSC_PTS_SERIAL (3 << 30)

>>>>>>> Please use tabs, not spaces here.

>>>>>> Thanks, will fix and resend.

>>>>> I answered too quickly. File contain tabs and spaces for
>>>>> indentation of definitions.

>>>> You mean tabs and spaces on one line? Or sometimes tabs, sometimes spaces?

>>> In this particular hunk, original code uses spaces.

>> That I saw. 8-)
>> I was asking about this file in general.

> Legacy :-) Could this be future cleanup?

OK, let's forget about the tabs for now...

> Regards,
> Ivan

WBR, Sergei