Commit Graph

418 Commits

Author SHA1 Message Date
Ido Shayevitz
9fb83457bf usb: gadget: dwc3: Add support for DBM (MSM specific) endpoints.
In MSM architecture, the DBM, Device Bus Manager, is a HW module within
the USB3.0 core wrapper, implementing BAM interface support for USB3.0 IP.
The DBM HW unit requires for its operation a special transfer to be
started, with special TRBs structure. These usb requests will operate in
BAM2BAM mode.

This change adds to the dwc3-msm.c driver a support for queuing
a special transfers to endpoints which serve the DBM.

A function driver can now call to msm_ep_config(*ep) with some
endpoint which will serve the DBM. After this, the function
driver can queue a request to this endpoint as usual ep->queue(*ep,*req).
The function driver may need to add a few more parameters in req->udc_priv
field according to the bit mask fields defined in msm_hsudb.h file.

Change-Id: Iad530dabc68414c61d44e9eaef4402f868b2b12f
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-04-17 13:42:44 +03:00
Ido Shayevitz
d1cb16ccbf usb: gadget: Move udc_priv bit fields to MSM central header file.
The req->udc_priv value is used to transfer parameters from a function
driver to a udc, for enabling sps/bam mode for MSM architecture.

This change moves the definitions of the bit fields inside the udc_priv to
msm_hsusb.h in order to avoid duplicate definitions in u_bam.c and
ci13xxx_udc.h. Also this will allow other function drivers and other udcs
to use this definitions, for example, debug class over dwc3 udc.

Change-Id: I37a011524f7ba6d06029d1f3ab3f58d4cb248e4d
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-04-17 13:42:43 +03:00
Vijayavardhan Vennapusa
afbbb8f569 USB: EHCI: Add I2C support for SMSC hsic hub
Currently default configuration will be active
during SMSC hub enumeration. For changing the default
configuration, requires I2C support for configuring
the configurable parameters of SMSC hub like VID,PID.

Change-Id: Ie0449b166ddaae990b9a69c3a75f8059250faf0e
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
2012-04-16 12:56:32 -06:00
Hemant Kumar
e6275973cf msm: 8064: hsic: Add msm_bus vote for hsic controller driver
Drivers need to specify their bandwidth requirements to
bus-scaling driver to get guaranteed bandwidth on fabrics.

HSIC USB performance depends upon system fabric frequency
as HSIC USB controller has to support high bi-directional
data transfers. Hence, request for high bus bandwidth as
long as HSIC is active.

Also add debugfs entry to enable/disable the bus voting:-
echo enable > /sys/kernel/debug/ehci_hsic_msm_dbg/bus_voting
echo disable > /sys/kernel/debug/ehci_hsic_msm_dbg/bus_voting

CRs-Fixed: 342032
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Change-Id: I7e208d67ef1c0168cd7621aeae4e8b123adef255
2012-04-12 09:34:53 -07:00
Anna Perel
a8c991d548 usb: gadget: MBIM function driver for QCOM chipsets
This driver implements Mobile Broadband Interface Model protocol.
Control messages are transferred through QBI module
running in user space and communicating with mbim
using file operations interface android_mbim.
Data is transferred on SPS, Bam-to-Bam.

Change-Id: Ifc4b3f7e21b1a0dac377af272f9ae922ec9c7e2e
Signed-off-by: Anna Perel <aperel@codeaurora.org>
2012-04-10 15:59:06 +03:00
Stephen Boyd
30ad10bf5b Revert "usb: msm_otg: Migrate to clock apis for XO voting"
This reverts commit 7dd2266ae3.

It was a mistake to move the usb driver to the clock apis for XO
buffer voting. Due to an RPM design CXO and D0 are the same but
we would like to hide that from the users of the buffers.
Therefore the msm_xo driver itself remaps the D0 buffer request
to the cxo clock until the RPM is fixed.

Change-Id: I230de55d30a49fa5bcf0d07f40453f1e09c4a9b1
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2012-03-31 12:42:29 -07:00
Rohit Vaswani
a76e99abc5 Merge branch 'Linux 3.0.21' into msm-3.0
Merge Upstream's stable 3.0.21 branch into msm-3.0
This consists 814 commits and some merge conflicts.

The merge conflicts are because of some local changes to
msm-3.0 as well as some conflicts between google's tree and
the upstream tree.

Conflicts:
	arch/arm/kernel/head.S
	drivers/bluetooth/ath3k.c
	drivers/bluetooth/btusb.c
	drivers/mmc/core/core.c
	drivers/tty/serial/serial_core.c
	drivers/usb/host/ehci-hub.c
	drivers/usb/serial/qcserial.c
	fs/namespace.c
	fs/proc/base.c

Change-Id: I62e2edbe213f84915e27f8cd6e4f6ce23db22a21
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
2012-03-30 00:09:34 -07:00
Vijayavardhan Vennapusa
a3152031da USB: OTG: msm: Add support for SRP and HNP
This patch changes OTG driver to support different
OTG statemachine states for OTG2.0 complaince. It will
also enable to swap Host role between two OTG devices
via HNP and enable B device to request A device to start
VBUS session via SRP.

Change-Id: Ibe2519ff1570768f51e879af483a6f5c23b38d8f
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2012-03-13 11:39:37 +05:30
David Brown
e7365af997 Merge remote-tracking branch 'idos/usb3-msm-3.0-backport-dwc3' into merge/idos
Merge a backport of the following 82 commits from the 3.2 kernel.

commit 10f1551c50
Author: Yu Xu <yuxu@marvell.com>
Date:   Sat Dec 10 00:03:33 2011 +0800

    usb: gadget: storage: release superspeed descriptors.

    Release superspeed mass storage descriptors memory
    when the function is unbind.

    Signed-off-by: Yu Xu <yuxu@marvell.com>
    Acked-by: Michal Nazarewicz <mina86@mina86.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/f_mass_storage.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

commit 1d6d304680
Author: Felipe Balbi <balbi@ti.com>
Date:   Mon Oct 3 16:39:30 2011 +0300

    usb: gadget: core: fix bug when removing gadget drivers

    usb_gadget_disconnect() is responsible of removing
    data pullups. Before doing that we must, first, tell
    gadget driver we're disconnecting (by calling disconnect
    method on gadget driver structure), unbind the gadget
    driver and stop the controller.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/udc-core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

commit 145cbade27
Author: Felipe Balbi <balbi@ti.com>
Date:   Wed Aug 3 13:33:27 2011 +0200

    usb: gadget: storage: add superspeed support

    this patch adds superspeed descriptors for the
    storage gadgets.

    Acked-by: Michal Nazarewicz <mina86@mina86.com>
    Acked-by: Alan Stern <stern@rowland.harvard.edu>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    [idos@codeaurora.org: Conflicts: drivers/usb/gadget/storage_common.c]
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/f_mass_storage.c |   22 ++++++
 drivers/usb/gadget/file_storage.c   |   59 +++++++++++++---
 drivers/usb/gadget/mass_storage.c   |    2 +-
 drivers/usb/gadget/storage_common.c |  127 +++++++++++++++++++++++++++++++++++
 4 files changed, 199 insertions(+), 11 deletions(-)

commit b0c3e7fb4d
Author: Felipe Balbi <balbi@ti.com>
Date:   Mon Oct 10 09:43:44 2011 +0300

    usb: gadget: fix typo for default U1/U2 exit latencies

    s/DEFULT/DEFAULT/, no functional changes.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/composite.c |    4 ++--
 include/linux/usb/gadget.h     |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

commit 834e066cff
Author: Paul Zimmerman <Paul.Zimmerman@synopsys.com>
Date:   Fri Sep 30 15:26:06 2011 -0700

    usb: gadget: storage: fix mass storage gadgets to work with Synopsys UDC

    The Synopsys USB device controller requires all OUT transfer request
    lengths to be aligned to max packet size. The mass storage gadgets do
    not meet this requirement for Super Speed. The gadgets already have a
    function which performs this alignment for CBW packets, so use it for
    data packets too.

    The alternative would be to implement bounce buffers in the DWC3
    driver, but that could have a significant impact on performance.

    This version is based upon a more-correct patch written by Alan
    Stern.

    Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/f_mass_storage.c |   18 +++++++++---------
 drivers/usb/gadget/file_storage.c   |   18 +++++++++---------
 2 files changed, 18 insertions(+), 18 deletions(-)

commit 7295baf179
Author: Alan Stern <stern@rowland.harvard.edu>
Date:   Thu Aug 18 20:29:00 2011 +0200

    USB: gadget: storage: remove alignment assumption

    This patch (as1481) fixes a problem affecting g_file_storage and
    g_mass_storage when running at SuperSpeed.  The two drivers currently
    assume that the bulk-out maxpacket size can evenly divide the SCSI
    block size, which is 512 bytes.  But SuperSpeed bulk endpoints have a
    maxpacket size of 1024, so the assumption is no longer true.

    This patch removes that assumption from the drivers, by getting rid of
    a small optimization (they try to align VFS reads and writes on page
    cache boundaries).  If a command's starting logical block address is
    512 bytes below the end of a page, it's not okay to issue a USB
    command for just those 512 bytes when the maxpacket size is 1024 -- it
    would result in either babble (for an OUT transfer) or a short packet
    (for an IN transfer).

    Also, for backward compatibility, the test for writes extending beyond
    the end of the backing storage has to be changed.  If the host tries
    to do this, we should accept the data that fits in the backing storage
    and ignore the rest.  Because the storage's end may not align with a
    USB packet boundary, this means we may have to accept a USB OUT
    transfer that extends beyond the end of the storage and then write out
    only the part of the data that fits.

    Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
    Acked-by: Michal Nazarewicz <mina86@mina86.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    [idos@codeaurora.org: Conflicts: drivers/usb/gadget/f_mass_storage.c
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/f_mass_storage.c |   64 ++++++++++++---------------------
 drivers/usb/gadget/file_storage.c   |   67 ++++++++++++++---------------------
 2 files changed, 50 insertions(+), 81 deletions(-)

commit 9e5eb17594
Author: Peiyu Li <peiyu.li@csr.com>
Date:   Wed Aug 17 22:52:59 2011 -0700

    usb: gadget: storage: adapt logic block size to bound block devices

    Now the mass storage driver has fixed logic block size of 512 bytes.

    The mass storage gadget read/write bound devices only through VFS, so the
    bottom level devices actually are just RAW devices to the driver and connected
    PC. As a RAW, hosts can always format, read and write it right in 512 bytes
    logic block and don't care about the actual logic block size of devices bound
    to the gadget.

    But if we want to share the bound block device partition between target board
    and PC, in case the logic block size of the bound block device is 4KB, we
    execute the following steps:

    1. connect a board with mass storage gadget to PC(the board has set one
    	partition of on-board block device as file name of the mass storage)
    2. PC format the mass storage to VFAT by default logic block size and
    	read/write it
    3. disconnect boards from PC
    4. target board mount the partition as VFAT

    Step 4 will fail since kernel on target thinks the logic block size of the
    bound partition as 4KB.
    A typical error is "FAT: logical sector size too small for device (logical
    sector size = 512)"

    If we execute opposite steps:
    1. format the partition to VFAT on target board and read/write this partition
    2. connect the board to Windows PC as usb mass storage gadget, windows will
    	think the disk is not formatted

    So the conclusion is that only as a gadget, the mass storage driver has no any
    problem.  But being shared VFAT or other filesystem on PC and target board, it
    will fail.

    This patch adapts logic block size to bound block devices and fix the issue.

    Cc: Michal Nazarewicz <mina86@mina86.com>
    Acked-by: Alan Stern <stern@rowland.harvard.edu>
    Signed-off-by: Peiyu Li <peiyu.li@csr.com>
    Signed-off-by: Xianglong Du <xianglong.du@csr.com>
    Signed-off-by: Huayi Li <huayi.li@csr.com>
    Signed-off-by: Barry Song <Baohua.Song@csr.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/f_mass_storage.c |   63 ++++++++++++++++++++--------------
 drivers/usb/gadget/file_storage.c   |   50 +++++++++++++--------------
 drivers/usb/gadget/storage_common.c |   23 ++++++++++---
 3 files changed, 79 insertions(+), 57 deletions(-)

commit 26bba694a4
Author: Felipe Balbi <balbi@ti.com>
Date:   Mon Dec 19 13:45:01 2011 +0200

    usb: gadget: epautoconf: do not change number of streams

    We should not change gadget driver's descriptors just
    because we think it's right to do so.

    There are several of reasons which would support this
    statement but it suffices to say that this was probably
    never tested because it updates bmAttributes without
    asking the driver if it's ok to do so.

    This means that e.g. on UASP gadget it would enable
    stream support even for the command endpoint which must
    not have stream support enabled.

    In fact, this change is fixing the bug introduced by
    commit a59d6b9 (usb: gadget: add streams support to
    the gadget framework) which was caught when testing
    UASP gadget with dwc3 driver.

    Cc: Tatyana Brokhman <tlinder@codeaurora.org>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/epautoconf.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

commit fb5591ebf5
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Thu Jun 23 14:26:15 2011 +0200

    usb: gadget: udc-core: add "new-style" registration interface

    udc_start() should only trigger the internal state machine and make
    minimal house keeping. Before that call udc-core calls the bind()
    callback and after the callback the pullup().

    udc_stop() is simillar, udc-core calls pullup(), unbind() and finally
    udc_stop().

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/udc-core.c |   75 ++++++++++++++++++++++++++++++++++++++--
 include/linux/usb/gadget.h    |    6 +++
 2 files changed, 77 insertions(+), 4 deletions(-)

commit 0d0c240fac
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Thu Jun 23 14:26:11 2011 +0200

    usb: gadget: defer setting maxpacket till ->setup()

    maxpacket is set by the udc driver for ep0 very early. This value is
    copied by the function gadget used later for the USB_DT_DEVICE and
    USB_DT_DEVICE_QUALIFIER query. This seems to work fine so far. For USB3
    we need set a different value here. In SS speed it is 2^x with x=9 and
    in HS we set something <= 64. If the UDC starts in SS and continues in
    HS after the cable has been plugged it will report a too small value.
    There setting of this value is defered and taken automaticly from the
    ep0 pointer where the UDC driver can update it according to the speed it
    detected _after_ a cable has been plugged.

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/composite.c    |    3 +--
 drivers/usb/gadget/dbgp.c         |    2 +-
 drivers/usb/gadget/file_storage.c |   10 ++++++----
 drivers/usb/gadget/gmidi.c        |    3 +--
 drivers/usb/gadget/inode.c        |    5 ++---
 drivers/usb/gadget/printer.c      |   14 +++++++++-----
 6 files changed, 20 insertions(+), 17 deletions(-)

commit bc2aa11468
Author: Tatyana Brokhman <tlinder@codeaurora.org>
Date:   Wed Jun 29 16:41:50 2011 +0300

    usb: gadget: add SuperSpeed support to the Gadget Framework

    SuperSpeed USB has defined a new descriptor, called
    the Binary Device Object Store (BOS) Descriptor. It
    has also changed a bit the definition of SET_FEATURE
    and GET_STATUS requests to add USB3-specific details.

    This patch implements both changes to the Composite
    Gadget Framework.

    [ balbi@ti.com : slight changes to commit log
    		 fixed a compile error on ARM ]

    Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/Kconfig      |    6 +
 drivers/usb/gadget/composite.c  |  257 ++++++++++++++++++++++++++++++++++++---
 drivers/usb/gadget/epautoconf.c |    6 +-
 include/linux/usb/composite.h   |   14 ++
 include/linux/usb/gadget.h      |   31 +++++
 5 files changed, 293 insertions(+), 21 deletions(-)

commit 3ba28906ae
Author: Tatyana Brokhman <tlinder@codeaurora.org>
Date:   Wed Jun 29 16:41:49 2011 +0300

    usb: gadget: add max_speed to usb_composite_driver

    This field is used by the Gadget drivers to specify
    the maximum speed they support, meaning: the maximum
    speed they can provide descriptors for.

    The driver speed will be set in consideration of this
    value.

    [ balbi@ti.com : dropped the ifdeffery ]

    Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    [idos@codeaurora.org: added max_speed also to android.c]
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/android.c      |    1 +
 drivers/usb/gadget/audio.c        |    1 +
 drivers/usb/gadget/cdc2.c         |    1 +
 drivers/usb/gadget/composite.c    |    2 ++
 drivers/usb/gadget/ether.c        |    1 +
 drivers/usb/gadget/g_ffs.c        |    1 +
 drivers/usb/gadget/hid.c          |    1 +
 drivers/usb/gadget/mass_storage.c |    1 +
 drivers/usb/gadget/multi.c        |    1 +
 drivers/usb/gadget/ncm.c          |    1 +
 drivers/usb/gadget/nokia.c        |    1 +
 drivers/usb/gadget/serial.c       |    1 +
 drivers/usb/gadget/webcam.c       |    1 +
 drivers/usb/gadget/zero.c         |    1 +
 include/linux/usb/composite.h     |    2 ++
 15 files changed, 17 insertions(+), 0 deletions(-)

