All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Felipe Balbi <balbi@kernel.org>, USB <linux-usb@vger.kernel.org>,
	John Youn <John.Youn@synopsys.com>
Subject: usb: dwc3: Set default mode for dwc_usb31
Date: Thu, 26 Jul 2018 23:02:43 +0000	[thread overview]
Message-ID: <30102591E157244384E984126FC3CB4F544A276B@us01wembx1.internal.synopsys.com> (raw)

On 7/26/2018 2:59 PM, Thinh Nguyen wrote:
> On 7/26/2018 2:32 PM, Andy Shevchenko wrote:
>> On Thu, Jul 26, 2018 at 11:52 PM, Thinh Nguyen
>> <Thinh.Nguyen@synopsys.com> wrote:
>>> dwc_usb31 does not support OTG mode. If the controller supports DRD but
>>> the dr_mode is not specified or set to OTG, then set the mode to
>>> peripheral.
>>>
>>> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
>>> ---
>>>  drivers/usb/dwc3/core.c | 8 ++++++++
>>>  1 file changed, 8 insertions(+)
>>>
>>> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
>>> index 21e4931d0cc0..64ba664d467c 100644
>>> --- a/drivers/usb/dwc3/core.c
>>> +++ b/drivers/usb/dwc3/core.c
>>> @@ -78,6 +78,14 @@ static int dwc3_get_dr_mode(struct dwc3 *dwc)
>>>                         mode = USB_DR_MODE_HOST;
>>>                 else if (IS_ENABLED(CONFIG_USB_DWC3_GADGET))
>>>                         mode = USB_DR_MODE_PERIPHERAL;
>>> +
>>> +               /*
>>> +                * dwc_usb31 does not support OTG mode. If the controller
>>> +                * supports DRD but the dr_mode is not specified or set to OTG,
>>> +                * then set the mode to peripheral.
>>> +                */
>>> +               if (mode == USB_DR_MODE_OTG && dwc3_is_usb31(dwc))
>> shouldn't be simple
>>
>> else if (dwc3_is_usb31(...))
>>
>> ?

Actually, no. We want to set the mode to peripheral _only_ when dr_mode
was not specified or set to OTG. Just checking for dwc3_is_usb31(...) is
not enough.

Thanks,

Thinh
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2018-07-26 23:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-26 23:02 Thinh Nguyen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-07-27 10:22 usb: dwc3: Set default mode for dwc_usb31 Andy Shevchenko
2018-07-27 10:14 Felipe Balbi
2018-07-27 10:08 Andy Shevchenko
2018-07-26 21:59 Thinh Nguyen
2018-07-26 21:32 Andy Shevchenko
2018-07-26 20:52 Thinh Nguyen

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=30102591E157244384E984126FC3CB4F544A276B@us01wembx1.internal.synopsys.com \
    --to=thinh.nguyen@synopsys.com \
    --cc=John.Youn@synopsys.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=balbi@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 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.