From: Felipe Balbi <balbi@ti.com>
To: Vivek Gautam <gautamvivek1987@gmail.com>
Cc: balbi@ti.com, Vivek Gautam <gautam.vivek@samsung.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-omap@vger.kernel.org, gregkh@linuxfoundation.org,
kishon@ti.com
Subject: Re: [PATCH RFC] usb: dwc3: Set GCTL.PrtCapDir based on selected mode.
Date: Mon, 25 Feb 2013 11:19:35 +0200 [thread overview]
Message-ID: <20130225091935.GF25749@arwen.pp.htv.fi> (raw)
In-Reply-To: <CAFp+6iHaP96F0OF9_C1DTsfmkPNZMVC78tj7m0YGdV=d_znWrA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1803 bytes --]
Hi,
On Mon, Feb 25, 2013 at 02:21:46PM +0530, Vivek Gautam wrote:
> >> @@ -514,6 +511,14 @@ static int dwc3_probe(struct platform_device *pdev)
> >> }
> >> dwc->mode = mode;
> >>
> >> +#if IS_ENABLED(CONFIG_USB_DWC3_HOST)
> >> + dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_HOST);
> >> +#elif IS_ENABLED(CONFIG_USB_DWC3_GADGET)
> >> + dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_DEVICE);
> >> +#else
> >> + dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_OTG);
> >> +#endif
> >
> > you can actually use:
> >
> > if (IS_ENABLED(CONFIG_USB_DWC3_HOST))
> > dwc3_set_mode(dwc...
> > else if (IS_ENABLED( ...
> > ...
> > else
> > ...
> >
>
> I am actually hoping to change this to something like below (after
> of course changing the preprocessor conditionals) :
>
> commit 9a62ed948dcb6ac5d78aff41f5355c0a5ea86475
> Author: Vivek Gautam <gautam.vivek@samsung.com>
> Date: Thu Jan 24 11:58:05 2013 +0530
>
> usb: dwc3: Set GCTL.PrtCapDir based on selected mode.
>
> Now that machines may select the mode of working of DWC3,
> we can set the Port capability direction based on selected mode.
>
> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
>
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 79f335f..9444fbe 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -478,7 +478,13 @@ static int dwc3_probe(struct platform_device *pdev)
> goto err1;
> }
>
> - mode = DWC3_MODE(dwc->hwparams.hwparams0);
> +#if IS_ENABLED(CONFIG_USB_DWC3_HOST)
> + mode = DWC3_MODE_HOST;
> +#elif IS_ENABLED(CONFIG_USB_DWC3_GADGET)
> + mode = DWC3_MODE_DEVICE;
> +#else
> + mode = DWC3_MODE_DRD;
looks alright.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-02-25 9:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-05 13:45 [PATCH RFC] usb: dwc3: Set GCTL.PrtCapDir based on selected mode Vivek Gautam
2013-02-25 8:17 ` Felipe Balbi
2013-02-25 8:51 ` Vivek Gautam
2013-02-25 9:19 ` Felipe Balbi [this message]
2013-02-25 9:29 ` Vivek Gautam
[not found] ` <CAFp+6iGGAY=nMg03-bqHz=XuNP+1t9mQR=M53HGoqCXv=t+f0Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-03-02 13:25 ` [PATCH] usb: dwc3: Set DWC3 context's mode " Vivek Gautam
2013-03-13 9:12 ` Vivek Gautam
2013-03-13 9:14 ` Felipe Balbi
2013-03-13 9:15 ` Vivek Gautam
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=20130225091935.GF25749@arwen.pp.htv.fi \
--to=balbi@ti.com \
--cc=gautam.vivek@samsung.com \
--cc=gautamvivek1987@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kishon@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@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