commit 081412dc44
Author: Tatyana Brokhman <tlinder@codeaurora.org>
Date:   Tue Jun 28 16:33:53 2011 +0300

    usb: gadget: add streams support to the gadget framework

    This patch defines necessary fields to support
    streaming for USB3.0.

    It implements a new function, called
    usb_ep_autoconfig_ss(), to be used instead of the
    existing usb_ep_autoconfig() when working in
    SuperSpeed mode and there is a need to search for
    an endpoint according to the number of required
    streams.

    [ balbi@ti.com : slight changes to commit log ]

    Signed-off-by: Maya Erez <merez@codeaurora.org>
    Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/epautoconf.c |  125 +++++++++++++++++++++++++++++++--------
 include/linux/usb/gadget.h      |   13 ++++
 2 files changed, 113 insertions(+), 25 deletions(-)

commit 5ef53d97a1
Author: Tatyana Brokhman <tlinder@codeaurora.org>
Date:   Tue Jun 28 16:33:52 2011 +0300

    usb: gadget: coding style fix

    fix the coding style of a few switches on the
    gadget framework.

    [ balbi@ti.com : add a commit log ]

    Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/composite.c |   16 ++++++++++---
 drivers/usb/gadget/dummy_hcd.c |   48 ++++++++++++++++++++++++++++++----------
 2 files changed, 48 insertions(+), 16 deletions(-)

commit 31ac352192
Author: Tatyana Brokhman <tlinder@codeaurora.org>
Date:   Tue Jun 28 15:33:50 2011 +0200

    usb: gadget: use config_ep_by_speed() instead of ep_choose()

    Remove obsolete functions:
    1. ep_choose()
    2. usb_find_endpoint()

    Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    [idos@codeaurora.org: Changed also the following files to
    comply with this commit: f_accessory.c,f_adb.c,f_diag.c,f_mtp.c,
    f_rmnet.c,f_rmnet_sdio,f_rmnet_smd,f_rmnet_smd_sdio,f_serial.f_ccid.c.
    Also merged a patch in f_serial.c for checking return value of
    config_ep_by_speed, see "usb: gadget: fix g_serial regression".
    Also fix a bug in ci13xxx_udc. Since f_serial is now checking if the endpoint
    descriptors are null in the set_alt function, need to set them to null on
    ep_disable in case of cable disconnect. Since the ep descriptor was inserted to
    struct usb_ep in "usb: gadget: add usb_endpoint_descriptor to struct usb_ep",
    also set mEp->ep.desc to NULL. I have upstream this to the community, please
    see "usb: gadget: Clear usb_endpoint_descriptor inside the struct usb_ep" in
    the latest linux kernel.]
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/ci13xxx_udc.c      |    1 +
 drivers/usb/gadget/config.c           |   26 -------------
 drivers/usb/gadget/f_accessory.c      |   30 +++++++++++-----
 drivers/usb/gadget/f_acm.c            |   46 +++++++-----------------
 drivers/usb/gadget/f_adb.c            |   30 +++++++++++----
 drivers/usb/gadget/f_ccid.c           |   54 +++++++++++-----------------
 drivers/usb/gadget/f_diag.c           |   13 ++++---
 drivers/usb/gadget/f_ecm.c            |   45 +++++++----------------
 drivers/usb/gadget/f_eem.c            |   32 +++++------------
 drivers/usb/gadget/f_hid.c            |   19 +++-------
 drivers/usb/gadget/f_loopback.c       |   11 ++++--
 drivers/usb/gadget/f_mass_storage.c   |   46 ++++++++++--------------
 drivers/usb/gadget/f_mtp.c            |   30 +++++++++++----
 drivers/usb/gadget/f_ncm.c            |   49 ++++++++------------------
 drivers/usb/gadget/f_obex.c           |   32 +++++------------
 drivers/usb/gadget/f_phonet.c         |   12 +++---
 drivers/usb/gadget/f_rmnet.c          |   48 ++++++++-----------------
 drivers/usb/gadget/f_rmnet_sdio.c     |   62 ++++++++++++++++++++++++++------
 drivers/usb/gadget/f_rmnet_smd.c      |   38 +++++++++++++++-----
 drivers/usb/gadget/f_rmnet_smd_sdio.c |   63 ++++++++++++++++++++++++++------
 drivers/usb/gadget/f_rndis.c          |   46 +++++++-----------------
 drivers/usb/gadget/f_serial.c         |   53 +++++++++-------------------
 drivers/usb/gadget/f_sourcesink.c     |    8 +++-
 drivers/usb/gadget/f_subset.c         |   29 +++------------
 drivers/usb/gadget/file_storage.c     |   12 ++++++
 drivers/usb/gadget/storage_common.c   |   11 ------
 include/linux/usb/composite.h         |   15 --------
 include/linux/usb/gadget.h            |    6 ---
 28 files changed, 392 insertions(+), 475 deletions(-)

commit cf64ce4954
Author: Tatyana Brokhman <tlinder@codeaurora.org>
Date:   Tue Jun 28 16:33:49 2011 +0300

    usb: gadget: configure endpoint according to gadget speed

    Add config_ep_by_speed() to configure the endpoint
    according to the gadget speed.

    Using this function will spare the FDs from handling
    the endpoint chosen descriptor.

    Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/composite.c  |   85 +++++++++++++++++++++++++++++++++++++++
 drivers/usb/gadget/epautoconf.c |    1 +
 include/linux/usb/composite.h   |    3 +
 include/linux/usb/gadget.h      |    3 +
 4 files changed, 92 insertions(+), 0 deletions(-)

commit cf709c115c
Author: Tatyana Brokhman <tlinder@codeaurora.org>
Date:   Tue Jun 28 16:33:48 2011 +0300

    usb: gadget: add usb_endpoint_descriptor to struct usb_ep

    Change usb_ep_enable() prototype to use endpoint
    descriptor from usb_ep.

    This optimization spares the FDs from saving the
    endpoint chosen descriptor. This optimization is
    not full though. To fully exploit this change, one
    needs to update all the UDCs as well since in the
    current implementation each of them saves the
    endpoint descriptor in it's internal (and extended)
    endpoint structure.

    Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    [idos@codeaurora.org: Added more changes for the following files
    since API break with msm code tree: ci13xxx_udc.c,f_accessory,f_adb,
    f_diag,f_mtp,f_rmnet,f_rmnet_sdio,f_rmnet_smd, f_rmnet_smd_sdio,u_bam.c,
    u_sdio.c,u_rmnet.h,u_sdio.c,u_smd.c,f_ccid.c,u_data_hsic.c]
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/ci13xxx_udc.c      |    6 ++++--
 drivers/usb/gadget/dbgp.c             |    8 +++++---
 drivers/usb/gadget/f_accessory.c      |   16 ++++++++++------
 drivers/usb/gadget/f_acm.c            |    9 ++++-----
 drivers/usb/gadget/f_adb.c            |   14 ++++++++------
 drivers/usb/gadget/f_audio.c          |    5 ++---
 drivers/usb/gadget/f_ccid.c           |   15 ++++++---------
 drivers/usb/gadget/f_diag.c           |   12 +++++-------
 drivers/usb/gadget/f_ecm.c            |   17 ++++++++---------
 drivers/usb/gadget/f_eem.c            |   10 +++++-----
 drivers/usb/gadget/f_fs.c             |    3 ++-
 drivers/usb/gadget/f_hid.c            |    5 ++---
 drivers/usb/gadget/f_loopback.c       |   14 ++++++--------
 drivers/usb/gadget/f_mass_storage.c   |    3 ++-
 drivers/usb/gadget/f_mtp.c            |   17 ++++++++++-------
 drivers/usb/gadget/f_ncm.c            |   17 ++++++++---------
 drivers/usb/gadget/f_obex.c           |    6 +++---
 drivers/usb/gadget/f_phonet.c         |    9 ++++-----
 drivers/usb/gadget/f_rmnet.c          |    9 ++++-----
 drivers/usb/gadget/f_rmnet_sdio.c     |   15 +++++++++------
 drivers/usb/gadget/f_rmnet_smd.c      |   15 +++++++++------
 drivers/usb/gadget/f_rmnet_smd_sdio.c |   15 +++++++++------
 drivers/usb/gadget/f_rndis.c          |   15 +++++++--------
 drivers/usb/gadget/f_serial.c         |    9 ++++-----
 drivers/usb/gadget/f_sourcesink.c     |   10 ++++------
 drivers/usb/gadget/f_subset.c         |    8 ++++----
 drivers/usb/gadget/f_uvc.c            |    6 ++++--
 drivers/usb/gadget/file_storage.c     |    3 ++-
 drivers/usb/gadget/gmidi.c            |    6 ++++--
 drivers/usb/gadget/inode.c            |    6 ++++--
 drivers/usb/gadget/printer.c          |   26 ++++++++++++++------------
 drivers/usb/gadget/u_bam.c            |    8 ++++----
 drivers/usb/gadget/u_data_hsic.c      |   10 ++--------
 drivers/usb/gadget/u_ether.c          |   12 ++++++------
 drivers/usb/gadget/u_ether.h          |    4 ----
 drivers/usb/gadget/u_rmnet.h          |    2 --
 drivers/usb/gadget/u_sdio.c           |    4 ++--
 drivers/usb/gadget/u_serial.c         |    4 ++--
 drivers/usb/gadget/u_serial.h         |    2 --
 drivers/usb/gadget/u_smd.c            |    4 ++--
 include/linux/usb/gadget.h            |   16 +++++++---------
 41 files changed, 197 insertions(+), 198 deletions(-)

