From: Dinh Nguyen <dinguyen@opensource.altera.com>
To: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: <paulz@synopsys.com>, <gregkh@linuxfoundation.org>,
<balbi@ti.com>, <dinh.linux@gmail.com>, <swarren@wwwdotorg.org>,
<matthijs@stdin.nl>, <r.baldyga@samsung.com>,
<jg1.han@samsung.com>, <sachin.kamat@linaro.org>,
<ben-linux@fluff.org>, <dianders@chromium.org>,
<kever.yang@rock-chips.com>, <linux-usb@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCHv4 04/12] usb: dwc2: Add the appropriate init calls in platform code
Date: Thu, 18 Sep 2014 14:24:37 -0500 [thread overview]
Message-ID: <541B3175.6060802@opensource.altera.com> (raw)
In-Reply-To: <1609564.lrfde17RTW@amdc1032>
On 09/12/2014 11:18 AM, Bartlomiej Zolnierkiewicz wrote:
>
> [ added linux-kernel ML to cc: ]
>
> Hi,
>
> On Tuesday, August 26, 2014 11:19:55 AM dinguyen@opensource.altera.com wrote:
>> From: Dinh Nguyen <dinguyen@opensource.altera.com>
>>
>> Add the proper init calls for either host, gadget or both in platform.c
>>
>> Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
>> Acked-by: Paul Zimmerman <paulz@synopsys.com>
>> ---
>> drivers/usb/dwc2/core.h | 13 +++++++++++++
>> drivers/usb/dwc2/gadget.c | 2 +-
>> drivers/usb/dwc2/platform.c | 28 ++++++++++++++++++++++++----
>
> Where are correspoding changes to pci.c?
>
> I cannot find them in your patchset.
The current PCI driver only supports HCD. If you want PCI to support
gadget, then it can be done in a separate patchset.
>
>> 3 files changed, 38 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
>> index f55e62d..3a49a00 100644
>> --- a/drivers/usb/dwc2/core.h
>> +++ b/drivers/usb/dwc2/core.h
>> @@ -960,6 +960,19 @@ extern void dwc2_dump_global_registers(struct dwc2_hsotg *hsotg);
>> */
>> extern u16 dwc2_get_otg_version(struct dwc2_hsotg *hsotg);
>>
>> +/* Gadget defines */
>> +#if defined(CONFIG_USB_DWC2_PERIPHERAL) || defined(CONFIG_USB_DWC2_DUAL_ROLE)
>> +extern int s3c_hsotg_remove(struct dwc2_hsotg *hsotg);
>> +extern void s3c_hsotg_core_init(struct dwc2_hsotg *dwc2);
>> +extern int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq);
>> +#else
>> +static inline void s3c_hsotg_core_init(struct dwc2_hsotg *dwc2) {}
>> +static inline int s3c_hsotg_remove(struct dwc2_hsotg *dwc2)
>> +{ return 0; }
>> +static inline int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq)
>> +{ return 0; }
>> +#endif
>> +
>> #if defined(CONFIG_USB_DWC2_HOST) || defined(CONFIG_USB_DWC2_DUAL_ROLE)
>> /**
>> * dwc2_hcd_get_frame_number() - Returns current frame number
>> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
>> index 96f868f..efa68a0 100644
>> --- a/drivers/usb/dwc2/gadget.c
>> +++ b/drivers/usb/dwc2/gadget.c
>> @@ -3572,7 +3572,7 @@ err_clk:
>> * s3c_hsotg_remove - remove function for hsotg driver
>> * @pdev: The platform information for the driver
>> */
>> -static int s3c_hsotg_remove(struct dwc2_hsotg *hsotg)
>> +int s3c_hsotg_remove(struct dwc2_hsotg *hsotg)
>> {
>> usb_del_gadget_udc(&hsotg->gadget);
>>
>> diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
>> index dd2f8f5..2871f351 100644
>> --- a/drivers/usb/dwc2/platform.c
>> +++ b/drivers/usb/dwc2/platform.c
>> @@ -92,7 +92,14 @@ static int dwc2_driver_remove(struct platform_device *dev)
>> {
>> struct dwc2_hsotg *hsotg = platform_get_drvdata(dev);
>>
>> - dwc2_hcd_remove(hsotg);
>> + if (IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL))
>> + s3c_hsotg_remove(hsotg);
>> + else if (IS_ENABLED(CONFIG_USB_DWC2_HOST))
>> + dwc2_hcd_remove(hsotg);
>> + else { /* dual role */
>> + dwc2_hcd_remove(hsotg);
>> + s3c_hsotg_remove(hsotg);
>
> Why not simply always call:
>
> dwc2_hcd_remove(hsotg);
> s3c_hsotg_remove(hsotg);
>
> and add appropriate stub for dwc2_hcd_remove() for
> CONFIG_USB_DWC2_PERIPHERAL=y?
Yes...I'll do this for v5. Same for the init().
Dinh
next prev parent reply other threads:[~2014-09-18 19:43 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
[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 [this message]
[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=541B3175.6060802@opensource.altera.com \
--to=dinguyen@opensource.altera.com \
--cc=b.zolnierkie@samsung.com \
--cc=balbi@ti.com \
--cc=ben-linux@fluff.org \
--cc=dianders@chromium.org \
--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=paulz@synopsys.com \
--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 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.