Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1341044 > unrolled thread

[PATCH RESEND 0/2] usb: dwc2: Remove host and gadget only code from core

Started byJohn Youn <johnyoun@synopsys.com>
First post2016-02-23 22:40 +0100
Last post2016-02-24 01:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH RESEND 0/2] usb: dwc2: Remove host and gadget only code from core John Youn <johnyoun@synopsys.com> - 2016-02-23 22:40 +0100
    Re: [PATCH RESEND 2/2] usb: dwc2: Move host-specific core functions  into hcd.c Doug Anderson <dianders@chromium.org> - 2016-02-24 01:30 +0100

#1341044 — [PATCH RESEND 0/2] usb: dwc2: Remove host and gadget only code from core

FromJohn Youn <johnyoun@synopsys.com>
Date2016-02-23 22:40 +0100
Subject[PATCH RESEND 0/2] usb: dwc2: Remove host and gadget only code from core
Message-ID<r5sQy-2Oz-11@gated-at.bofh.it>
This series moves the host/gadget-specific code from core.c to hcd.c
and gadget.c so that they will be compiled only when their respective
configurations are selected, or in DRD.

This is mostly just a straight move of the code. I have also added
some comments to group related functions together.

Compiled and tested in all three modes.

This should also solve the issue reported here:
http://marc.info/?l=linux-usb&m=145591813410106&w=2

Although I wasn't able to test it... couldn't figure out how to
disable CONFIG_USB and enable DWC2 in gadget mode.

Felipe,

This should be applied after Doug's series on your testing/next
branch.

Regards,
John

John Youn (2):
  usb: dwc2: Move register save and restore functions
  usb: dwc2: Move host-specific core functions into hcd.c

 drivers/usb/dwc2/core.c   | 1959 ---------------------------------------------
 drivers/usb/dwc2/core.h   |   35 +-
 drivers/usb/dwc2/gadget.c |  102 +++
 drivers/usb/dwc2/hcd.c    | 1948 ++++++++++++++++++++++++++++++++++++++++++--
 drivers/usb/dwc2/hcd.h    |   10 +
 5 files changed, 2024 insertions(+), 2030 deletions(-)

-- 
2.6.3

[toc] | [next] | [standalone]


#1341205 — Re: [PATCH RESEND 2/2] usb: dwc2: Move host-specific core functions into hcd.c

FromDoug Anderson <dianders@chromium.org>
Date2016-02-24 01:30 +0100
SubjectRe: [PATCH RESEND 2/2] usb: dwc2: Move host-specific core functions into hcd.c
Message-ID<r5vv4-4S2-9@gated-at.bofh.it>
In reply to#1341044
John,

On Tue, Feb 23, 2016 at 1:33 PM, John Youn <johnyoun@synopsys.com> wrote:

> +u32 dwc2_calc_frame_interval(struct dwc2_hsotg *hsotg)

You seem to have lost the function comments for
dwc2_calc_frame_interval().  Was that intentional?  If not, can you
add them back?


> +/**
> + * dwc2_hc_do_ping() - Starts a PING transfer
> + *
> + * @hsotg: Programming view of DWC_otg controller
> + * @chan:  Information needed to initialize the host channel
> + *
> + * This function should only be called in Slave mode. The Do Ping bit is set in
> + * the HCTSIZ register, then the channel is enabled.
> + */
> +void dwc2_hc_do_ping(struct dwc2_hsotg *hsotg, struct dwc2_host_chan *chan)

Presumably can be static?  ...and remove prototype from "core.h"?


> +/**
> + * dwc2_core_init() - Initializes the DWC_otg controller registers and
> + * prepares the core for device mode or host mode operation
> + *
> + * @hsotg:         Programming view of the DWC_otg controller
> + * @initial_setup: If true then this is the first init for this instance.
> + */
> +int dwc2_core_init(struct dwc2_hsotg *hsotg, bool initial_setup)

Presumably can be static?  ...and remove prototype from "core.h"?


> +/**
> + * dwc2_core_host_init() - Initializes the DWC_otg controller registers for
> + * Host mode
> + *
> + * @hsotg: Programming view of DWC_otg controller
> + *
> + * This function flushes the Tx and Rx FIFOs and flushes any entries in the
> + * request queues. Host channels are reset to ensure that they are ready for
> + * performing transfers.
> + */
> +void dwc2_core_host_init(struct dwc2_hsotg *hsotg)

Presumably can be static?  ...and remove prototype from "core.h"?


Other than those nits, things look good.  I didn't analyze exactly
where you placed all the functions but a quick glance shows that they
seem sanely organized.  :)

I picked these back to my chromeos-3.14 kernel (with many many dwc2
backports) and I confirmed that I can still compile the kernel, boot
it, and use USB.  I also confirmed no warnings were introduced for me.
I'm only testing HOST, not gadget mode.

Feel free to add my Reviewed-by and Tested-by once nits are fixed up.

-Doug

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web