commit d23607a2eb
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Tue Jun 28 16:33:47 2011 +0300

    usb: gadget: convert all users to the new udc infrastructure

    peripheral drivers are using usb_add_gadget()/usb_del_gadget() to
    register/unregister to the udc-core.

    The udc-core will take the first available gadget driver and attach
    function driver which is calling usb_gadget_register_driver(). This is
    the same behaviour we have right now.

    Only dummy_hcd was tested, the others were compiled tested.

    Cc: Alan Stern <stern@rowland.harvard.edu>
    Cc: Anton Tikhomirov <av.tikhomirov@samsung.com>
    Cc: Ben Dooks <ben-linux@fluff.org>
    Cc: Dan Carpenter <error27@gmail.com>
    Cc: Darius Augulis <augulis.darius@gmail.com>
    Cc: Eric Miao <eric.y.miao@gmail.com>
    Cc: Jingoo Han <jg1.han@samsung.com>
    Cc: Kukjin Kim <kgene.kim@samsung.com>
    Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
    Cc: Li Yang <leoli@freescale.com>
    Cc: Michael Hennerich <michael.hennerich@analog.com>
    Acked-by: Mike Frysinger <vapier@gentoo.org>
    Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
    Cc: Pavankumar Kondeti <pkondeti@codeaurora.org>
    Cc: Roy Huang <roy.huang@analog.com>
    Cc: Russell King <linux@arm.linux.org.uk>
    Cc: Toshiharu Okada <toshiharu-linux@dsn.okisemi.com>
    Cc: Xiaochen Shen <xiaochen.shen@intel.com>
    Cc: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
    Cc: Yuan-Hsin Chen <yhchen@faraday-tech.com>
    Cc: cxie4 <cxie4@marvell.com>
    Cc: linux-geode@lists.infradead.org
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    [idos@codeaurora.org:
    Conflicts: drivers/usb/gadget/ci13xxx_udc.c
    msm72k_udc.c: This driver is not exists in Linux community,so fix this one too.
    cyasgadget.c: combine other patch from the community ("convert cyasgadget to new udc core")
    into this commit. Removed the #if 0 block that was in the community version and fix
    the cause problem, because of which it was under #if 0 block]
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 .../staging/westbridge/astoria/gadget/cyasgadget.c |   26 ++++++++++++++--
 drivers/usb/gadget/Makefile                        |    1 +
 drivers/usb/gadget/amd5536udc.c                    |   18 ++++++++---
 drivers/usb/gadget/at91_udc.c                      |   20 +++++++++---
 drivers/usb/gadget/atmel_usba_udc.c                |   26 ++++++++++++++--
 drivers/usb/gadget/ci13xxx_udc.c                   |   30 ++++++++++++++-----
 drivers/usb/gadget/dummy_hcd.c                     |   31 +++++++++++++------
 drivers/usb/gadget/fsl_qe_udc.c                    |   20 ++++++++++--
 drivers/usb/gadget/fsl_udc_core.c                  |   20 ++++++++++--
 drivers/usb/gadget/fusb300_udc.c                   |   15 +++++++--
 drivers/usb/gadget/goku_udc.c                      |   19 +++++++++---
 drivers/usb/gadget/imx_udc.c                       |   20 +++++++++---
 drivers/usb/gadget/langwell_udc.c                  |   20 ++++++++----
 drivers/usb/gadget/m66592-udc.c                    |   17 ++++++++--
 drivers/usb/gadget/msm72k_udc.c                    |   30 ++++++++++++++++---
 drivers/usb/gadget/mv_udc_core.c                   |   19 +++++++----
 drivers/usb/gadget/net2280.c                       |   18 ++++++++---
 drivers/usb/gadget/omap_udc.c                      |   22 +++++++++++---
 drivers/usb/gadget/pch_udc.c                       |   16 +++++++--
 drivers/usb/gadget/pxa25x_udc.c                    |   19 ++++++++----
 drivers/usb/gadget/pxa27x_udc.c                    |   23 ++++++++++----
 drivers/usb/gadget/r8a66597-udc.c                  |   15 +++++++--
 drivers/usb/gadget/s3c-hsotg.c                     |   19 +++++++++--
 drivers/usb/gadget/s3c-hsudc.c                     |   16 +++++++--
 drivers/usb/gadget/s3c2410_udc.c                   |   29 +++++++++++-------
 drivers/usb/musb/musb_gadget.c                     |   23 +++++++++++---
 drivers/usb/renesas_usbhs/mod_gadget.c             |   20 +++++++++---
 27 files changed, 411 insertions(+), 141 deletions(-)

commit 5177504241
Author: Felipe Balbi <balbi@ti.com>
Date:   Tue Jun 28 16:33:46 2011 +0300

    usb: gadget: introduce UDC Class

    this class will be used to abstract away several of the duplicated
    operations scattered among the USB gadget controller drivers.

    Later, we can add an atomic notifier to tell interested drivers about
    what's happening with the controller. Notifications such as suspend,
    resume, enumerated, etc. will be useful, at a minimum, for implementing
    usb charger detection.

    As part of the converting process usb_gadget_probe_driver() is no longer
    part of each udc but pushed into the ->stap() callback. The same for his
    couterpart.

    The core is currently set explicit to 'n'. It will be changed to 'y' once
    all users are converted since it provides functions which clash with
    other drivers.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Acked-by: Michal Nazarewicz <mina86@mina86.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/udc-core.c |  418 +++++++++++++++++++++++++++++++++++++++++
 include/linux/usb/gadget.h    |    7 +
 2 files changed, 425 insertions(+), 0 deletions(-)

commit 9bcc83f456
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Fri Aug 19 18:10:56 2011 +0300

    usb: ch9: add function defines from ch9, USB 3.0 spec

    not to confuse with Table 9-7 in USB 2.0 spec

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 include/linux/usb/ch9.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

commit 0be99a24db
Author: Paul Gortmaker <paul.gortmaker@windriver.com>
Date:   Fri Sep 30 18:08:59 2011 -0400

    usb: Add module.h to various dwc3 drivers

    These files uses the full set of MODULE_ macros and so need to
    include module.h directly.

    Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.c      |    1 +
 drivers/usb/dwc3/dwc3-omap.c |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

commit f208a8f461
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Sep 30 10:58:51 2011 +0300

    usb: dwc3: convert structures into bitshifts

    our parameter structures need to be written to
    HW, so instead of assuming little endian, we
    convert those into bit shifts.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c    |    6 +-
 drivers/usb/dwc3/gadget.c |   40 ++++++-------
 drivers/usb/dwc3/gadget.h |  139 +++++++++------------------------------------
 3 files changed, 48 insertions(+), 137 deletions(-)

commit b141b8cd02
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Sep 30 10:58:50 2011 +0300

    usb: dwc3: gadget: allow clock gating to work

    The dwc3 core has internal clock gating support.

    Let's allow that to happen by clearing the disable
    bit in GCTL register.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h   |    6 ++++++
 drivers/usb/dwc3/gadget.c |    8 ++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

commit b333f87fcc
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Sep 30 10:58:49 2011 +0300

    usb: dwc3: core: cache GHWPARAMS* registers

    cache the contents of GHWPARAMS* registers in
    our device structure for easy access.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

commit d8e9f2a2f0
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Sep 30 10:58:48 2011 +0300

    usb: dwc3: add struct dwc3_hwparams

    That structure will hold a copy of readonly
    GHWPARAMS* registers for ease accessing by
    the driver.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

commit 2aadc55ef7
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Sep 30 10:58:47 2011 +0300

    usb: dwc3: gadget: implement streams support

    The following patch adds support for streams
    to dwc3 driver.

    While at that, also fix one small issue on
    endpoint disable where we should clear all
    flags not only ENABLED.

    Reviewied-by: Paul Zimmerman <paulz@synopsys.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 Documentation/usb/dwc3.txt |    8 --------
 drivers/usb/dwc3/core.h    |    6 ++++++
 drivers/usb/dwc3/gadget.c  |   34 ++++++++++++++++++++++++++++++----
 3 files changed, 36 insertions(+), 12 deletions(-)

commit 92366a9b25
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Sep 30 10:58:46 2011 +0300

    usb: dwc3: gadget: add support for Bursts

    We already have the value from gadget drivers,
    just need to pass it to our controller.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    [idos@codeaurora.org: Integrate in this commit also the change
    "USB: use usb_endpoint_maxp() instead of le16_to_cpu()" 29cc88979a8818cd8c5019426e945aed118b400e
    from Linux kernel 3.1. The reason why this change was not
    cherry-picked separately is because I wanted to reduce impact
    on msm code tree, and only change dwc3 driver.]
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

commit 4f5db5cf5b
Author: kuninori.morimoto.gx@renesas.com <kuninori.morimoto.gx@renesas.com>
Date:   Mon Jul 25 00:39:30 2011 -0700

    usb: add usb_endpoint_maxp() macro

    Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    [idos@codeaurora.org: use __le16_to_cpu instead of le16_to_cpu]
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 include/linux/usb/ch9.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

commit bba939f019
Author: Paul Zimmerman <Paul.Zimmerman@synopsys.com>
Date:   Fri Sep 30 10:58:45 2011 +0300

    usb: dwc3: gadget: fix DMA offset calculation

    Fix offset calculation in dwc3_trb_dma_offset()

    Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit 4281539e1d
Author: Paul Zimmerman <Paul.Zimmerman@synopsys.com>
Date:   Fri Sep 30 10:58:44 2011 +0300

    usb: dwc3: gadget: make DWC3_EP_WEDGE do the right thing

    This makes DWC3_EP_WEDGE do the right thing, which is
    prevent DWC3_EP_WEDGE from ever being cleared by a
    ClearFeature(HALT) command.

    [ balbi@ti.com : allowed set_wedge to send SetHalt command
    	to controller ]

    Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

commit df7a63dc19
Author: Paul Zimmerman <Paul.Zimmerman@synopsys.com>
Date:   Fri Sep 30 10:58:43 2011 +0300

    usb: dwc3: gadget: driver should not wait for RxFIFO to drain

    An older version of the databook said to wait for the FIFO to
    drain, but that has been removed from the newer databooks.

    Waiting for RxFIFO to drain caused problems when testing against
    one of the host controllers available in the market.

    After talking to one of the RTL engineers, he stated that we
    should _not_ wait for RxFIFO to drain.

    Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |   19 -------------------
 1 files changed, 0 insertions(+), 19 deletions(-)

commit a6544d0e1c
Author: Paul Zimmerman <Paul.Zimmerman@synopsys.com>
Date:   Fri Sep 30 10:58:42 2011 +0300

    usb: dwc3: gadget: fix DEPSTARTCFG for non-EP0 EPs

    DEPSTARTCFG for non-EP0 EPs must only be sent once per config

    [ balbi@ti.com : changed config_start to start_config_issued ]

    Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h   |    2 ++
 drivers/usb/dwc3/ep0.c    |    1 +
 drivers/usb/dwc3/gadget.c |   10 +++++++++-
 3 files changed, 12 insertions(+), 1 deletions(-)

commit 9342a6f8b0
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Fri Sep 30 10:58:41 2011 +0300

    usb: dwc: remove "All rights reserved" statement.

    Some people think that this line is not compatible with the GPL. The
    statement was required due to the Buenos Aires Convention and is now
    deprecated. I remove it because it is said that it is pointless nowdays.

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.c      |    1 -
 drivers/usb/dwc3/core.h      |    1 -
 drivers/usb/dwc3/debug.h     |    1 -
 drivers/usb/dwc3/debugfs.c   |    1 -
 drivers/usb/dwc3/dwc3-omap.c |    1 -
 drivers/usb/dwc3/dwc3-pci.c  |    1 -
 drivers/usb/dwc3/ep0.c       |    1 -
 drivers/usb/dwc3/gadget.c    |    1 -
 drivers/usb/dwc3/gadget.h    |    1 -
 drivers/usb/dwc3/io.h        |    1 -
 10 files changed, 0 insertions(+), 10 deletions(-)

commit f8336a2d5b
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Fri Sep 30 10:58:40 2011 +0300

    usb: dwc3: ep0: fix debug output

    Use "ep0in" and "ep0out" instead "ep1in" and "ep0out" which is confusing
    and not consistent with the remaining output.

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit 9b580c9667
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Fri Sep 30 10:58:39 2011 +0300

    usb: dwc3: ep0: remove second giveback in error case

    We already give requests back in dwc3_ep0_stall_and_restart() so
    doing it again here will most likely corrupt the list.

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

commit b55ee45356
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Sep 30 10:58:38 2011 +0300

    usb: dwc3: ep0: fix debug message

    The way it was before was really meaningless.
    Now it looks saner.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

commit 0788d7b5e6
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Sep 30 10:58:37 2011 +0300

    usb: dwc3: ep0: ignore direction on 2-stage transfer

    We don't need to care about direction on a two stage
    transfer.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

commit b7139d3e59
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Sep 30 10:58:36 2011 +0300

    usb: dwc3: ep0: Make USB30CV happy with SetAddress

    According to USB 3.0 Specification, a SetAddress()
    while device is in Configured State has an unspecified
    behavior (see Section 9.4.6). Still USB30CV wasn't
    happy with my Stall reply.

    To make that thing happy, just accept the SetAddress()
    always. No problems have been observed thus far.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c |   31 +++++++++----------------------
 1 files changed, 9 insertions(+), 22 deletions(-)

commit 6edd5bdb3b
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 8 21:18:47 2011 +0300

    usb: dwc3: gadget: improve debug on link state change

    It's useful to know which states core is going
    through, as it might help us figure out misbehavior
    on specific link states.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

commit 29561f1886
Author: Felipe Balbi <balbi@ti.com>
Date:   Tue Sep 6 10:56:51 2011 +0300

    usb: dwc3: omap: set idle and standby modes

    For now, let's disable IDLE and STANDBY transitions
    until we have a real HW to validate against.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/dwc3-omap.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

commit ecc99439be
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 8 18:27:33 2011 +0300

    usb: dwc3: ep0: introduce ep0_expect_in flag

    This flag will tell us which direction we're
    expecting on the next (data or status) phase.

    It will help us catching errors of host going
    crazy and requesting data of the wrong direction.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h |    2 ++
 drivers/usb/dwc3/ep0.c  |   16 ++++++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

commit 4454f03ef0
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 8 18:17:12 2011 +0300

    usb: dwc3: ep0: giveback requests on stall_and_restart

    if we don't, the list will be busy forever.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

commit d3ba9a9d63
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 8 18:16:21 2011 +0300

    usb: dwc3: gadget: drop the useless dma_sync_single* calls

    if req->dma isn't DMA_ADDR_INVALID it means gadget driver
    mapped the request or allocated from coherent, so it's
    unnecessary to do anything.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

commit d195b32c82
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 8 17:42:11 2011 +0300

    usb: dwc3: gadget: fix GCTL programming

    ensure a few bits are cleared before enabling
    what we need.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

commit e207db6804
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 8 17:41:00 2011 +0300

    usb: dwc3: define ScaleDown macro helper

    We must ensure that those bits aren't set as
    they should only be used in simulation.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

commit 18b26f81d3
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 8 17:39:59 2011 +0300

    usb: dwc3: Fix definition of DWC3_GCTL_U2RSTECN

    that should be 1 << 16, not 16. Caused so many
    problems and we never caught it before.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit 4ae8e1c5f7
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Wed Aug 31 17:12:02 2011 +0200

    usb: dwc3: gadget: do not map/unmap ZLP transfers

    If the gadget drivers sends a ZLP we are trying to map this this request
    which does not work on all implementations. So we simply skip mapping
    it.

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

commit 5248ed14ac
Author: Felipe Balbi <balbi@ti.com>
Date:   Tue Sep 6 12:00:39 2011 +0300

    usb: dwc3: omap: fix IRQ handling

    In order to ACK the IRQ we must write back
    to the same register the bits we read.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/dwc3-omap.c |   39 ++++++++++++---------------------------
 1 files changed, 12 insertions(+), 27 deletions(-)

commit 6e8585e672
Author: Felipe Balbi <balbi@ti.com>
Date:   Tue Sep 6 10:57:41 2011 +0300

    usb: dwc3: omap: change IRQ name to dwc3-omap

    dwc3-wrapper can be used by any other wrapper,
    using dwc3-omap makes it clear that we're running
    on OMAP SoC.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/dwc3-omap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit 8ff9be9a57
Author: Felipe Balbi <balbi@ti.com>
Date:   Mon Sep 5 13:37:28 2011 +0300

    usb: dwc3: add module.h to dwc3-omap.c and core.c

    We need that header because of THIS_MODULE.

    Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.c      |    1 +
 drivers/usb/dwc3/dwc3-omap.c |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

commit 6f33e1af1a
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 1 22:26:25 2011 +0300

    usb: dwc3: omap: distinguish between SW and HW modes

    The OMAP wrapper allows us to either control internal
    OTG signals via SW or HW. Different boards might wish
    to use one or the other mode of operation. Let's have
    have that information passed via platform_data for now.

    After DT conversion is finished for OMAP, we can easily
    convert this to a DT attribute.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/dwc3-omap.c            |   22 ++++++++++++++
 include/linux/platform_data/dwc3-omap.h |   47 +++++++++++++++++++++++++++++++
 2 files changed, 69 insertions(+), 0 deletions(-)

commit 201d9a02ee
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 1 18:33:43 2011 +0300

    usb: dwc3: omap: drop DEV_PM_OPS for now

    We need to have actual HW in order to implement
    and test that part of the code anyway. Until then
    it's best to remove it.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/dwc3-omap.c |   41 -----------------------------------------
 1 files changed, 0 insertions(+), 41 deletions(-)

commit c6aa9939cb
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 1 18:22:01 2011 +0300

    usb: dwc3: omap: use the macro we already have

    trivial patch, no functional changes.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/dwc3-omap.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

commit e4b324671d
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 1 14:52:52 2011 +0300

    usb: dwc3: omap: do not enable DMA Disable Clear IRQ

    Otherwise that IRQ will trigger forever. It's quite
    unnecessary.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/dwc3-omap.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

commit c93695d156
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 1 14:46:16 2011 +0300

    usb: dwc3: omap: fix dev_dbg() calls

    dev_dbg() macro expects a device pointer as
    argument, not a memory base address.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/dwc3-omap.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

commit 665b9c7f97
Author: Felipe Balbi <balbi@ti.com>
Date:   Tue Aug 30 15:52:17 2011 +0300

    usb: dwc3: use ep0_next_event field

    Start tracking the next expected event and act
    on the error conditions as suggested by databook.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c |   40 ++++++++++++++++++++++++++++++++++++----
 1 files changed, 36 insertions(+), 4 deletions(-)

commit 4f072fa1d0
Author: Felipe Balbi <balbi@ti.com>
Date:   Tue Aug 30 15:50:40 2011 +0300

    usb: dwc3: core: add ep0_next_event field

    this field will hold the next expected event.

    In certain cases, host might fall into some error
    condition and ask from us the wrong Control phase.
    On such situations, we should stall and restart.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

commit aa7b4d0d1f
Author: Felipe Balbi <balbi@ti.com>
Date:   Tue Aug 30 15:48:08 2011 +0300

    usb: dwc3: drop EP0_STALL state

    Whenever we issue a Set Stall command on EP0,
    the state machine will be restarted and Stall
    is cleared automatically, when core receives
    the next SETUP packet.

    There's no need to track that EP0_STALL state.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h   |    1 -
 drivers/usb/dwc3/ep0.c    |    2 --
 drivers/usb/dwc3/gadget.c |   10 ++++++++--
 3 files changed, 8 insertions(+), 5 deletions(-)

commit 0054d1193f
Author: Felipe Balbi <balbi@ti.com>
Date:   Tue Aug 30 15:54:53 2011 +0300

    usb: dwc3: ep0: clear all EP0 flags

    when we're going to issue Set Stall command,
    we should clear DWC3_EP_STALL flag, but also
    we should clear BUSY, HALTED and all others.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit c0478e0f39
Author: Felipe Balbi <balbi@ti.com>
Date:   Wed Aug 31 11:51:43 2011 +0300

    usb: dwc3: ep0: fix Get Status handling

    data was prepared on setup_buf but transfer
    was started on ctrl_req, fix it.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit 6062cac8e2
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Mon Aug 29 16:46:38 2011 +0200

    usb: dwc3: gadget: replace mdelay with udelay in the busy loop

    There are two spots where we wait until the HW finishes processing a
    certain command. Initially we had a few problems and we used 500ms as a
    limit to be on a the safe side. Paul Zimmerman mentioned this is little too
    much. After a debugging session, we noticed that we hardly ever go over 20us
    and didn't pass 30usec so far. Using mdelay() seems way overloaded.

    Giving the current numbers 500usec as the upper limit is more than  enough.
    Should it ever timeout then something is definitely wrong.

    While here, also replace the type with u32 since long does not really
    fit here.

    Cc: Paul Zimmerman <paul.zimmerman@synopsys.com>
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

commit b55db3bb7e
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Mon Aug 29 13:56:37 2011 +0200

    usb: dwc3: gadget: rework the dequeue on RESET & DISCONNECT

    - since a while we are disabling an endpoint and purging every requests on
      RESET and DISCONNECT which leads to a warning since the endpoint was
      disabled twice (once by the UDC, and second time by the gadget). I
      think UDC should nuke all requests because all those requests
      become invalid. It's gadget driver's responsability, though, to disable
      its used endpoints. This is done by merging dwc3_stop_active_transfer()
      and dwc3_gadget_nuke_reqs() into dwc3_remove_requests().

    - dwc3_stop_active_transfer() is now no longer called unconditionaly.
      This has the advantage that it is always called to disable an active
      transfer which means if res_trans_idx 0 than something went wrong and
      it is an error condition because we can't clean up the requests.

    - Remove the DWC3_EP_WILL_SHUTDOWN which was introduced while
      introducing the command complete part for dequeue. All requests on
      req_queued list should be removed during the dwc3_cleanup_done_reqs()
      callback so there is no reason to go through the list again.
      We consider it an error condition if requests are still on this
      list since we never queue TRB without LST=1 (the last requests has
      always LST=1, there are no requests with LST=0 behind it).

    [ balbi@ti.com : reworked commit log a bit, made patch apply ]

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h   |    1 -
 drivers/usb/dwc3/gadget.c |   31 ++++++++++++-------------------
 2 files changed, 12 insertions(+), 20 deletions(-)

commit fe2b0910d5
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Mon Aug 29 13:56:36 2011 +0200

    usb: dwc3: core: move the core check before soft reset

    We read the DWC3_GSNPSID register to make sure we got the correct
    register offset passed. One of the recent commits moved the soft reset
    before this so in case of the wrong offset we end up with "reset timed
    out". This patch moves the "id" check before the reset again.

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.c |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

commit 9665fdff2c
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Mon Aug 29 13:56:35 2011 +0200

    usb: dwc3: debugfs: remove test mode interface

    There are some issues around for enabling/disabling this mode and
    handling it. It does not work perfectly (yet). However we have a few
    gadgets tested successfuly so far. That means we are quite confident
    that we won't need this in near future.
    So I'm for removing it and bringing a working version back once there is
    a need for it.

    Thanks to Dan Carpenter who spotted the wrong memory handling here.

    [ balbi@ti.com : made it actually apply ]

    Cc: Dan Carpenter <error27@gmail.com>
    Cc: wharms@bfs.de
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/debugfs.c |   94 --------------------------------------------
 1 files changed, 0 insertions(+), 94 deletions(-)

commit 32e132e3ea
Author: Felipe Balbi <balbi@ti.com>
Date:   Sat Aug 27 22:28:36 2011 +0300

    usb: dwc3: ep0: simplify EP0 state machine

    The DesignWare USB3 core tells us which phase
    of a control transfer should be started, it
    also tells us which physical endpoint needs
    that transfer.

    With these two informations, we have all we
    need to simply EP0 handling quite a lot and
    get rid rid of the SW state machine tracking
    ep0 states.

    For achieving this perfectly, we needed to
    add support for situations where we get
    XferNotReady while endpoint is still busy
    and XferNotReady while gadget driver still
    hasn't queued a request.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h   |   12 +-
 drivers/usb/dwc3/ep0.c    |  363 ++++++++++++++++++++-------------------------
 drivers/usb/dwc3/gadget.c |    3 +-
 3 files changed, 163 insertions(+), 215 deletions(-)

commit edb4e77ef4
Author: Felipe Balbi <balbi@ti.com>
Date:   Sat Aug 27 22:26:00 2011 +0300

    usb: dwc3: core: add flag for EP0 direction

    Add a flag to keep track of ep0 direction.
    This flag will be used on a following patch.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

commit 31d1e80389
Author: Felipe Balbi <balbi@ti.com>
Date:   Sat Aug 27 22:18:09 2011 +0300

    usb: dwc3: ep0: add handling for unaligned OUT transfers

    In case we have transfers which aren't aligned
    to wMaxPacketSize, we need to be careful with
    how we start the transfer with the HW. OUT
    transfers _must_ be aligned with wMaxPacketSize
    and in order to guarantee that, we use a bounce
    buffer.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c |   37 ++++++++++++++++++++++++++++++++-----
 1 files changed, 32 insertions(+), 5 deletions(-)

commit 64e9634b21
Author: Felipe Balbi <balbi@ti.com>
Date:   Sat Aug 27 22:07:53 2011 +0300

    usb: dwc3: add a bounce buffer for control endpoints

    This core cannot handle OUT transfers which aren't
    aligned to wMaxPacketSize, but that can happen at
    least on control endpoint with the USB Audio Class.

    This patch adds a bounce buffer to be used on the
    case of a non-aligned ep0out request is queued.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h   |    6 ++++++
 drivers/usb/dwc3/gadget.c |   29 ++++++++++++++++++++++-------
 2 files changed, 28 insertions(+), 7 deletions(-)

commit 6cd800e879
Author: Felipe Balbi <balbi@ti.com>
Date:   Sat Aug 27 22:04:32 2011 +0300

    usb: dwc3: core: add defines for XferNotReady event on Control EPs

    The status field of the Transfer Not Read event
    is different on Control Endpoints. On this patch
    we are just adding the defines to be used on a
    later patch which will re-work the control endpoint
    handling.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

commit c7dbe4f213
Author: Felipe Balbi <balbi@ti.com>
Date:   Sat Aug 27 20:29:58 2011 +0300

    usb: dwc3: gadget: improve command completion debug message

    the previous message had too little meaning. Make
    it more human readable and use the macro we already
    had for extracting the command completion status out
    of DEPCMDn register.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

commit 162e128db0
Author: Felipe Balbi <balbi@ti.com>
Date:   Sat Aug 27 15:10:09 2011 +0300

    usb: dwc3: gadget: set request dma to invalid when unmapping

    if we don't set DMA address to invalid when unmapping,
    we might fall in a situation where request buffer
    can't be mapped to DMA again.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

commit ff4e987bcf
Author: Felipe Balbi <balbi@ti.com>
Date:   Sat Aug 27 02:30:33 2011 +0300

    usb: dwc3: ep0: fix 'transfered' typo

    trivial patch. No functional changes.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

commit 7a769ecc90
Author: Felipe Balbi <balbi@ti.com>
Date:   Sat Aug 27 01:40:52 2011 +0300

    usb: dwc3: core: add missing @ for kerneldoc

    trivial patch, no functional changes

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

commit e918b57dc8
Author: Dan Carpenter <error27@gmail.com>
Date:   Fri Aug 26 12:21:13 2011 +0300

    usb: dwc3: debugfs: add a kfree() on error to dwc3_testmode_open()

    We may as well fix this potential leak so we don't have to listen to
    the static checkers complain.

    Signed-off-by: Dan Carpenter <error27@gmail.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/debugfs.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

commit b31b612847
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Mon Aug 22 18:29:13 2011 +0200

    usb: dwc3: gaget: clear DWC3_EP_WILL_SHUTDOWN bit

    Without this patch we won't clear that bit and instead will
    clear all other bits on our endpoint flag.

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit 15623d7087
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Mon Aug 22 17:42:19 2011 +0200

    usb: dwc3: gadget: use TRB type 6 for ISOC transfers

    Type 6 should be used for the first transfer during an interval. This is
    also what the reference driver is using. Type 7 seems to be for following
    or additional transfers within the same interval.

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit 4df3977d9f
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Mon Aug 22 17:42:18 2011 +0200

    usb: dwc3: gadget: reset resource index to zero

    If we collected two requests together (i.e. only the last of them has
    LST=1) then we only have to stop transfer once: The clean-up code will
    cleanup everything until first TRB with the LST bit set.
    After XferComplete this index should be no longer valid since there is
    no transfer pending.

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

commit 679dc46637
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Fri Aug 19 19:59:12 2011 +0200

    usb: dwc3: gadget: fixing dequeue of TRBs

    A TRB which is dequeued seems to have its HWO bits set to 1. Therefore
    we ignore it if we dequeue it after the command is completed.

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

commit d9a09a239e
Author: Randy Dunlap <rdunlap@xenotime.net>
Date:   Tue Aug 23 12:52:47 2011 -0700

    usb: fix dwc3 build when USB_GADGET_DWC3 is not enabled

    Fix build error when CONFIG_USB_GADGET_DWC3 is not enabled:

    ERROR: "dwc3_send_gadget_ep_cmd" [drivers/usb/dwc3/dwc3.ko] undefined!

    Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
    Acked-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

commit faea001704
Author: Stephen Rothwell <sfr@canb.auug.org.au>
Date:   Tue Aug 23 15:08:54 2011 +1000

    usb: include module.h in the DesignWare USB3 DRD driver

    Fixes this build error:

    drivers/usb/dwc3/dwc3-pci.c: In function 'dwc3_pci_init':
    drivers/usb/dwc3/dwc3-pci.c:211:9: error: 'THIS_MODULE' undeclared (first use in this function)

    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    Acked-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/dwc3-pci.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

commit 4dc64e52bd
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Aug 19 18:10:58 2011 +0300

    usb: dwc3: Introduce DesignWare USB3 DRD Driver

    The DesignWare USB3 is a highly
    configurable IP Core which can be
    instantiated as Dual-Role Device (DRD),
    Peripheral Only and Host Only (XHCI)
    configurations.

    Several other parameters can be configured
    like amount of FIFO space, amount of TX and
    RX endpoints, amount of Host Interrupters,
    etc.

    The current driver has been validated with
    a virtual model of version 1.73a of that core
    and with an FPGA burned with version 1.83a
    of the DRD core. We have support for PCIe
    bus, which is used on FPGA prototyping, and
    for the OMAP5, more adaptation (or glue)
    layers can be easily added and the driver
    is half prepared to handle any possible
    configuration the HW engineer has chosen
    considering we have the information on
    one of the GHWPARAMS registers to do
    runtime checking of certain features.

    More runtime checks can, and should, be added
    in order to make this driver even more flexible
    with regards to number of endpoints, FIFO sizes,
    transfer types, etc.

    While this supports only the device side, for
    now, we will add support for Host side (xHCI -
    see the updated series Sebastian has sent [1])
    and OTG after we have it all stabilized.

    [1] http://marc.info/?l=linux-usb&m=131341992020339&w=2

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    [idos@codeaurora.org: gadget_chips.h: Use 'gadget_is_dwc3(g)' only if
    CONFIG_USB_GADGET_DWC3 is defined.]
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 Documentation/usb/dwc3.txt        |   53 +
 drivers/usb/Kconfig               |    2 +
 drivers/usb/Makefile              |    2 +
 drivers/usb/dwc3/Kconfig          |   25 +
 drivers/usb/dwc3/Makefile         |   36 +
 drivers/usb/dwc3/core.c           |  467 +++++++++
 drivers/usb/dwc3/core.h           |  709 +++++++++++++
 drivers/usb/dwc3/debug.h          |   51 +
 drivers/usb/dwc3/debugfs.c        |  534 ++++++++++
 drivers/usb/dwc3/dwc3-omap.c      |  410 ++++++++
 drivers/usb/dwc3/dwc3-pci.c       |  219 ++++
 drivers/usb/dwc3/ep0.c            |  782 ++++++++++++++
 drivers/usb/dwc3/gadget.c         | 2063 +++++++++++++++++++++++++++++++++++++
 drivers/usb/dwc3/gadget.h         |  292 ++++++
 drivers/usb/dwc3/io.h             |   55 +
 drivers/usb/gadget/Kconfig        |   12 +
 drivers/usb/gadget/gadget_chips.h |    4 +
 17 files changed, 5716 insertions(+), 0 deletions(-)

commit 348a4c2038
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Aug 19 18:10:57 2011 +0300

    usb: gadget: introduce gadget_is_dwc3()

    ... to check whether we're running on DesignWare
    USB3 DRD Controller.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    [idos@codeaurora.org: Conflicts: gadget_chips.h]
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/gadget_chips.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Change-Id: I12d5f2f957d39b2ff8031366994689bcd453f213
Signed-off-by: David Brown <davidb@codeaurora.org>
2012-03-09 08:25:28 -08:00
Linux Build Service Account
7cab0c9f9a Merge "USB: core: Add support for OTG automated compliance tests" into msm-3.0 2012-03-08 20:43:43 -08:00
Hemant Kumar
5692535d5b USB: EHCI: Add support to detect docking station connection and removal
This change implements the docking station detection by reading the status
of MPP9 on PMIC8921. With this change VREG_5V(USB port 3 VBUS) is turned on
only when docking station is connected to Liquid platform in order to save
power.

Change-Id: I4282b4273adabf8aeaf8faad43cd2cfff36eeac6
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2012-03-08 09:39:16 -08:00
Vijayavardhan Vennapusa
1720db8438 USB: core: Add support for OTG automated compliance tests
1. Add OTG PET device to TPL. OTG device shall support this
device for allowing compliance automated testing.

2. Add otg_srp_reqd filed to gadget. OTG B-device shall enable
this flag when OTG PET (Protocol and Electrical Tester) that
acts as A-device sends Set Feature TEST_MODE with wIndex high
byte value = 0x06.  OTG PET expects B-device to initiate SRP
after the end of current session.

3. Add otg_vbus_off to usb_bus.  USB core enables this flag
when OTG PET enumerates with bcdDevice[0] field in its Device
Descriptor is equal to 1.  OTG PET expects A-device to turn off
the VBUS with in 5 sec of its disconnection which allows it to
initiate SRP.

3. Add support to identify OTG PET and start HNP quickly.

Change-Id: Ib1f4d835d00ca29ff8f980c94d75a3890507dedc
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
2012-03-07 16:32:16 +05:30
Vijayavardhan Vennapusa
81bda9d20e USB: core: Fix misc OTG related bugs
This patch fixes the following OTG related bugs:

1. The current code does not wait for the ongoing HNP polling work to
finish upon the device disconnection which results in a crash when
accessing the udev structure in hnp polling routine.

2. bcdOTG field is added to OTG descriptor in 2.0 revision. Check OTG
descriptor size before validating bcdOTG field.  A legacy device sends
2 bytes lesser than the size of OTG descriptor specified in 2.0 spec.

3. The host is required to execute a GetStatus() with a frequency of
THOST_REQ_POLL in order to determine the state of the Host request flag.
The limits of THOST_REQ_POLL are 1 - 2 sec. Use the average value 1.5 sec
for HNP polling to pass compliance tests.

Change-Id: Ie6a6a8e915d10c1347946f979c919d04d64823b4
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
2012-03-07 16:31:34 +05:30
Vijayavardhan Vennapusa
95b650ab5d USB: gadget: composite: Process GetDescriptor(OTG) request
If gadget is OTG capable, respond to a GetDescriptor(OTG) request
with its OTG descriptor.  This patch adds a utility to function
to find and fill the requested descriptor.

Change-Id: I5b3624b1145d46179b0c4737e82a47c68604cab4
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
2012-03-07 16:30:53 +05:30
Felipe Balbi
b0c3e7fb4d usb: gadget: fix typo for default U1/U2 exit latencies
s/DEFULT/DEFAULT/, no functional changes.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-03-05 11:41:41 +02:00
Sebastian Andrzej Siewior
fb5591ebf5 usb: gadget: udc-core: add "new-style" registration interface
udc_start() should only trigger the internal state machine and make
minimal house keeping. Before that call udc-core calls the bind()
callback and after the callback the pullup().

udc_stop() is simillar, udc-core calls pullup(), unbind() and finally
udc_stop().

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-03-05 11:41:39 +02:00
Tatyana Brokhman
bc2aa11468 usb: gadget: add SuperSpeed support to the Gadget Framework
SuperSpeed USB has defined a new descriptor, called
the Binary Device Object Store (BOS) Descriptor. It
has also changed a bit the definition of SET_FEATURE
and GET_STATUS requests to add USB3-specific details.

This patch implements both changes to the Composite
Gadget Framework.

[ balbi@ti.com : slight changes to commit log
		 fixed a compile error on ARM ]

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-03-05 11:41:38 +02:00
Tatyana Brokhman
3ba28906ae usb: gadget: add max_speed to usb_composite_driver
This field is used by the Gadget drivers to specify
the maximum speed they support, meaning: the maximum
speed they can provide descriptors for.

The driver speed will be set in consideration of this
value.

[ balbi@ti.com : dropped the ifdeffery ]

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
[idos@codeaurora.org: added max_speed also to android.c]
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-03-05 11:41:38 +02:00
Tatyana Brokhman
081412dc44 usb: gadget: add streams support to the gadget framework
This patch defines necessary fields to support
streaming for USB3.0.

It implements a new function, called
usb_ep_autoconfig_ss(), to be used instead of the
existing usb_ep_autoconfig() when working in
SuperSpeed mode and there is a need to search for
an endpoint according to the number of required
streams.

[ balbi@ti.com : slight changes to commit log ]

Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-03-05 11:41:37 +02:00
Tatyana Brokhman
31ac352192 usb: gadget: use config_ep_by_speed() instead of ep_choose()
Remove obsolete functions:
1. ep_choose()
2. usb_find_endpoint()

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
[idos@codeaurora.org: Changed also the following files to
comply with this commit: f_accessory.c,f_adb.c,f_diag.c,f_mtp.c,
f_rmnet.c,f_rmnet_sdio,f_rmnet_smd,f_rmnet_smd_sdio,f_serial.f_ccid.c.
Also merged a patch in f_serial.c for checking return value of
config_ep_by_speed, see "usb: gadget: fix g_serial regression".
Also fix a bug in ci13xxx_udc. Since f_serial is now checking if the endpoint
descriptors are null in the set_alt function, need to set them to null on
ep_disable in case of cable disconnect. Since the ep descriptor was inserted to
struct usb_ep in "usb: gadget: add usb_endpoint_descriptor to struct usb_ep",
also set mEp->ep.desc to NULL. I have upstream this to the community, please
see "usb: gadget: Clear usb_endpoint_descriptor inside the struct usb_ep" in
the latest linux kernel.]
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-03-05 11:41:36 +02:00
Tatyana Brokhman
cf64ce4954 usb: gadget: configure endpoint according to gadget speed
Add config_ep_by_speed() to configure the endpoint
according to the gadget speed.

Using this function will spare the FDs from handling
the endpoint chosen descriptor.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-03-05 11:41:36 +02:00
Tatyana Brokhman
cf709c115c usb: gadget: add usb_endpoint_descriptor to struct usb_ep
Change usb_ep_enable() prototype to use endpoint
descriptor from usb_ep.

This optimization spares the FDs from saving the
endpoint chosen descriptor. This optimization is
not full though. To fully exploit this change, one
needs to update all the UDCs as well since in the
current implementation each of them saves the
endpoint descriptor in it's internal (and extended)
endpoint structure.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
[idos@codeaurora.org: Added more changes for the following files
since API break with msm code tree: ci13xxx_udc.c,f_accessory,f_adb,
f_diag,f_mtp,f_rmnet,f_rmnet_sdio,f_rmnet_smd, f_rmnet_smd_sdio,u_bam.c,
u_sdio.c,u_rmnet.h,u_sdio.c,u_smd.c,f_ccid.c,u_data_hsic.c]
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-03-05 11:41:35 +02:00
Felipe Balbi
5177504241 usb: gadget: introduce UDC Class
this class will be used to abstract away several of the duplicated
operations scattered among the USB gadget controller drivers.

Later, we can add an atomic notifier to tell interested drivers about
what's happening with the controller. Notifications such as suspend,
resume, enumerated, etc. will be useful, at a minimum, for implementing
usb charger detection.

As part of the converting process usb_gadget_probe_driver() is no longer
part of each udc but pushed into the ->stap() callback. The same for his
couterpart.

The core is currently set explicit to 'n'. It will be changed to 'y' once
all users are converted since it provides functions which clash with
other drivers.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-03-05 10:50:10 +02:00
Sebastian Andrzej Siewior
9bcc83f456 usb: ch9: add function defines from ch9, USB 3.0 spec
not to confuse with Table 9-7 in USB 2.0 spec

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-03-05 10:50:10 +02:00
kuninori.morimoto.gx@renesas.com
4f5db5cf5b usb: add usb_endpoint_maxp() macro
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
[idos@codeaurora.org: use __le16_to_cpu instead of le16_to_cpu]
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-03-05 10:48:43 +02:00
Manu Gautam
91223e07a7 USB: EHCI: msm: Add support for EHCI based Host Controller
This patch adds support for EHCI compliant USB Host Controller
for Liquid on 8064.
This driver supports Host only mode and is different from ehci-msm
which relies on OTG driver for putting hardware in low pwer mode
and PHY initialization as well.

Change-Id: I84b63b2577311900a0b434f53df547bad62f6316
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2012-02-26 09:11:19 -08:00
Manu Gautam
cd82e9d62a msm: 8960: usb: Add msm_bus vote when cable is connected
Drivers need to specify their bandwidth requirements to
bus-scaling driver to get guaranteed bandwidth on fabrics.

USB hardware uses a single buffer to transfer data across the
bus. As a result USB performance is highly dependent on system
fabric frequency as USB controller continuously sends NAKs on
the USB BUS unless complete buffer is filled/drained to the memory.
Hence, request for high bus bandwidth as long as USB cable is
connected to improve USB throughput.

While testing with Class-10 Extreme III SD cards, this patch
seems to improve the IN performance from 15MBps to 24MBps and
OUT performance from 11MBps to 16MBps.

CRs-Fixed: 327557
Change-Id: I21c284c611a09b1b12df9ae7a6f39e0b1bff45ef
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
2012-02-09 12:20:12 +05:30
David Brown
ac5d15452f Revert: d702207826
Accidentally merged without proper testing.

Change-Id: Iea6c3f7cd383357ac657fd15fde08cbab86bf809
Signed-off-by: David Brown <davidb@codeaurora.org>
2012-02-06 10:37:22 -08:00
David Brown
d702207826 Merge remote-tracking branch 'idos/usb3-msm-3.0-backport-dwc3' into merge/idos
Merge a backport of the following 82 commits from the 3.2 kernel.

commit 6668ab6822
Author: Yu Xu <yuxu@marvell.com>
Date:   Sat Dec 10 00:03:33 2011 +0800

    usb: gadget: storage: release superspeed descriptors.

    Release superspeed mass storage descriptors memory
    when the function is unbind.

    Signed-off-by: Yu Xu <yuxu@marvell.com>
    Acked-by: Michal Nazarewicz <mina86@mina86.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/f_mass_storage.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

commit 7d4b554346
Author: Felipe Balbi <balbi@ti.com>
Date:   Mon Oct 3 16:39:30 2011 +0300

    usb: gadget: core: fix bug when removing gadget drivers

    usb_gadget_disconnect() is responsible of removing
    data pullups. Before doing that we must, first, tell
    gadget driver we're disconnecting (by calling disconnect
    method on gadget driver structure), unbind the gadget
    driver and stop the controller.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/udc-core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

