mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Lechner <david@lechnology.com>
To: Alexandre Bailon <abailon@baylibre.com>,
	khilman@baylibre.com, b-liu@ti.com, balbi@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH v2 0/3] usb: musb: da8xx: Fix few issues
Date: Thu, 27 Oct 2016 13:44:52 -0500	[thread overview]
Message-ID: <245c574f-912a-9997-094e-069211dd2c2e@lechnology.com> (raw)
In-Reply-To: <2220c0c3-de72-4d3e-f438-56cb6e9cac15@lechnology.com>

On 10/27/2016 12:16 PM, David Lechner wrote:
> On 10/26/2016 05:58 AM, Alexandre Bailon wrote:
>> Currently, the USB OTG of the da8xx doesn't work.
>> This series intend to fix them.
>>
>> Change in v2:
>> * Fix the error path da8xx_musb_init()
>>
>> Alexandre Bailon (3):
>>   usb: musb: da8xx: Call earlier clk_prepare_enable()
>>   phy: da8xx-usb: Configure CFGCHIP2 to support OTG workaround
>>   usb: musb: da8xx: Only execute the OTG workaround when phy in OTG mode
>>
>>  drivers/phy/phy-da8xx-usb.c | 17 ++++++++++++-----
>>  drivers/usb/musb/da8xx.c    | 28 +++++++++++++++++++---------
>>  2 files changed, 31 insertions(+), 14 deletions(-)
>>
>
> I have found another problem with peripheral mode. When we force
> peripheral mode, the glue layer currently uses CFGCHIP2 to override the
> VBUS and ID. This causes it to not be able to detect disconnection
> because the VBUS is overridden.
>
> Here is a patch to fix the problem. I have tested this on LEGO
> MINDSTORMS EV3 (AM1808). This works because the ID pin is internally
> pulled up on the SoC, so we don't need to override it.
>
> ---
>
> diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
> index 2bc12a2..33daa3b 100644
> --- a/drivers/usb/musb/da8xx.c
> +++ b/drivers/usb/musb/da8xx.c
> @@ -374,9 +374,7 @@ static int da8xx_musb_set_mode(struct musb *musb, u8
> musb_mode)
>         case MUSB_HOST:         /* Force VBUS valid, ID = 0 */
>                 phy_mode = PHY_MODE_USB_HOST;
>                 break;
> -       case MUSB_PERIPHERAL:   /* Force VBUS valid, ID = 1 */
> -               phy_mode = PHY_MODE_USB_DEVICE;
> -               break;
> +       case MUSB_PERIPHERAL:
>         case MUSB_OTG:          /* Don't override the VBUS/ID
> comparators */
>                 phy_mode = PHY_MODE_USB_OTG;
>                 break;
>
> ---
>
> If this works for other SoCs/boards, I think we should make this change.
> If it doesn't work, we could work around the VBUS problem by polling
> VBUSSENSE in CFGCHIP2. But, I like the simple solution above better.

I have realized that due to the way my device is wired, I can actually 
use OTG mode and it will behave exactly as peripheral mode because the 
ID pin is not connected. So, maybe this patch is not needed after all.

  reply	other threads:[~2016-10-27 18:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-26 10:58 Alexandre Bailon
2016-10-26 10:58 ` [PATCH v2 1/3] usb: musb: da8xx: Call earlier clk_prepare_enable() Alexandre Bailon
2016-10-26 10:58 ` [PATCH v2 2/3] phy: da8xx-usb: Configure CFGCHIP2 to support OTG workaround Alexandre Bailon
2016-10-26 15:40   ` David Lechner
2016-10-26 16:43     ` Alexandre Bailon
2016-10-26 10:58 ` [PATCH v2 3/3] usb: musb: da8xx: Only execute the OTG workaround when phy in OTG mode Alexandre Bailon
2016-10-28  2:56   ` David Lechner
2016-10-28 12:39     ` Alexandre Bailon
2016-10-28 17:11       ` David Lechner
2016-10-29  3:11         ` Bin Liu
2016-10-27 17:16 ` [PATCH v2 0/3] usb: musb: da8xx: Fix few issues David Lechner
2016-10-27 18:44   ` David Lechner [this message]
2016-10-28  9:31     ` Alexandre Bailon
2016-10-28 10:16       ` Alexandre Bailon
2016-10-28 17:50       ` David Lechner

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=245c574f-912a-9997-094e-069211dd2c2e@lechnology.com \
    --to=david@lechnology.com \
    --cc=abailon@baylibre.com \
    --cc=b-liu@ti.com \
    --cc=balbi@kernel.org \
    --cc=khilman@baylibre.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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

Powered by JetHome