public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Paul Zimmerman <Paul.Zimmerman@synopsys.com>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"balbi@ti.com" <balbi@ti.com>,
	"dinh.linux@gmail.com" <dinh.linux@gmail.com>,
	"swarren@wwwdotorg.org" <swarren@wwwdotorg.org>,
	"matthijs@stdin.nl" <matthijs@stdin.nl>,
	"r.baldyga@samsung.com" <r.baldyga@samsung.com>,
	"jg1.han@samsung.com" <jg1.han@samsung.com>,
	"sachin.kamat@linaro.org" <sachin.kamat@linaro.org>,
	"ben-linux@fluff.org" <ben-linux@fluff.org>,
	"dianders@chromium.org" <dianders@chromium.org>,
	"kever.yang@rock-chips.com" <kever.yang@rock-chips.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCHv4 01/12] usb: dwc2: Update Kconfig to support dual-role
Date: Mon, 22 Sep 2014 18:10:04 +0200	[thread overview]
Message-ID: <33607368.413ZH3sNbT@amdc1032> (raw)
In-Reply-To: <A2CA0424C0A6F04399FB9E1CD98E0304844D9C0D@US01WEMBX2.internal.synopsys.com>


Hi,

On Friday, September 19, 2014 07:02:49 PM Paul Zimmerman wrote:
> > From: Bartlomiej Zolnierkiewicz [mailto:b.zolnierkie@samsung.com]
> > Sent: Friday, September 19, 2014 7:50 AM
> > 
> > Unfortunately after second look there are even more problems with Kconfig
> > changes, please see below.
> > 
> > > >
> > > >>  if USB_DWC2
> > > >>
> > > >> +choice
> > > >> +	bool "DWC2 Mode Selection"
> > > >> +	default USB_DWC2_DUAL_ROLE if (USB && USB_GADGET)
> > > >> +	default USB_DWC2_HOST if (USB && !USB_GADGET)
> > > >> +	default USB_DWC2_PERIPHERAL if (!USB && USB_GADGET)
> > 
> > Previously it was possible to have following functionalities in
> > one kernel (for multiplatform kernels):
> > 
> > - host PCI support
> > - host platform support
> > - gadget platform support
> > 
> > Now mode selection will determine the used mode for combined
> > host+gadget platform driver.  It is no longer possible to have
> > host platform and gadget platform support in one kernel.
> 
> Why not? Why wouldn't it work if you enable USB_DWC2_DUAL_ROLE? The
> dwc3 driver uses the same scheme as this, and I have not heard any
> complaints about that not working.

Ok, it seems that this should work fine if:

- USB_DWC2_DUAL_ROLE is set

- dwc2 handles dr_mode properly

[ BTW dwc3 has the following code in its ->probe which dwc2 lacks
  (the code sets the default dr_mode value):

	if (IS_ENABLED(CONFIG_USB_DWC3_HOST))
		dwc->dr_mode = USB_DR_MODE_HOST;
	else if (IS_ENABLED(CONFIG_USB_DWC3_GADGET))
		dwc->dr_mode = USB_DR_MODE_PERIPHERAL;

	if (dwc->dr_mode == USB_DR_MODE_UNKNOWN)
		dwc->dr_mode = USB_DR_MODE_OTG;

  It seems that correspoding changes are needed for dwc2. ]

- proper dr_mode is set in the DT dwc2 entry if the board needs it

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics


  reply	other threads:[~2014-09-22 16:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1409070003-21195-1-git-send-email-dinguyen@opensource.altera.com>
     [not found] ` <1409070003-21195-2-git-send-email-dinguyen@opensource.altera.com>
2014-09-12 15:49   ` [PATCHv4 01/12] usb: dwc2: Update Kconfig to support dual-role Bartlomiej Zolnierkiewicz
2014-09-18 15:54     ` Dinh Nguyen
2014-09-18 19:59       ` Paul Zimmerman
2014-09-19 14:49       ` Bartlomiej Zolnierkiewicz
2014-09-19 19:02         ` Paul Zimmerman
2014-09-22 16:10           ` Bartlomiej Zolnierkiewicz [this message]
     [not found] ` <1409070003-21195-3-git-send-email-dinguyen@opensource.altera.com>
2014-09-12 15:56   ` [PATCHv4 02/12] usb: dwc2: move "samsung,s3c6400-hsotg" into common platform Bartlomiej Zolnierkiewicz
     [not found] ` <1409070003-21195-4-git-send-email-dinguyen@opensource.altera.com>
2014-09-12 16:08   ` [PATCHv4 03/12] usb: dwc2: Update the gadget driver to use common dwc2_hsotg structure Bartlomiej Zolnierkiewicz
     [not found] ` <1409070003-21195-5-git-send-email-dinguyen@opensource.altera.com>
2014-09-12 16:18   ` [PATCHv4 04/12] usb: dwc2: Add the appropriate init calls in platform code Bartlomiej Zolnierkiewicz
2014-09-18 19:24     ` Dinh Nguyen
     [not found] ` <1409070003-21195-9-git-send-email-dinguyen@opensource.altera.com>
2014-09-12 16:28   ` [PATCHv4 08/12] usb: dwc2: gadget: Do not fail probe if there isn't a clock node Bartlomiej Zolnierkiewicz
2014-09-19 14:29     ` Dinh Nguyen
     [not found] ` <1409070003-21195-10-git-send-email-dinguyen@opensource.altera.com>
2014-09-12 16:34   ` [PATCHv4 09/12] usb: dwc2: initialize the spin_lock for both host and gadget Bartlomiej Zolnierkiewicz
     [not found] ` <1409070003-21195-11-git-send-email-dinguyen@opensource.altera.com>
2014-09-12 16:36   ` [PATCHv4 10/12] usb: dwc2: Add suspend/resume for gadget Bartlomiej Zolnierkiewicz
     [not found] ` <1409070003-21195-12-git-send-email-dinguyen@opensource.altera.com>
2014-09-12 16:38   ` [PATCHv4 11/12] usb: dwc2: check that the host work queue is valid Bartlomiej Zolnierkiewicz
2014-09-12 16:44 ` [PATCHv4 00/12] usb: dwc2: Add support for dual role Bartlomiej Zolnierkiewicz
2014-09-12 18:29   ` Dinh 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=33607368.413ZH3sNbT@amdc1032 \
    --to=b.zolnierkie@samsung.com \
    --cc=Paul.Zimmerman@synopsys.com \
    --cc=balbi@ti.com \
    --cc=ben-linux@fluff.org \
    --cc=dianders@chromium.org \
    --cc=dinguyen@opensource.altera.com \
    --cc=dinh.linux@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jg1.han@samsung.com \
    --cc=kever.yang@rock-chips.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=matthijs@stdin.nl \
    --cc=r.baldyga@samsung.com \
    --cc=sachin.kamat@linaro.org \
    --cc=swarren@wwwdotorg.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