commit 6a9a34559d
Author: Felipe Balbi <balbi@ti.com>
Date:   Wed Aug 3 13:33:27 2011 +0200

    usb: gadget: storage: add superspeed support

    this patch adds superspeed descriptors for the
    storage gadgets.

    Acked-by: Michal Nazarewicz <mina86@mina86.com>
    Acked-by: Alan Stern <stern@rowland.harvard.edu>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    [idos@codeaurora.org: Conflicts: drivers/usb/gadget/storage_common.c]
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/f_mass_storage.c |   22 ++++++
 drivers/usb/gadget/file_storage.c   |   59 +++++++++++++---
 drivers/usb/gadget/mass_storage.c   |    2 +-
 drivers/usb/gadget/storage_common.c |  127 +++++++++++++++++++++++++++++++++++
 4 files changed, 199 insertions(+), 11 deletions(-)

commit 9e42b8b008
Author: Felipe Balbi <balbi@ti.com>
Date:   Mon Oct 10 09:43:44 2011 +0300

    usb: gadget: fix typo for default U1/U2 exit latencies

    s/DEFULT/DEFAULT/, no functional changes.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/composite.c |    4 ++--
 include/linux/usb/gadget.h     |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

commit 8d9e8ba25f
Author: Paul Zimmerman <Paul.Zimmerman@synopsys.com>
Date:   Fri Sep 30 15:26:06 2011 -0700

    usb: gadget: storage: fix mass storage gadgets to work with Synopsys UDC

    The Synopsys USB device controller requires all OUT transfer request
    lengths to be aligned to max packet size. The mass storage gadgets do
    not meet this requirement for Super Speed. The gadgets already have a
    function which performs this alignment for CBW packets, so use it for
    data packets too.

    The alternative would be to implement bounce buffers in the DWC3
    driver, but that could have a significant impact on performance.

    This version is based upon a more-correct patch written by Alan
    Stern.

    Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/f_mass_storage.c |   18 +++++++++---------
 drivers/usb/gadget/file_storage.c   |   18 +++++++++---------
 2 files changed, 18 insertions(+), 18 deletions(-)

commit 9967085375
Author: Alan Stern <stern@rowland.harvard.edu>
Date:   Thu Aug 18 20:29:00 2011 +0200

    USB: gadget: storage: remove alignment assumption

    This patch (as1481) fixes a problem affecting g_file_storage and
    g_mass_storage when running at SuperSpeed.  The two drivers currently
    assume that the bulk-out maxpacket size can evenly divide the SCSI
    block size, which is 512 bytes.  But SuperSpeed bulk endpoints have a
    maxpacket size of 1024, so the assumption is no longer true.

    This patch removes that assumption from the drivers, by getting rid of
    a small optimization (they try to align VFS reads and writes on page
    cache boundaries).  If a command's starting logical block address is
    512 bytes below the end of a page, it's not okay to issue a USB
    command for just those 512 bytes when the maxpacket size is 1024 -- it
    would result in either babble (for an OUT transfer) or a short packet
    (for an IN transfer).

    Also, for backward compatibility, the test for writes extending beyond
    the end of the backing storage has to be changed.  If the host tries
    to do this, we should accept the data that fits in the backing storage
    and ignore the rest.  Because the storage's end may not align with a
    USB packet boundary, this means we may have to accept a USB OUT
    transfer that extends beyond the end of the storage and then write out
    only the part of the data that fits.

    Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
    Acked-by: Michal Nazarewicz <mina86@mina86.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    [idos@codeaurora.org: Conflicts: drivers/usb/gadget/f_mass_storage.c
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/f_mass_storage.c |   64 ++++++++++++---------------------
 drivers/usb/gadget/file_storage.c   |   67 ++++++++++++++---------------------
 2 files changed, 50 insertions(+), 81 deletions(-)

commit 70847f6eed
Author: Peiyu Li <peiyu.li@csr.com>
Date:   Wed Aug 17 22:52:59 2011 -0700

    usb: gadget: storage: adapt logic block size to bound block devices

    Now the mass storage driver has fixed logic block size of 512 bytes.

    The mass storage gadget read/write bound devices only through VFS, so the
    bottom level devices actually are just RAW devices to the driver and connected
    PC. As a RAW, hosts can always format, read and write it right in 512 bytes
    logic block and don't care about the actual logic block size of devices bound
    to the gadget.

    But if we want to share the bound block device partition between target board
    and PC, in case the logic block size of the bound block device is 4KB, we
    execute the following steps:

    1. connect a board with mass storage gadget to PC(the board has set one
    	partition of on-board block device as file name of the mass storage)
    2. PC format the mass storage to VFAT by default logic block size and
    	read/write it
    3. disconnect boards from PC
    4. target board mount the partition as VFAT

    Step 4 will fail since kernel on target thinks the logic block size of the
    bound partition as 4KB.
    A typical error is "FAT: logical sector size too small for device (logical
    sector size = 512)"

    If we execute opposite steps:
    1. format the partition to VFAT on target board and read/write this partition
    2. connect the board to Windows PC as usb mass storage gadget, windows will
    	think the disk is not formatted

    So the conclusion is that only as a gadget, the mass storage driver has no any
    problem.  But being shared VFAT or other filesystem on PC and target board, it
    will fail.

    This patch adapts logic block size to bound block devices and fix the issue.

    Cc: Michal Nazarewicz <mina86@mina86.com>
    Acked-by: Alan Stern <stern@rowland.harvard.edu>
    Signed-off-by: Peiyu Li <peiyu.li@csr.com>
    Signed-off-by: Xianglong Du <xianglong.du@csr.com>
    Signed-off-by: Huayi Li <huayi.li@csr.com>
    Signed-off-by: Barry Song <Baohua.Song@csr.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/f_mass_storage.c |   63 ++++++++++++++++++++--------------
 drivers/usb/gadget/file_storage.c   |   50 +++++++++++++--------------
 drivers/usb/gadget/storage_common.c |   23 ++++++++++---
 3 files changed, 79 insertions(+), 57 deletions(-)

commit a713c15157
Author: Felipe Balbi <balbi@ti.com>
Date:   Mon Dec 19 13:45:01 2011 +0200

    usb: gadget: epautoconf: do not change number of streams

    We should not change gadget driver's descriptors just
    because we think it's right to do so.

    There are several of reasons which would support this
    statement but it suffices to say that this was probably
    never tested because it updates bmAttributes without
    asking the driver if it's ok to do so.

    This means that e.g. on UASP gadget it would enable
    stream support even for the command endpoint which must
    not have stream support enabled.

    In fact, this change is fixing the bug introduced by
    commit a59d6b9 (usb: gadget: add streams support to
    the gadget framework) which was caught when testing
    UASP gadget with dwc3 driver.

    Cc: Tatyana Brokhman <tlinder@codeaurora.org>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/epautoconf.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

commit 61a3b903ab
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Thu Jun 23 14:26:15 2011 +0200

    usb: gadget: udc-core: add "new-style" registration interface

    udc_start() should only trigger the internal state machine and make
    minimal house keeping. Before that call udc-core calls the bind()
    callback and after the callback the pullup().

    udc_stop() is simillar, udc-core calls pullup(), unbind() and finally
    udc_stop().

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/udc-core.c |   75 ++++++++++++++++++++++++++++++++++++++--
 include/linux/usb/gadget.h    |    6 +++
 2 files changed, 77 insertions(+), 4 deletions(-)

commit 908f577884
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Thu Jun 23 14:26:11 2011 +0200

    usb: gadget: defer setting maxpacket till ->setup()

    maxpacket is set by the udc driver for ep0 very early. This value is
    copied by the function gadget used later for the USB_DT_DEVICE and
    USB_DT_DEVICE_QUALIFIER query. This seems to work fine so far. For USB3
    we need set a different value here. In SS speed it is 2^x with x=9 and
    in HS we set something <= 64. If the UDC starts in SS and continues in
    HS after the cable has been plugged it will report a too small value.
    There setting of this value is defered and taken automaticly from the
    ep0 pointer where the UDC driver can update it according to the speed it
    detected _after_ a cable has been plugged.

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/composite.c    |    3 +--
 drivers/usb/gadget/dbgp.c         |    2 +-
 drivers/usb/gadget/file_storage.c |   10 ++++++----
 drivers/usb/gadget/gmidi.c        |    3 +--
 drivers/usb/gadget/inode.c        |    5 ++---
 drivers/usb/gadget/printer.c      |   14 +++++++++-----
 6 files changed, 20 insertions(+), 17 deletions(-)

commit 355527ba15
Author: Tatyana Brokhman <tlinder@codeaurora.org>
Date:   Wed Jun 29 16:41:50 2011 +0300

    usb: gadget: add SuperSpeed support to the Gadget Framework

    SuperSpeed USB has defined a new descriptor, called
    the Binary Device Object Store (BOS) Descriptor. It
    has also changed a bit the definition of SET_FEATURE
    and GET_STATUS requests to add USB3-specific details.

    This patch implements both changes to the Composite
    Gadget Framework.

    [ balbi@ti.com : slight changes to commit log
    		 fixed a compile error on ARM ]

    Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/Kconfig      |    6 +
 drivers/usb/gadget/composite.c  |  257 ++++++++++++++++++++++++++++++++++++---
 drivers/usb/gadget/epautoconf.c |    6 +-
 include/linux/usb/composite.h   |   14 ++
 include/linux/usb/gadget.h      |   31 +++++
 5 files changed, 293 insertions(+), 21 deletions(-)

commit fd11902012
Author: Tatyana Brokhman <tlinder@codeaurora.org>
Date:   Wed Jun 29 16:41:49 2011 +0300

    usb: gadget: add max_speed to usb_composite_driver

    This field is used by the Gadget drivers to specify
    the maximum speed they support, meaning: the maximum
    speed they can provide descriptors for.

    The driver speed will be set in consideration of this
    value.

    [ balbi@ti.com : dropped the ifdeffery ]

    Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/audio.c        |    1 +
 drivers/usb/gadget/cdc2.c         |    1 +
 drivers/usb/gadget/composite.c    |    2 ++
 drivers/usb/gadget/ether.c        |    1 +
 drivers/usb/gadget/g_ffs.c        |    1 +
 drivers/usb/gadget/hid.c          |    1 +
 drivers/usb/gadget/mass_storage.c |    1 +
 drivers/usb/gadget/multi.c        |    1 +
 drivers/usb/gadget/ncm.c          |    1 +
 drivers/usb/gadget/nokia.c        |    1 +
 drivers/usb/gadget/serial.c       |    1 +
 drivers/usb/gadget/webcam.c       |    1 +
 drivers/usb/gadget/zero.c         |    1 +
 include/linux/usb/composite.h     |    2 ++
 14 files changed, 16 insertions(+), 0 deletions(-)

commit 24728e0ee2
Author: Tatyana Brokhman <tlinder@codeaurora.org>
Date:   Tue Jun 28 16:33:53 2011 +0300

    usb: gadget: add streams support to the gadget framework

    This patch defines necessary fields to support
    streaming for USB3.0.

    It implements a new function, called
    usb_ep_autoconfig_ss(), to be used instead of the
    existing usb_ep_autoconfig() when working in
    SuperSpeed mode and there is a need to search for
    an endpoint according to the number of required
    streams.

    [ balbi@ti.com : slight changes to commit log ]

    Signed-off-by: Maya Erez <merez@codeaurora.org>
    Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/epautoconf.c |  125 +++++++++++++++++++++++++++++++--------
 include/linux/usb/gadget.h      |   13 ++++
 2 files changed, 113 insertions(+), 25 deletions(-)

commit 9781f7d1c6
Author: Tatyana Brokhman <tlinder@codeaurora.org>
Date:   Tue Jun 28 16:33:52 2011 +0300

    usb: gadget: coding style fix

    fix the coding style of a few switches on the
    gadget framework.

    [ balbi@ti.com : add a commit log ]

    Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/composite.c |   16 ++++++++++---
 drivers/usb/gadget/dummy_hcd.c |   48 ++++++++++++++++++++++++++++++----------
 2 files changed, 48 insertions(+), 16 deletions(-)

commit ebd3f395ba
Author: Tatyana Brokhman <tlinder@codeaurora.org>
Date:   Tue Jun 28 16:33:50 2011 +0300

    usb: gadget: use config_ep_by_speed() instead of ep_choose()

    Remove obsolete functions:
    1. ep_choose()
    2. usb_find_endpoint()

    Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    [idos@codeaurora.org: Changed also the following files to
    comply with this commit: f_accessory.c,f_adb.c,f_diag.c,f_mtp.c,
    f_rmnet.c,f_rmnet_sdio,f_rmnet_smd,f_rmnet_smd_sdio,f_serial.f_ccid.c.
    Also merged a patch in f_serial.c for correct checking of the return value
    of config_ep_by_speed. See "usb: gadget: fix g_serial regression".
    Also fix a bug in ci13xxx_udc. Since f_serial is now checking if the endpoint
    descriptors are null in the set_alt function, need to set them to null on
    ep_disable in case of cable disconnect. Since the ep descriptor was inserted
    to struct usb_ep in "usb: gadget: add usb_endpoint_descriptor to struct usb_ep"
    then simply convert the ci13xxx_udc to work with mEp->ep.desc instead of
    mEp->desc, this will ensure that the correct descriptor will be cleared
    on endpoint disable.
    I will upstream it to Linux community soon, I will name it:
    "usb: gadget: use usb ep descriptor of struct usb_ep instead of wrapper desc"]
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/ci13xxx_udc.c      |   16 ++++----
 drivers/usb/gadget/ci13xxx_udc.h      |    1 -
 drivers/usb/gadget/config.c           |   26 -------------
 drivers/usb/gadget/f_accessory.c      |   30 +++++++++++-----
 drivers/usb/gadget/f_acm.c            |   46 +++++++-----------------
 drivers/usb/gadget/f_adb.c            |   30 +++++++++++----
 drivers/usb/gadget/f_ccid.c           |   54 +++++++++++-----------------
 drivers/usb/gadget/f_diag.c           |   13 ++++---
 drivers/usb/gadget/f_ecm.c            |   45 +++++++----------------
 drivers/usb/gadget/f_eem.c            |   32 +++++------------
 drivers/usb/gadget/f_hid.c            |   19 +++-------
 drivers/usb/gadget/f_loopback.c       |   11 ++++--
 drivers/usb/gadget/f_mass_storage.c   |   46 ++++++++++--------------
 drivers/usb/gadget/f_mtp.c            |   30 +++++++++++----
 drivers/usb/gadget/f_ncm.c            |   49 ++++++++------------------
 drivers/usb/gadget/f_obex.c           |   32 +++++------------
 drivers/usb/gadget/f_phonet.c         |   12 +++---
 drivers/usb/gadget/f_rmnet.c          |   48 ++++++++-----------------
 drivers/usb/gadget/f_rmnet_sdio.c     |   62 ++++++++++++++++++++++++++------
 drivers/usb/gadget/f_rmnet_smd.c      |   38 +++++++++++++++-----
 drivers/usb/gadget/f_rmnet_smd_sdio.c |   63 ++++++++++++++++++++++++++------
 drivers/usb/gadget/f_rndis.c          |   46 +++++++-----------------
 drivers/usb/gadget/f_serial.c         |   55 +++++++++-------------------
 drivers/usb/gadget/f_sourcesink.c     |    8 +++-
 drivers/usb/gadget/f_subset.c         |   29 +++------------
 drivers/usb/gadget/file_storage.c     |   12 ++++++
 drivers/usb/gadget/storage_common.c   |   11 ------
 include/linux/usb/composite.h         |   15 --------
 include/linux/usb/gadget.h            |    6 ---
 29 files changed, 400 insertions(+), 485 deletions(-)

commit e2a9f931cc
Author: Tatyana Brokhman <tlinder@codeaurora.org>
Date:   Tue Jun 28 16:33:49 2011 +0300

    usb: gadget: configure endpoint according to gadget speed

    Add config_ep_by_speed() to configure the endpoint
    according to the gadget speed.

    Using this function will spare the FDs from handling
    the endpoint chosen descriptor.

    Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/composite.c  |   85 +++++++++++++++++++++++++++++++++++++++
 drivers/usb/gadget/epautoconf.c |    1 +
 include/linux/usb/composite.h   |    3 +
 include/linux/usb/gadget.h      |    3 +
 4 files changed, 92 insertions(+), 0 deletions(-)

commit 9168a350f7
Author: Tatyana Brokhman <tlinder@codeaurora.org>
Date:   Tue Jun 28 16:33:48 2011 +0300

    usb: gadget: add usb_endpoint_descriptor to struct usb_ep

    Change usb_ep_enable() prototype to use endpoint
    descriptor from usb_ep.

    This optimization spares the FDs from saving the
    endpoint chosen descriptor. This optimization is
    not full though. To fully exploit this change, one
    needs to update all the UDCs as well since in the
    current implementation each of them saves the
    endpoint descriptor in it's internal (and extended)
    endpoint structure.

    Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    [idos@codeaurora.org: Added more changes for the following files
    since API break with msm code tree: ci13xxx_udc.c,f_accessory,f_adb,
    f_diag,f_mtp,f_rmnet,f_rmnet_sdio,f_rmnet_smd, f_rmnet_smd_sdio,u_bam.c,
    u_sdio.c,u_rmnet.h,u_sdio.c,u_smd.c,f_ccid.c,u_data_hsic.c]
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/ci13xxx_udc.c      |    6 ++++--
 drivers/usb/gadget/dbgp.c             |    8 +++++---
 drivers/usb/gadget/f_accessory.c      |   16 ++++++++++------
 drivers/usb/gadget/f_acm.c            |    9 ++++-----
 drivers/usb/gadget/f_adb.c            |   14 ++++++++------
 drivers/usb/gadget/f_audio.c          |    5 ++---
 drivers/usb/gadget/f_ccid.c           |   15 ++++++---------
 drivers/usb/gadget/f_diag.c           |   12 +++++-------
 drivers/usb/gadget/f_ecm.c            |   17 ++++++++---------
 drivers/usb/gadget/f_eem.c            |   10 +++++-----
 drivers/usb/gadget/f_fs.c             |    3 ++-
 drivers/usb/gadget/f_hid.c            |    5 ++---
 drivers/usb/gadget/f_loopback.c       |   14 ++++++--------
 drivers/usb/gadget/f_mass_storage.c   |    3 ++-
 drivers/usb/gadget/f_mtp.c            |   17 ++++++++++-------
 drivers/usb/gadget/f_ncm.c            |   17 ++++++++---------
 drivers/usb/gadget/f_obex.c           |    6 +++---
 drivers/usb/gadget/f_phonet.c         |    9 ++++-----
 drivers/usb/gadget/f_rmnet.c          |    9 ++++-----
 drivers/usb/gadget/f_rmnet_sdio.c     |   15 +++++++++------
 drivers/usb/gadget/f_rmnet_smd.c      |   15 +++++++++------
 drivers/usb/gadget/f_rmnet_smd_sdio.c |   15 +++++++++------
 drivers/usb/gadget/f_rndis.c          |   15 +++++++--------
 drivers/usb/gadget/f_serial.c         |    9 ++++-----
 drivers/usb/gadget/f_sourcesink.c     |   10 ++++------
 drivers/usb/gadget/f_subset.c         |    8 ++++----
 drivers/usb/gadget/f_uvc.c            |    6 ++++--
 drivers/usb/gadget/file_storage.c     |    3 ++-
 drivers/usb/gadget/gmidi.c            |    6 ++++--
 drivers/usb/gadget/inode.c            |    6 ++++--
 drivers/usb/gadget/printer.c          |   26 ++++++++++++++------------
 drivers/usb/gadget/u_bam.c            |    8 ++++----
 drivers/usb/gadget/u_data_hsic.c      |   10 ++--------
 drivers/usb/gadget/u_ether.c          |   12 ++++++------
 drivers/usb/gadget/u_ether.h          |    4 ----
 drivers/usb/gadget/u_rmnet.h          |    2 --
 drivers/usb/gadget/u_sdio.c           |    4 ++--
 drivers/usb/gadget/u_serial.c         |    4 ++--
 drivers/usb/gadget/u_serial.h         |    2 --
 drivers/usb/gadget/u_smd.c            |    4 ++--
 include/linux/usb/gadget.h            |   16 +++++++---------
 41 files changed, 197 insertions(+), 198 deletions(-)

commit 2baadcf481
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Tue Jun 28 16:33:47 2011 +0300

    usb: gadget: convert all users to the new udc infrastructure

    peripheral drivers are using usb_add_gadget()/usb_del_gadget() to
    register/unregister to the udc-core.

    The udc-core will take the first available gadget driver and attach
    function driver which is calling usb_gadget_register_driver(). This is
    the same behaviour we have right now.

    Only dummy_hcd was tested, the others were compiled tested.

    Cc: Alan Stern <stern@rowland.harvard.edu>
    Cc: Anton Tikhomirov <av.tikhomirov@samsung.com>
    Cc: Ben Dooks <ben-linux@fluff.org>
    Cc: Dan Carpenter <error27@gmail.com>
    Cc: Darius Augulis <augulis.darius@gmail.com>
    Cc: Eric Miao <eric.y.miao@gmail.com>
    Cc: Jingoo Han <jg1.han@samsung.com>
    Cc: Kukjin Kim <kgene.kim@samsung.com>
    Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
    Cc: Li Yang <leoli@freescale.com>
    Cc: Michael Hennerich <michael.hennerich@analog.com>
    Acked-by: Mike Frysinger <vapier@gentoo.org>
    Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
    Cc: Pavankumar Kondeti <pkondeti@codeaurora.org>
    Cc: Roy Huang <roy.huang@analog.com>
    Cc: Russell King <linux@arm.linux.org.uk>
    Cc: Toshiharu Okada <toshiharu-linux@dsn.okisemi.com>
    Cc: Xiaochen Shen <xiaochen.shen@intel.com>
    Cc: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
    Cc: Yuan-Hsin Chen <yhchen@faraday-tech.com>
    Cc: cxie4 <cxie4@marvell.com>
    Cc: linux-geode@lists.infradead.org
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    [idos@codeaurora.org:
    Conflicts: drivers/usb/gadget/ci13xxx_udc.c
    msm72k_udc.c: This driver is not exists in Linux community,so fix this one too.
    cyasgadget.c: combine other patch from the community ("convert cyasgadget to new udc core")
    into this commit. Removed the #if 0 block that was in the community version and fix
    the cause problem, because of which it was under #if 0 block]
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 .../staging/westbridge/astoria/gadget/cyasgadget.c |   26 ++++++++++++++--
 drivers/usb/gadget/Makefile                        |    1 +
 drivers/usb/gadget/amd5536udc.c                    |   18 ++++++++---
 drivers/usb/gadget/at91_udc.c                      |   20 +++++++++---
 drivers/usb/gadget/atmel_usba_udc.c                |   26 ++++++++++++++--
 drivers/usb/gadget/ci13xxx_udc.c                   |   30 ++++++++++++++-----
 drivers/usb/gadget/dummy_hcd.c                     |   31 +++++++++++++------
 drivers/usb/gadget/fsl_qe_udc.c                    |   20 ++++++++++--
 drivers/usb/gadget/fsl_udc_core.c                  |   20 ++++++++++--
 drivers/usb/gadget/fusb300_udc.c                   |   15 +++++++--
 drivers/usb/gadget/goku_udc.c                      |   19 +++++++++---
 drivers/usb/gadget/imx_udc.c                       |   20 +++++++++---
 drivers/usb/gadget/langwell_udc.c                  |   20 ++++++++----
 drivers/usb/gadget/m66592-udc.c                    |   17 ++++++++--
 drivers/usb/gadget/msm72k_udc.c                    |   22 +++++++++++---
 drivers/usb/gadget/mv_udc_core.c                   |   19 +++++++----
 drivers/usb/gadget/net2280.c                       |   18 ++++++++---
 drivers/usb/gadget/omap_udc.c                      |   22 +++++++++++---
 drivers/usb/gadget/pch_udc.c                       |   16 +++++++--
 drivers/usb/gadget/pxa25x_udc.c                    |   19 ++++++++----
 drivers/usb/gadget/pxa27x_udc.c                    |   23 ++++++++++----
 drivers/usb/gadget/r8a66597-udc.c                  |   15 +++++++--
 drivers/usb/gadget/s3c-hsotg.c                     |   19 +++++++++--
 drivers/usb/gadget/s3c-hsudc.c                     |   16 +++++++--
 drivers/usb/gadget/s3c2410_udc.c                   |   29 +++++++++++-------
 drivers/usb/musb/musb_gadget.c                     |   23 +++++++++++---
 drivers/usb/renesas_usbhs/mod_gadget.c             |   20 +++++++++---
 27 files changed, 403 insertions(+), 141 deletions(-)

commit b657342882
Author: Felipe Balbi <balbi@ti.com>
Date:   Tue Jun 28 16:33:46 2011 +0300

    usb: gadget: introduce UDC Class

    this class will be used to abstract away several of the duplicated
    operations scattered among the USB gadget controller drivers.

    Later, we can add an atomic notifier to tell interested drivers about
    what's happening with the controller. Notifications such as suspend,
    resume, enumerated, etc. will be useful, at a minimum, for implementing
    usb charger detection.

    As part of the converting process usb_gadget_probe_driver() is no longer
    part of each udc but pushed into the ->stap() callback. The same for his
    couterpart.

    The core is currently set explicit to 'n'. It will be changed to 'y' once
    all users are converted since it provides functions which clash with
    other drivers.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Acked-by: Michal Nazarewicz <mina86@mina86.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/udc-core.c |  418 +++++++++++++++++++++++++++++++++++++++++
 include/linux/usb/gadget.h    |    7 +
 2 files changed, 425 insertions(+), 0 deletions(-)

commit 1e4eabf4be
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Fri Aug 19 18:10:56 2011 +0300

    usb: ch9: add function defines from ch9, USB 3.0 spec

    not to confuse with Table 9-7 in USB 2.0 spec

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 include/linux/usb/ch9.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

commit 62118889b5
Author: Paul Gortmaker <paul.gortmaker@windriver.com>
Date:   Fri Sep 30 18:08:59 2011 -0400

    usb: Add module.h to various dwc3 drivers

    These files uses the full set of MODULE_ macros and so need to
    include module.h directly.

    Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.c      |    1 +
 drivers/usb/dwc3/dwc3-omap.c |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

commit 4d873c3377
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Sep 30 10:58:51 2011 +0300

    usb: dwc3: convert structures into bitshifts

    our parameter structures need to be written to
    HW, so instead of assuming little endian, we
    convert those into bit shifts.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c    |    6 +-
 drivers/usb/dwc3/gadget.c |   40 ++++++-------
 drivers/usb/dwc3/gadget.h |  139 +++++++++------------------------------------
 3 files changed, 48 insertions(+), 137 deletions(-)

commit cfca7a78c5
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Sep 30 10:58:50 2011 +0300

    usb: dwc3: gadget: allow clock gating to work

    The dwc3 core has internal clock gating support.

    Let's allow that to happen by clearing the disable
    bit in GCTL register.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h   |    6 ++++++
 drivers/usb/dwc3/gadget.c |    8 ++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

commit 6c08fb7a1b
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Sep 30 10:58:49 2011 +0300

    usb: dwc3: core: cache GHWPARAMS* registers

    cache the contents of GHWPARAMS* registers in
    our device structure for easy access.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

commit 7f7f14f9e9
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Sep 30 10:58:48 2011 +0300

    usb: dwc3: add struct dwc3_hwparams

    That structure will hold a copy of readonly
    GHWPARAMS* registers for ease accessing by
    the driver.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

commit 3269cbcf0b
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Sep 30 10:58:47 2011 +0300

    usb: dwc3: gadget: implement streams support

    The following patch adds support for streams
    to dwc3 driver.

    While at that, also fix one small issue on
    endpoint disable where we should clear all
    flags not only ENABLED.

    Reviewied-by: Paul Zimmerman <paulz@synopsys.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 Documentation/usb/dwc3.txt |    8 --------
 drivers/usb/dwc3/core.h    |    6 ++++++
 drivers/usb/dwc3/gadget.c  |   34 ++++++++++++++++++++++++++++++----
 3 files changed, 36 insertions(+), 12 deletions(-)

commit 39234823ff
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Sep 30 10:58:46 2011 +0300

    usb: dwc3: gadget: add support for Bursts

    We already have the value from gadget drivers,
    just need to pass it to our controller.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    [idos@codeaurora.org: Integrate in this commit also the change
    "USB: use usb_endpoint_maxp() instead of le16_to_cpu()" 29cc88979a8818cd8c5019426e945aed118b400e
    from Linux kernel 3.1. The reason why this change was not
    cherry-picked separately is because I wanted to reduce impact
    on msm code tree, and only change dwc3 driver.]
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

commit 24a340bc5f
Author: kuninori.morimoto.gx@renesas.com <kuninori.morimoto.gx@renesas.com>
Date:   Mon Jul 25 00:39:30 2011 -0700

    usb: add usb_endpoint_maxp() macro

    Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    [idos@codeaurora.org: use __le16_to_cpu instead of le16_to_cpu]
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 include/linux/usb/ch9.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

commit a8c7e2c40c
Author: Paul Zimmerman <Paul.Zimmerman@synopsys.com>
Date:   Fri Sep 30 10:58:45 2011 +0300

    usb: dwc3: gadget: fix DMA offset calculation

    Fix offset calculation in dwc3_trb_dma_offset()

    Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit b669953027
Author: Paul Zimmerman <Paul.Zimmerman@synopsys.com>
Date:   Fri Sep 30 10:58:44 2011 +0300

    usb: dwc3: gadget: make DWC3_EP_WEDGE do the right thing

    This makes DWC3_EP_WEDGE do the right thing, which is
    prevent DWC3_EP_WEDGE from ever being cleared by a
    ClearFeature(HALT) command.

    [ balbi@ti.com : allowed set_wedge to send SetHalt command
    	to controller ]

    Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

commit 0b16af6942
Author: Paul Zimmerman <Paul.Zimmerman@synopsys.com>
Date:   Fri Sep 30 10:58:43 2011 +0300

    usb: dwc3: gadget: driver should not wait for RxFIFO to drain

    An older version of the databook said to wait for the FIFO to
    drain, but that has been removed from the newer databooks.

    Waiting for RxFIFO to drain caused problems when testing against
    one of the host controllers available in the market.

    After talking to one of the RTL engineers, he stated that we
    should _not_ wait for RxFIFO to drain.

    Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |   19 -------------------
 1 files changed, 0 insertions(+), 19 deletions(-)

commit 074a58e218
Author: Paul Zimmerman <Paul.Zimmerman@synopsys.com>
Date:   Fri Sep 30 10:58:42 2011 +0300

    usb: dwc3: gadget: fix DEPSTARTCFG for non-EP0 EPs

    DEPSTARTCFG for non-EP0 EPs must only be sent once per config

    [ balbi@ti.com : changed config_start to start_config_issued ]

    Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h   |    2 ++
 drivers/usb/dwc3/ep0.c    |    1 +
 drivers/usb/dwc3/gadget.c |   10 +++++++++-
 3 files changed, 12 insertions(+), 1 deletions(-)

commit 6a5d97b4f6
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Fri Sep 30 10:58:41 2011 +0300

    usb: dwc: remove "All rights reserved" statement.

    Some people think that this line is not compatible with the GPL. The
    statement was required due to the Buenos Aires Convention and is now
    deprecated. I remove it because it is said that it is pointless nowdays.

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.c      |    1 -
 drivers/usb/dwc3/core.h      |    1 -
 drivers/usb/dwc3/debug.h     |    1 -
 drivers/usb/dwc3/debugfs.c   |    1 -
 drivers/usb/dwc3/dwc3-omap.c |    1 -
 drivers/usb/dwc3/dwc3-pci.c  |    1 -
 drivers/usb/dwc3/ep0.c       |    1 -
 drivers/usb/dwc3/gadget.c    |    1 -
 drivers/usb/dwc3/gadget.h    |    1 -
 drivers/usb/dwc3/io.h        |    1 -
 10 files changed, 0 insertions(+), 10 deletions(-)

commit 4537314ce3
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Fri Sep 30 10:58:40 2011 +0300

    usb: dwc3: ep0: fix debug output

    Use "ep0in" and "ep0out" instead "ep1in" and "ep0out" which is confusing
    and not consistent with the remaining output.

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit 3332e3a08f
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Fri Sep 30 10:58:39 2011 +0300

    usb: dwc3: ep0: remove second giveback in error case

    We already give requests back in dwc3_ep0_stall_and_restart() so
    doing it again here will most likely corrupt the list.

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

commit ab432aaf9f
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Sep 30 10:58:38 2011 +0300

    usb: dwc3: ep0: fix debug message

    The way it was before was really meaningless.
    Now it looks saner.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

commit 62f700c076
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Sep 30 10:58:37 2011 +0300

    usb: dwc3: ep0: ignore direction on 2-stage transfer

    We don't need to care about direction on a two stage
    transfer.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

commit 7492d143df
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Sep 30 10:58:36 2011 +0300

    usb: dwc3: ep0: Make USB30CV happy with SetAddress

    According to USB 3.0 Specification, a SetAddress()
    while device is in Configured State has an unspecified
    behavior (see Section 9.4.6). Still USB30CV wasn't
    happy with my Stall reply.

    To make that thing happy, just accept the SetAddress()
    always. No problems have been observed thus far.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c |   31 +++++++++----------------------
 1 files changed, 9 insertions(+), 22 deletions(-)

commit 72679f287e
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 8 21:18:47 2011 +0300

    usb: dwc3: gadget: improve debug on link state change

    It's useful to know which states core is going
    through, as it might help us figure out misbehavior
    on specific link states.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

commit 9aa078136c
Author: Felipe Balbi <balbi@ti.com>
Date:   Tue Sep 6 10:56:51 2011 +0300

    usb: dwc3: omap: set idle and standby modes

    For now, let's disable IDLE and STANDBY transitions
    until we have a real HW to validate against.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/dwc3-omap.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

commit 0883c82126
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 8 18:27:33 2011 +0300

    usb: dwc3: ep0: introduce ep0_expect_in flag

    This flag will tell us which direction we're
    expecting on the next (data or status) phase.

    It will help us catching errors of host going
    crazy and requesting data of the wrong direction.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h |    2 ++
 drivers/usb/dwc3/ep0.c  |   16 ++++++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

commit 685f979948
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 8 18:17:12 2011 +0300

    usb: dwc3: ep0: giveback requests on stall_and_restart

    if we don't, the list will be busy forever.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

commit 8f28d64194
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 8 18:16:21 2011 +0300

    usb: dwc3: gadget: drop the useless dma_sync_single* calls

    if req->dma isn't DMA_ADDR_INVALID it means gadget driver
    mapped the request or allocated from coherent, so it's
    unnecessary to do anything.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

commit 5aa8e6c20c
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 8 17:42:11 2011 +0300

    usb: dwc3: gadget: fix GCTL programming

    ensure a few bits are cleared before enabling
    what we need.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

commit cb4884ccc0
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 8 17:41:00 2011 +0300

    usb: dwc3: define ScaleDown macro helper

    We must ensure that those bits aren't set as
    they should only be used in simulation.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

commit 680df4e4b4
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 8 17:39:59 2011 +0300

    usb: dwc3: Fix definition of DWC3_GCTL_U2RSTECN

    that should be 1 << 16, not 16. Caused so many
    problems and we never caught it before.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit 6c317eb0b0
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Wed Aug 31 17:12:02 2011 +0200

    usb: dwc3: gadget: do not map/unmap ZLP transfers

    If the gadget drivers sends a ZLP we are trying to map this this request
    which does not work on all implementations. So we simply skip mapping
    it.

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

commit 0490e89899
Author: Felipe Balbi <balbi@ti.com>
Date:   Tue Sep 6 12:00:39 2011 +0300

    usb: dwc3: omap: fix IRQ handling

    In order to ACK the IRQ we must write back
    to the same register the bits we read.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/dwc3-omap.c |   39 ++++++++++++---------------------------
 1 files changed, 12 insertions(+), 27 deletions(-)

commit a29eace3f8
Author: Felipe Balbi <balbi@ti.com>
Date:   Tue Sep 6 10:57:41 2011 +0300

    usb: dwc3: omap: change IRQ name to dwc3-omap

    dwc3-wrapper can be used by any other wrapper,
    using dwc3-omap makes it clear that we're running
    on OMAP SoC.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/dwc3-omap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit eac0a18738
Author: Felipe Balbi <balbi@ti.com>
Date:   Mon Sep 5 13:37:28 2011 +0300

    usb: dwc3: add module.h to dwc3-omap.c and core.c

    We need that header because of THIS_MODULE.

    Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.c      |    1 +
 drivers/usb/dwc3/dwc3-omap.c |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

commit 3853301374
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 1 22:26:25 2011 +0300

    usb: dwc3: omap: distinguish between SW and HW modes

    The OMAP wrapper allows us to either control internal
    OTG signals via SW or HW. Different boards might wish
    to use one or the other mode of operation. Let's have
    have that information passed via platform_data for now.

    After DT conversion is finished for OMAP, we can easily
    convert this to a DT attribute.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/dwc3-omap.c            |   22 ++++++++++++++
 include/linux/platform_data/dwc3-omap.h |   47 +++++++++++++++++++++++++++++++
 2 files changed, 69 insertions(+), 0 deletions(-)

commit a9f36f0d43
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 1 18:33:43 2011 +0300

    usb: dwc3: omap: drop DEV_PM_OPS for now

    We need to have actual HW in order to implement
    and test that part of the code anyway. Until then
    it's best to remove it.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/dwc3-omap.c |   41 -----------------------------------------
 1 files changed, 0 insertions(+), 41 deletions(-)

commit 25add6a527
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 1 18:22:01 2011 +0300

    usb: dwc3: omap: use the macro we already have

    trivial patch, no functional changes.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/dwc3-omap.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

commit 6db06e599e
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 1 14:52:52 2011 +0300

    usb: dwc3: omap: do not enable DMA Disable Clear IRQ

    Otherwise that IRQ will trigger forever. It's quite
    unnecessary.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/dwc3-omap.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

commit e57336aec4
Author: Felipe Balbi <balbi@ti.com>
Date:   Thu Sep 1 14:46:16 2011 +0300

    usb: dwc3: omap: fix dev_dbg() calls

    dev_dbg() macro expects a device pointer as
    argument, not a memory base address.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/dwc3-omap.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

commit fe44a98207
Author: Felipe Balbi <balbi@ti.com>
Date:   Tue Aug 30 15:52:17 2011 +0300

    usb: dwc3: use ep0_next_event field

    Start tracking the next expected event and act
    on the error conditions as suggested by databook.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c |   40 ++++++++++++++++++++++++++++++++++++----
 1 files changed, 36 insertions(+), 4 deletions(-)

commit 660f6fbd3c
Author: Felipe Balbi <balbi@ti.com>
Date:   Tue Aug 30 15:50:40 2011 +0300

    usb: dwc3: core: add ep0_next_event field

    this field will hold the next expected event.

    In certain cases, host might fall into some error
    condition and ask from us the wrong Control phase.
    On such situations, we should stall and restart.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

commit 7971a74744
Author: Felipe Balbi <balbi@ti.com>
Date:   Tue Aug 30 15:48:08 2011 +0300

    usb: dwc3: drop EP0_STALL state

    Whenever we issue a Set Stall command on EP0,
    the state machine will be restarted and Stall
    is cleared automatically, when core receives
    the next SETUP packet.

    There's no need to track that EP0_STALL state.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h   |    1 -
 drivers/usb/dwc3/ep0.c    |    2 --
 drivers/usb/dwc3/gadget.c |   10 ++++++++--
 3 files changed, 8 insertions(+), 5 deletions(-)

commit 7467e8ba54
Author: Felipe Balbi <balbi@ti.com>
Date:   Tue Aug 30 15:54:53 2011 +0300

    usb: dwc3: ep0: clear all EP0 flags

    when we're going to issue Set Stall command,
    we should clear DWC3_EP_STALL flag, but also
    we should clear BUSY, HALTED and all others.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit c201c026ca
Author: Felipe Balbi <balbi@ti.com>
Date:   Wed Aug 31 11:51:43 2011 +0300

    usb: dwc3: ep0: fix Get Status handling

    data was prepared on setup_buf but transfer
    was started on ctrl_req, fix it.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit 6028defbf5
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Mon Aug 29 16:46:38 2011 +0200

    usb: dwc3: gadget: replace mdelay with udelay in the busy loop

    There are two spots where we wait until the HW finishes processing a
    certain command. Initially we had a few problems and we used 500ms as a
    limit to be on a the safe side. Paul Zimmerman mentioned this is little too
    much. After a debugging session, we noticed that we hardly ever go over 20us
    and didn't pass 30usec so far. Using mdelay() seems way overloaded.

    Giving the current numbers 500usec as the upper limit is more than  enough.
    Should it ever timeout then something is definitely wrong.

    While here, also replace the type with u32 since long does not really
    fit here.

    Cc: Paul Zimmerman <paul.zimmerman@synopsys.com>
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

commit d63d30a465
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Mon Aug 29 13:56:37 2011 +0200

    usb: dwc3: gadget: rework the dequeue on RESET & DISCONNECT

    - since a while we are disabling an endpoint and purging every requests on
      RESET and DISCONNECT which leads to a warning since the endpoint was
      disabled twice (once by the UDC, and second time by the gadget). I
      think UDC should nuke all requests because all those requests
      become invalid. It's gadget driver's responsability, though, to disable
      its used endpoints. This is done by merging dwc3_stop_active_transfer()
      and dwc3_gadget_nuke_reqs() into dwc3_remove_requests().

    - dwc3_stop_active_transfer() is now no longer called unconditionaly.
      This has the advantage that it is always called to disable an active
      transfer which means if res_trans_idx 0 than something went wrong and
      it is an error condition because we can't clean up the requests.

    - Remove the DWC3_EP_WILL_SHUTDOWN which was introduced while
      introducing the command complete part for dequeue. All requests on
      req_queued list should be removed during the dwc3_cleanup_done_reqs()
      callback so there is no reason to go through the list again.
      We consider it an error condition if requests are still on this
      list since we never queue TRB without LST=1 (the last requests has
      always LST=1, there are no requests with LST=0 behind it).

    [ balbi@ti.com : reworked commit log a bit, made patch apply ]

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h   |    1 -
 drivers/usb/dwc3/gadget.c |   31 ++++++++++++-------------------
 2 files changed, 12 insertions(+), 20 deletions(-)

commit 50b47b650d
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Mon Aug 29 13:56:36 2011 +0200

    usb: dwc3: core: move the core check before soft reset

    We read the DWC3_GSNPSID register to make sure we got the correct
    register offset passed. One of the recent commits moved the soft reset
    before this so in case of the wrong offset we end up with "reset timed
    out". This patch moves the "id" check before the reset again.

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.c |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

commit 63940b6b0e
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Mon Aug 29 13:56:35 2011 +0200

    usb: dwc3: debugfs: remove test mode interface

    There are some issues around for enabling/disabling this mode and
    handling it. It does not work perfectly (yet). However we have a few
    gadgets tested successfuly so far. That means we are quite confident
    that we won't need this in near future.
    So I'm for removing it and bringing a working version back once there is
    a need for it.

    Thanks to Dan Carpenter who spotted the wrong memory handling here.

    [ balbi@ti.com : made it actually apply ]

    Cc: Dan Carpenter <error27@gmail.com>
    Cc: wharms@bfs.de
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/debugfs.c |   94 --------------------------------------------
 1 files changed, 0 insertions(+), 94 deletions(-)

commit 9e44d2fcbc
Author: Felipe Balbi <balbi@ti.com>
Date:   Sat Aug 27 22:28:36 2011 +0300

    usb: dwc3: ep0: simplify EP0 state machine

    The DesignWare USB3 core tells us which phase
    of a control transfer should be started, it
    also tells us which physical endpoint needs
    that transfer.

    With these two informations, we have all we
    need to simply EP0 handling quite a lot and
    get rid rid of the SW state machine tracking
    ep0 states.

    For achieving this perfectly, we needed to
    add support for situations where we get
    XferNotReady while endpoint is still busy
    and XferNotReady while gadget driver still
    hasn't queued a request.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h   |   12 +-
 drivers/usb/dwc3/ep0.c    |  363 ++++++++++++++++++++-------------------------
 drivers/usb/dwc3/gadget.c |    3 +-
 3 files changed, 163 insertions(+), 215 deletions(-)

commit 01eb17f36f
Author: Felipe Balbi <balbi@ti.com>
Date:   Sat Aug 27 22:26:00 2011 +0300

    usb: dwc3: core: add flag for EP0 direction

    Add a flag to keep track of ep0 direction.
    This flag will be used on a following patch.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

commit 7f3c16ae1c
Author: Felipe Balbi <balbi@ti.com>
Date:   Sat Aug 27 22:18:09 2011 +0300

    usb: dwc3: ep0: add handling for unaligned OUT transfers

    In case we have transfers which aren't aligned
    to wMaxPacketSize, we need to be careful with
    how we start the transfer with the HW. OUT
    transfers _must_ be aligned with wMaxPacketSize
    and in order to guarantee that, we use a bounce
    buffer.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c |   37 ++++++++++++++++++++++++++++++++-----
 1 files changed, 32 insertions(+), 5 deletions(-)

commit abf905d6b7
Author: Felipe Balbi <balbi@ti.com>
Date:   Sat Aug 27 22:07:53 2011 +0300

    usb: dwc3: add a bounce buffer for control endpoints

    This core cannot handle OUT transfers which aren't
    aligned to wMaxPacketSize, but that can happen at
    least on control endpoint with the USB Audio Class.

    This patch adds a bounce buffer to be used on the
    case of a non-aligned ep0out request is queued.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h   |    6 ++++++
 drivers/usb/dwc3/gadget.c |   29 ++++++++++++++++++++++-------
 2 files changed, 28 insertions(+), 7 deletions(-)

commit c204098003
Author: Felipe Balbi <balbi@ti.com>
Date:   Sat Aug 27 22:04:32 2011 +0300

    usb: dwc3: core: add defines for XferNotReady event on Control EPs

    The status field of the Transfer Not Read event
    is different on Control Endpoints. On this patch
    we are just adding the defines to be used on a
    later patch which will re-work the control endpoint
    handling.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

commit 60639e6734
Author: Felipe Balbi <balbi@ti.com>
Date:   Sat Aug 27 20:29:58 2011 +0300

    usb: dwc3: gadget: improve command completion debug message

    the previous message had too little meaning. Make
    it more human readable and use the macro we already
    had for extracting the command completion status out
    of DEPCMDn register.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

commit f3d228bb1c
Author: Felipe Balbi <balbi@ti.com>
Date:   Sat Aug 27 15:10:09 2011 +0300

    usb: dwc3: gadget: set request dma to invalid when unmapping

    if we don't set DMA address to invalid when unmapping,
    we might fall in a situation where request buffer
    can't be mapped to DMA again.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

commit c388134423
Author: Felipe Balbi <balbi@ti.com>
Date:   Sat Aug 27 02:30:33 2011 +0300

    usb: dwc3: ep0: fix 'transfered' typo

    trivial patch. No functional changes.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/ep0.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

commit d2a925e9fb
Author: Felipe Balbi <balbi@ti.com>
Date:   Sat Aug 27 01:40:52 2011 +0300

    usb: dwc3: core: add missing @ for kerneldoc

    trivial patch, no functional changes

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/core.h |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

commit b1b7b1afba
Author: Dan Carpenter <error27@gmail.com>
Date:   Fri Aug 26 12:21:13 2011 +0300

    usb: dwc3: debugfs: add a kfree() on error to dwc3_testmode_open()

    We may as well fix this potential leak so we don't have to listen to
    the static checkers complain.

    Signed-off-by: Dan Carpenter <error27@gmail.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/debugfs.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

commit 2bb2a4a9f9
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Mon Aug 22 18:29:13 2011 +0200

    usb: dwc3: gaget: clear DWC3_EP_WILL_SHUTDOWN bit

    Without this patch we won't clear that bit and instead will
    clear all other bits on our endpoint flag.

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit 043b6e0d49
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Mon Aug 22 17:42:19 2011 +0200

    usb: dwc3: gadget: use TRB type 6 for ISOC transfers

    Type 6 should be used for the first transfer during an interval. This is
    also what the reference driver is using. Type 7 seems to be for following
    or additional transfers within the same interval.

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit b767680adf
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Mon Aug 22 17:42:18 2011 +0200

    usb: dwc3: gadget: reset resource index to zero

    If we collected two requests together (i.e. only the last of them has
    LST=1) then we only have to stop transfer once: The clean-up code will
    cleanup everything until first TRB with the LST bit set.
    After XferComplete this index should be no longer valid since there is
    no transfer pending.

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

commit f5327ee678
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Fri Aug 19 19:59:12 2011 +0200

    usb: dwc3: gadget: fixing dequeue of TRBs

    A TRB which is dequeued seems to have its HWO bits set to 1. Therefore
    we ignore it if we dequeue it after the command is completed.

    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

commit 502e0e5684
Author: Randy Dunlap <rdunlap@xenotime.net>
Date:   Tue Aug 23 12:52:47 2011 -0700

    usb: fix dwc3 build when USB_GADGET_DWC3 is not enabled

    Fix build error when CONFIG_USB_GADGET_DWC3 is not enabled:

    ERROR: "dwc3_send_gadget_ep_cmd" [drivers/usb/dwc3/dwc3.ko] undefined!

    Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
    Acked-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/gadget.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

commit 15dc6e57e3
Author: Stephen Rothwell <sfr@canb.auug.org.au>
Date:   Tue Aug 23 15:08:54 2011 +1000

    usb: include module.h in the DesignWare USB3 DRD driver

    Fixes this build error:

    drivers/usb/dwc3/dwc3-pci.c: In function 'dwc3_pci_init':
    drivers/usb/dwc3/dwc3-pci.c:211:9: error: 'THIS_MODULE' undeclared (first use in this function)

    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    Acked-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/dwc3/dwc3-pci.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

commit aa526a9467
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Aug 19 18:10:58 2011 +0300

    usb: dwc3: Introduce DesignWare USB3 DRD Driver

    The DesignWare USB3 is a highly
    configurable IP Core which can be
    instantiated as Dual-Role Device (DRD),
    Peripheral Only and Host Only (XHCI)
    configurations.

    Several other parameters can be configured
    like amount of FIFO space, amount of TX and
    RX endpoints, amount of Host Interrupters,
    etc.

    The current driver has been validated with
    a virtual model of version 1.73a of that core
    and with an FPGA burned with version 1.83a
    of the DRD core. We have support for PCIe
    bus, which is used on FPGA prototyping, and
    for the OMAP5, more adaptation (or glue)
    layers can be easily added and the driver
    is half prepared to handle any possible
    configuration the HW engineer has chosen
    considering we have the information on
    one of the GHWPARAMS registers to do
    runtime checking of certain features.

    More runtime checks can, and should, be added
    in order to make this driver even more flexible
    with regards to number of endpoints, FIFO sizes,
    transfer types, etc.

    While this supports only the device side, for
    now, we will add support for Host side (xHCI -
    see the updated series Sebastian has sent [1])
    and OTG after we have it all stabilized.

    [1] http://marc.info/?l=linux-usb&m=131341992020339&w=2

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    [idos@codeaurora.org: gadget_chips.h: Use 'gadget_is_dwc3(g)' only if
    CONFIG_USB_GADGET_DWC3 is defined.]
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 Documentation/usb/dwc3.txt        |   53 +
 drivers/usb/Kconfig               |    2 +
 drivers/usb/Makefile              |    2 +
 drivers/usb/dwc3/Kconfig          |   25 +
 drivers/usb/dwc3/Makefile         |   36 +
 drivers/usb/dwc3/core.c           |  467 +++++++++
 drivers/usb/dwc3/core.h           |  709 +++++++++++++
 drivers/usb/dwc3/debug.h          |   51 +
 drivers/usb/dwc3/debugfs.c        |  534 ++++++++++
 drivers/usb/dwc3/dwc3-omap.c      |  410 ++++++++
 drivers/usb/dwc3/dwc3-pci.c       |  219 ++++
 drivers/usb/dwc3/ep0.c            |  782 ++++++++++++++
 drivers/usb/dwc3/gadget.c         | 2063 +++++++++++++++++++++++++++++++++++++
 drivers/usb/dwc3/gadget.h         |  292 ++++++
 drivers/usb/dwc3/io.h             |   55 +
 drivers/usb/gadget/Kconfig        |   12 +
 drivers/usb/gadget/gadget_chips.h |    4 +
 17 files changed, 5716 insertions(+), 0 deletions(-)

commit eaa328c0bb
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Aug 19 18:10:57 2011 +0300

    usb: gadget: introduce gadget_is_dwc3()

    ... to check whether we're running on DesignWare
    USB3 DRD Controller.

    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    [idos@codeaurora.org: Conflicts: gadget_chips.h]
    Signed-off-by: Ido Shayevitz <idos@codeaurora.org>

 drivers/usb/gadget/gadget_chips.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Change-Id: Id7c13709d3849777a009d128d75d59bbfb7cb5e7
Signed-off-by: David Brown <davidb@codeaurora.org>
2012-02-06 10:30:50 -08:00
Ofir Cohen
eae1148b27 usb: gadget: clean-up msm_usb_bam_platform_data structure
Due to changes in usb_bam driver and usage of the
standard mechanism of platform resources instead
of adding new platform data, usb_bam_phy_base and
usb_bam_phy_size fields became unnecessary and were
removed.

Change-Id: I0f3a57724ecc033e704aaca6f651561a344c9fef
Signed-off-by: Ofir Cohen <ofirc@codeaurora.org>
2012-02-05 08:43:43 -07:00
Stephen Boyd
7dd2266ae3 usb: msm_otg: Migrate to clock apis for XO voting
Use the clock APIs instead of the msm_xo APIs to vote on CXO.
This removes one more msm specific api from this driver and will
allow us to move XO control into the rpm clock driver.

Change-Id: Ie9344aad20651002e98f13cd3adb39680fbd93bd
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2012-02-05 00:46:05 -08:00
Felipe Balbi
9e42b8b008 usb: gadget: fix typo for default U1/U2 exit latencies
s/DEFULT/DEFAULT/, no functional changes.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-02-03 21:28:40 +02:00
Sebastian Andrzej Siewior
61a3b903ab usb: gadget: udc-core: add "new-style" registration interface
udc_start() should only trigger the internal state machine and make
minimal house keeping. Before that call udc-core calls the bind()
callback and after the callback the pullup().

udc_stop() is simillar, udc-core calls pullup(), unbind() and finally
udc_stop().

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-02-03 21:28:37 +02:00
Tatyana Brokhman
355527ba15 usb: gadget: add SuperSpeed support to the Gadget Framework
SuperSpeed USB has defined a new descriptor, called
the Binary Device Object Store (BOS) Descriptor. It
has also changed a bit the definition of SET_FEATURE
and GET_STATUS requests to add USB3-specific details.

This patch implements both changes to the Composite
Gadget Framework.

[ balbi@ti.com : slight changes to commit log
		 fixed a compile error on ARM ]

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-02-03 21:28:36 +02:00
Tatyana Brokhman
fd11902012 usb: gadget: add max_speed to usb_composite_driver
This field is used by the Gadget drivers to specify
the maximum speed they support, meaning: the maximum
speed they can provide descriptors for.

The driver speed will be set in consideration of this
value.

[ balbi@ti.com : dropped the ifdeffery ]

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-02-03 21:28:36 +02:00
Tatyana Brokhman
24728e0ee2 usb: gadget: add streams support to the gadget framework
This patch defines necessary fields to support
streaming for USB3.0.

It implements a new function, called
usb_ep_autoconfig_ss(), to be used instead of the
existing usb_ep_autoconfig() when working in
SuperSpeed mode and there is a need to search for
an endpoint according to the number of required
streams.

[ balbi@ti.com : slight changes to commit log ]

Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-02-03 21:28:35 +02:00
Tatyana Brokhman
ebd3f395ba usb: gadget: use config_ep_by_speed() instead of ep_choose()
Remove obsolete functions:
1. ep_choose()
2. usb_find_endpoint()

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
[idos@codeaurora.org: Changed also the following files to
comply with this commit: f_accessory.c,f_adb.c,f_diag.c,f_mtp.c,
f_rmnet.c,f_rmnet_sdio,f_rmnet_smd,f_rmnet_smd_sdio,f_serial.f_ccid.c.
Also merged a patch in f_serial.c for correct checking of the return value
of config_ep_by_speed. See "usb: gadget: fix g_serial regression".
Also fix a bug in ci13xxx_udc. Since f_serial is now checking if the endpoint
descriptors are null in the set_alt function, need to set them to null on
ep_disable in case of cable disconnect. Since the ep descriptor was inserted
to struct usb_ep in "usb: gadget: add usb_endpoint_descriptor to struct usb_ep"
then simply convert the ci13xxx_udc to work with mEp->ep.desc instead of
mEp->desc, this will ensure that the correct descriptor will be cleared
on endpoint disable.
I will upstream it to Linux community soon, I will name it:
"usb: gadget: use usb ep descriptor of struct usb_ep instead of wrapper desc"]
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-02-03 21:28:34 +02:00
Tatyana Brokhman
e2a9f931cc usb: gadget: configure endpoint according to gadget speed
Add config_ep_by_speed() to configure the endpoint
according to the gadget speed.

Using this function will spare the FDs from handling
the endpoint chosen descriptor.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-02-03 21:28:34 +02:00
Tatyana Brokhman
9168a350f7 usb: gadget: add usb_endpoint_descriptor to struct usb_ep
Change usb_ep_enable() prototype to use endpoint
descriptor from usb_ep.

This optimization spares the FDs from saving the
endpoint chosen descriptor. This optimization is
not full though. To fully exploit this change, one
needs to update all the UDCs as well since in the
current implementation each of them saves the
endpoint descriptor in it's internal (and extended)
endpoint structure.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
[idos@codeaurora.org: Added more changes for the following files
since API break with msm code tree: ci13xxx_udc.c,f_accessory,f_adb,
f_diag,f_mtp,f_rmnet,f_rmnet_sdio,f_rmnet_smd, f_rmnet_smd_sdio,u_bam.c,
u_sdio.c,u_rmnet.h,u_sdio.c,u_smd.c,f_ccid.c,u_data_hsic.c]
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-02-03 21:28:33 +02:00
Felipe Balbi
b657342882 usb: gadget: introduce UDC Class
this class will be used to abstract away several of the duplicated
operations scattered among the USB gadget controller drivers.

Later, we can add an atomic notifier to tell interested drivers about
what's happening with the controller. Notifications such as suspend,
resume, enumerated, etc. will be useful, at a minimum, for implementing
usb charger detection.

As part of the converting process usb_gadget_probe_driver() is no longer
part of each udc but pushed into the ->stap() callback. The same for his
couterpart.

The core is currently set explicit to 'n'. It will be changed to 'y' once
all users are converted since it provides functions which clash with
other drivers.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-02-03 21:28:32 +02:00
Sebastian Andrzej Siewior
1e4eabf4be usb: ch9: add function defines from ch9, USB 3.0 spec
not to confuse with Table 9-7 in USB 2.0 spec

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-02-03 21:28:32 +02:00
kuninori.morimoto.gx@renesas.com
24a340bc5f usb: add usb_endpoint_maxp() macro
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
[idos@codeaurora.org: use __le16_to_cpu instead of le16_to_cpu]
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
2012-02-03 21:27:03 +02:00
Ofir Cohen
010009b830 usb: gadget: Add HSIC Peripheral over SPS support
Add support in HSIC peripheral(device)
over SPS.
Only one USB core can be use - currently HSUSB
is enabled by default.
To enable HSIC core defconfig file should be changed.

Change-Id: I256aecd9e6dfd8bfd71719c32beed8b24225e11c
Signed-off-by: Ofir Cohen <ofirc@codeaurora.org>
2012-01-29 09:03:19 +02:00
Mayank Rana
8549e63277 msm: board-9615: Return result from vbus power routine
USB OTG driver maintains the state of VBUS using vbus_is_online flag
for pdata based vbus power routine. Hence remove the used vbus_is_online
flag here and return the result of VBUS power sequence to update the
vbus_is_online flag in OTG driver.

Change-Id: I8bea42d5ebc27fab6fc2ae8a0b9fb58bdbaf854a
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2012-01-25 09:38:43 +05:30
Pavankumar Kondeti
2d09e5fe33 USB: OTG: msm: Implement data contact detection based on timeout
Data contact can be detected by either current source or timeout
methods.  The current source method is not working for an unknown
reason.  Implement timeout based data contact detection.  The spec
allows any timeout between 300msec to 900msec.  Use 600msec.

CRs-fixed: 330217
Change-Id: I67151d1412f43ba974cc1afb164d6473f89d2dbf
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2012-01-20 08:38:57 +05:30
Felipe Balbi
9f3657ac78 usb: ch9: fix up MaxStreams helper
commit 18b7ede5f7ee2092aedcb578d3ac30bd5d4fc23c upstream.

[ removed the dwc3 portion of the patch as it didn't apply to
older kernels - gregkh]

According to USB 3.0 Specification Table 9-22, if
bmAttributes [4:0] are set to zero, it means "no
streams supported", but the way this helper was
defined on Linux, we will *always* have one stream
which might cause several problems.

For example on DWC3, we would tell the controller
endpoint has streams enabled and yet start transfers
with Stream ID set to 0, which would goof up the host
side.

While doing that, convert the macro to an inline
function due to the different checks we now need.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-12 11:35:33 -08:00
Manu Gautam
5143b25310 msm: clock: Use device names to distinguish between USB clocks
Drivers should now use their device names to distinguish between
clocks of the same type rather than the clock name. Clock names
are updated to match the new naming convention.

CRs-Fixed: 327559
Change-Id: I78757806589e037a0655a63e7ee20c935214c99d
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
2012-01-09 22:32:33 -07:00
Ofir Cohen
4da266f11a usb: gadget: fix crash on USB cable disconnection
Crash was observed (9x15) when USB cable was
disconnected. Root cause was NULL pointer and
USB BAM reset due to USB PHY reset. On 9x15 no
reset on disconnect will be performed.

CRs-Fixed: 326999
Change-Id: I006afb8dcd225caf9280dd915f8af3edfaebff5a
Signed-off-by: Ofir Cohen <ofirc@codeaurora.org>
2012-01-03 13:04:46 +02:00
Ofir Cohen
a1c2a87d39 usb: gadget: Add SPS BAM-to-BAM support
Adding new support to enable USB-Peripheral
BAM-to-BAM transactions.
Changes were added to the UDC to support
"legacy/regular" USB transfers and
endless BAM-to-BAM transfers.

To avoid adding new vendor specific UDC file
to support the new feature and keep the UDC
as a generic as possiblea, USB request holds
a vendor specific data that distinguish between
the two transfer types.

USB BAM will be added in seperate commit.

Change-Id: I3211a122fe5236cda2dbe844b44f52a2b2063baf
Signed-off-by: Ofir Cohen <ofirc@codeaurora.org>
Signed-off-by: Amit Blay <ablay@codeaurora.org>
2011-12-14 10:26:34 +02:00
Ofir Cohen
c7827e45a3 usb: gadget: SPS BAM-to-BAM - USB BAM driver
USB BAM driver to support BAM-to-BAM
USB<->Peripheral transactions.

Change-Id: Ib49a41f5dcdccb6f6bff2492fa64ead40f18b870
Signed-off-by: Ofir Cohen <ofirc@codeaurora.org>
2011-12-13 20:46:22 +02:00