Archived
14
0
Fork 0
Commit graph

408 commits

Author SHA1 Message Date
Hauke Mehrtens
7a7a4a592f USB: EHCI: Add a generic platform device driver
This adds a generic driver for platform devices. It works like the PCI
driver and is based on it. This is for devices which do not have an own
bus but their EHCI controller works like a PCI controller. It will be
used for the Broadcom bcma and ssb USB EHCI controller.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-15 12:42:07 -07:00
Hauke Mehrtens
fa3364b5a2 USB: OHCI: Add a generic platform device driver
This adds a generic driver for platform devices. It works like the PCI
driver and is based on it. This is for devices which do not have an own
bus but their OHCI controller works like a PCI controller. It will be
used for the Broadcom bcma and ssb USB OHCI controller.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-15 12:41:58 -07:00
Andiry Xu
f99298bfa7 xHCI: BESL calculation based on USB2.0 LPM errata
The latest released errata for USB2.0 ECN LPM adds new fields to USB2.0
extension descriptor, defines two BESL values for device: baseline BESL
and deep BESL. Baseline BESL value communicates a nominal power savings
design point and the deep BESL value communicates a significant power
savings design point.

If device indicates BESL value, driver will use a value count in both
host BESL and device BESL. Use baseline BESL value as default.

Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Tested-by: Jason Fan <jcfan@qca.qualcomm.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2012-03-12 09:31:24 -07:00
Greg Kroah-Hartman
b790f5d126 USB: serial: use module_driver() macro
Now that module_driver() can handle varargs, use it instead of rolling
our own version.

Cc: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-09 16:38:14 -08:00
Bjørn Mork
3cc3615749 usb: cdc-wdm: adding usb_cdc_wdm_register subdriver support
This driver can be used as a subdriver of another USB driver, allowing
it to export a Device Managment interface consisting of a single interrupt
endpoint with no dedicated USB interface.

Some devices provide a Device Management function combined with a wwan
function in a single USB interface having three endpoints (bulk in/out
+ interrupt).  If the interrupt endpoint is used exclusively for DM
notifications, then this driver can support that as a subdriver
provided that the wwan driver calls the appropriate entry points on
probe, suspend, resume, pre_reset, post_reset and disconnect.

The main driver must have full control over all interface related
settings, including the needs_remote_wakeup flag. A manage_power
function must be provided by the main driver.

A manage_power stub doing direct flag manipulation is used in normal
driver mode.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Acked-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 13:06:48 -08:00
Felipe Balbi
cd70469d08 usb: core: hcd: make hcd->irq unsigned
There's really no point in having hcd->irq as a
signed integer when we consider the fact that
IRQ 0 means NO_IRQ. In order to avoid confusion,
make hcd->irq unsigned and fix users who were
passing -1 as the IRQ number to usb_add_hcd.

Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-01 09:31:22 -08:00
Greg Kroah-Hartman
f9b0f51709 This merge is rather big. Here's what it contains:
For am5536udc we have just simple coding style fixes. Nothing that has any
 potential to cause any issues going forward.
 
 With mv_udc, there's only one single change removing an unneeded NULL check.
 
 at91_udc also only saw a single change this merge window, and that's only
 removing a duplicated header.
 
 The Renesas controller has a few more involved changes. Support for SUDMAC was
 added, there's now a special handling of IRQ resources for when the IRQ line is
 shared between Renesas controller and SUDMAC, we also had a bug fix where
 Renesas controller would sleep in atomic context while doing DMA transfers from
 a tasklet. There were also a set of minor cleanups.
 
 The FSL UDC also had a scheduling in atomic context bug fix, but that's all.
 
 Thanks to Sebastian, the dummy_hcd now works better than ever with support for
 scatterlists and streams. Sebastian also added SuperSpeed descriptors to the
 serial gadgets.
 
 The highlight on this merge is the addition of a generic API for mapping and
 unmapping usb_requests. This will avoid code duplication on all UDC controllers
 and also kills all the defines for DMA_ADDR_INVALID which UDC controllers
 sprinkled around. A few of the UDC controllers were already converted to use
 this new API.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJPTeaWAAoJEIaOsuA1yqREdT8QAK8ob6RqnZs9en7NdaBTq18G
 qPtdheAZ9TkWxv+JE69Nqq1DuLO93+ZqLt88kaIVp/jTg+MxZ4qeANe9Nga0Qr+U
 Qc4d9HOkKsLGC+E45TApAMCQkPZ3DxbObJRUeJI7DBefPJ+MzQYAeeQtzjEeKKf8
 hGY5kh5FdXds/TlTePwWuyVoe09grgoy7cvptIVJRZiWx8+n9PZeMiKe+vAmQDEc
 +V0FfOMZLcSY9Oi14faYDrOFIV5cjBxnwnBpinOYx5TArxep35HSynt/mJtW2a7/
 lcdpbS4Hn35LJQWcYl0onx0GNgvI/YDYg9V6vrSjoBVU7vZ/7slZ896yjiovmAsc
 KQXxKoqss80sd+rYUe/si/Ues+koN9HztucG//+9cuS2ZCnDydHMJHonMBXUZguv
 o2gzQwjRCUOcGLj+vnSAFiBAGZwAZV99rA2VgIz3dSyegDN+SverXJscOuvzzW/V
 6yERLjbmxwtIQczlUMPQgGE9gSMYKRzyDV4JlO1xtfsBwcVc0c4YE+ZnWOeEAbOa
 evrI/3RGjP12rY+eyntlN2ZpHq2ZJnS7guDjooi0mGK16LWeQh8h0zD24XoUiwnr
 nhkv+eqWJQXV2iQcyezO1TLnxhZ7LZdtfkYg5MH/VqGIuh6SNQdhew4bijUuKKsq
 +aLPREySYHdIloQjPBe/
 =RR+f
 -----END PGP SIGNATURE-----

Merge tag 'gadget-for-v3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next

USB: Gadget: changes for 3.4

This merge is rather big. Here's what it contains:

For am5536udc we have just simple coding style fixes. Nothing that has any
potential to cause any issues going forward.

With mv_udc, there's only one single change removing an unneeded NULL check.

at91_udc also only saw a single change this merge window, and that's only
removing a duplicated header.

The Renesas controller has a few more involved changes. Support for SUDMAC was
added, there's now a special handling of IRQ resources for when the IRQ line is
shared between Renesas controller and SUDMAC, we also had a bug fix where
Renesas controller would sleep in atomic context while doing DMA transfers from
a tasklet. There were also a set of minor cleanups.

The FSL UDC also had a scheduling in atomic context bug fix, but that's all.

Thanks to Sebastian, the dummy_hcd now works better than ever with support for
scatterlists and streams. Sebastian also added SuperSpeed descriptors to the
serial gadgets.

The highlight on this merge is the addition of a generic API for mapping and
unmapping usb_requests. This will avoid code duplication on all UDC controllers
and also kills all the defines for DMA_ADDR_INVALID which UDC controllers
sprinkled around. A few of the UDC controllers were already converted to use
this new API.

Conflicts:
	drivers/usb/dwc3/gadget.c
2012-03-01 09:20:28 -08:00
Greg Kroah-Hartman
8062d94a54 Here we have a big rework done by Heikki Krogerus (thanks) which
splits OTG functionality away from transceivers.
 
 We have known for quite a long time that struct otg_transceiver was
 a bad name for the structure, considering transceiver is far from
 being OTG-specific (see 4e67185).
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJPTeeMAAoJEIaOsuA1yqRE6ZAP/j2G6DaDyng6vpyYQi2drXaY
 NKx3pA0sC98NACOv6sh+urcMDcDctLmOnwV18U+GNNP+qExQFnyuc7iGsXRxfUOj
 qkIbVPxzPcE0opmEMFJ5ZT85rw33DqKjFnQT4av3wwXe/qSrEkAfBoBSb6wn73rA
 v0JOhceGsFb+kJAc7U9Ji9A9xSjj+6uw08RTuuQv8KBLb5Pws+NoQ6UEjlni8umA
 lkOSelyBZN1OJU+fZKIpS4+SiwtdkZCm2wSIUiwaPosdJgw0w8fz0zNjn/4gAHB1
 oPyjjjP3/VDegp9CuYDRlnBgQa2K4V1vbjrBfhKbyar8fsOSoaPVv1fR9VKgVnT8
 RKlXKSeFEsdP4fOGYCjNKAzjeQH/qSNzdzo+s4GMqoWq7Lm3+b56zdQWvRmTT7Xg
 ++bMqFAi0noeU8aZWwSDMFiYv6O19o+Px4OTS/3aRmR1wdJpUUSk2M7Quw6A/YNj
 4Q5hDvio2eYtI1nya9yMS/j4ZiJ5fDQb5jUfBDB1MKtkZKKzVVSboK8P/rFq5+xf
 xdUfBRd7/fMk+he6RtemfjhMdYTiX6Cm6VzveZVBL4+7dERbnJDRgDhSJOYvA/eW
 Bvc7BY+/EYz7msF0gjLyWu3BBiChajk/D5ukoCIssUPGuIhmO1S7JRi1s+fLaNs3
 Bz8Haxql69YWrNL2ouQf
 =WiB6
 -----END PGP SIGNATURE-----

Merge tag 'xceiv-for-v3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next

USB: transceiver changes for 3.4

Here we have a big rework done by Heikki Krogerus (thanks) which
splits OTG functionality away from transceivers.

We have known for quite a long time that struct otg_transceiver was
a bad name for the structure, considering transceiver is far from
being OTG-specific (see 4e67185).
2012-03-01 08:45:33 -08:00
Greg KH
d1cddb4a8e USB: create module_usb_serial_driver macro
Now that Alan Stern has cleaned up the usb serial driver registration,
we have the ability to create a module_usb_serial_driver macro to make
things a bit simpler, like the other *_driver macros created.

But, as we need two functions here, we can't reuse the existing
module_driver() macro, so we need to roll our own.

Here's a patch implementing module_usb_serial_driver() and it converts
the pl2303 driver to use it, showing a nice cleanup.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-28 11:21:48 -08:00
Sebastian Andrzej Siewior
03892d5fef usb/storage: remove Filler member from struct bulk_cs_wrap
As Alan Stern pointed out this member has nothing to do with the Command
Status Wrapper (CSW) as specified by the Universal Serial Bus Mass
Storage Class Bulk-Only Transport rev 1.0. It defines the structure
without the additional 18 filler bytes and defines the total size of the
struct to exactly 13 bytes. Larger responses should be dropped. All
in-tree users use a defines instead of sizeof() of this struct as far I
can tell.

Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-28 11:11:22 -08:00
Sebastian Andrzej Siewior
b8db6d6402 usb/storage: redefine US_BULK_FLAG_IN and use it
US_BULK_FLAG_IN is defined as 1 and not used. The USB storage spec says
that bit 7 of flags within CBW defines the data direction. 1 is DATA-IN
(read from device) and 0 is the DATA-OUT. Bit 6 is obselete and bits 0-5
are reserved.
This patch redefines the unsued define US_BULK_FLAG_IN from 1 to 1 << 7
aka 0x80 and replaces the obvious users. In a following patch the
storage gadget will use it as well.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-28 11:07:42 -08:00
Sebastian Andrzej Siewior
7ac4704c09 usb/storage: a couple defines from drivers/usb/storage/transport.h to include/linux/usb/storage.h
This moves the BOT data structures for CBW and CSW from drivers internal
header file to global include able file in include/.
The storage gadget is using the same name for CSW but a different for
CBW so I fix it up properly. The same goes for the ub driver and keucr
driver in staging.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-28 11:05:18 -08:00
Felipe Balbi
a698908d3b usb: gadget: add generic map/unmap request utilities
such utilities are currently duplicated on all UDC
drivers basically with the same structure. Let's group
all implementations into one generic implementation
and get rid of that duplication.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-02-28 14:48:23 +02:00
Heikki Krogerus
6e13c6505c usb: otg: Convert all users to pass struct usb_otg for OTG functions
This changes the otg functions so that they receive struct
otg instead of struct usb_phy as parameter and
converts all users of these functions to pass the otg member
of their usb_phy.

Includes fixes to IMX code from Sascha Hauer.

[ balbi@ti.com : fixed a compile warning on ehci-mv.c ]

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Acked-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Acked-by: Li Yang <leoli@freescale.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-02-27 15:41:52 +02:00
Heikki Krogerus
136ced891a usb: otg: Remove OTG specific members from usb_phy
All the drivers are now converted to use struct usb_otg, so
removing the OTG specific members from struct usb_phy.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-02-27 15:41:51 +02:00
Greg Kroah-Hartman
f799e76783 USB: serial: remove usb_serial_register and usb_serial_deregister
No one uses them anymore, they should be using the safer
usb_serial_register_drivers() and usb_serial_deregister_drivers()
functions instead.

Thanks to Alan Stern for writing these functions and porting all
in-kernel users to them.

Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 12:50:30 -08:00
Alan Stern
765e0ba626 usb-serial: new API for driver registration
This patch (as1522) adds two new routines to the usb-serial core, for
registering and unregistering serial drivers.  Instead of registering
the usb_driver and usb_serial_drivers separately, with error checking
for each one, the drivers can all be registered and unregistered by a
single function call.  This reduces duplicated code.

More importantly, the new core routines change the order in which the
drivers are registered.  Currently the usb-serial drivers are all
registered first and the usb_driver is done last, which leaves a
window for problems.  A udev script may quickly add a new dynamic-ID
for a usb-serial driver, causing the corresponding usb_driver to be
probed.  If the usb_driver hasn't been registered yet then an oops
will occur.

The new routine prevents such problems by registering the usb_driver
first.  To insure that it gets probed properly for already-attached
serial devices, we call driver_attach() after all the usb-serial
drivers have been registered.

Along with adding the new routines, the patch modifies the "generic"
serial driver to use them.  Further patches will similarly modify all
the other in-tree USB serial drivers.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 12:39:17 -08:00
Jassi Brar
0d4e1b2a7e usb: uac2: Add ACHeader and FormatType descriptor
Add missing, but needed, ACHeader and FormatType descriptor definitions.

Signed-off-by: Yadi Brar <yadi.brar01@gmail.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-02-15 10:10:11 +02:00
Sarah Sharp
4ee823b83b USB/xHCI: Support device-initiated USB 3.0 resume.
USB 3.0 hubs don't have a port suspend change bit (that bit is now
reserved).  Instead, when a host-initiated resume finishes, the hub sets
the port link state change bit.

When a USB 3.0 device initiates remote wakeup, the parent hubs with
their upstream links in U3 will pass the LFPS up the chain.  The first
hub that has an upstream link in U0 (which may be the roothub) will
reflect that LFPS back down the path to the device.

However, the parent hubs in the resumed path will not set their link
state change bit.  Instead, the device that initiated the resume has to
send an asynchronous "Function Wake" Device Notification up to the host
controller.  Therefore, we need a way to notify the USB core of a device
resume without going through the normal hub URB completion method.

First, make the xHCI roothub act like an external USB 3.0 hub and not
pass up the port link state change bit when a device-initiated resume
finishes.  Introduce a new xHCI bit field, port_remote_wakeup, so that
we can tell the difference between a port coming out of the U3Exit state
(host-initiated resume) and the RExit state (ending state of
device-initiated resume).

Since the USB core can't tell whether a port on a hub has resumed by
looking at the Hub Status buffer, we need to introduce a bitfield,
wakeup_bits, that indicates which ports have resumed.  When the xHCI
driver notices a port finishing a device-initiated resume, we call into
a new USB core function, usb_wakeup_notification(), that will set
the right bit in wakeup_bits, and kick khubd for that hub.

We also call usb_wakeup_notification() when the Function Wake Device
Notification is received by the xHCI driver.  This covers the case where
the link between the roothub and the first-tier hub is in U0, and the
hub reflects the resume signaling back to the device without giving any
indication it has done so until the device sends the Function Wake
notification.

Change the code in khubd that handles the remote wakeup to look at the
state the USB core thinks the device is in, and handle the remote wakeup
if the port's wakeup bit is set.

This patch only takes care of the case where the device is attached
directly to the roothub, or the USB 3.0 hub that is attached to the root
hub is the device sending the Function Wake Device Notification (e.g.
because a new USB device was attached).  The other cases will be covered
in a second patch.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2012-02-14 12:12:26 -08:00
Sarah Sharp
4296c70a5e USB/xHCI: Enable USB 3.0 hub remote wakeup.
USB 3.0 hubs have a different remote wakeup policy than USB 2.0 hubs.
USB 2.0 hubs, once they have remote wakeup enabled, will always send
remote wakes when anything changes on a port.

However, USB 3.0 hubs have a per-port remote wake up policy that is off
by default.  The Set Feature remote wake mask can be changed for any
port, enabling remote wakeup for a connect, disconnect, or overcurrent
event, much like EHCI and xHCI host controller "wake on" port status
bits.  The bits are cleared to zero on the initial hub power on, or
after the hub has been reset.

Without this patch, when a USB 3.0 hub gets suspended, it will not send
a remote wakeup on device connect or disconnect.  This would show up to
the user as "dead ports" unless they ran lsusb -v (since newer versions
of lsusb use the sysfs files, rather than sending control transfers).

Change the hub driver's suspend method to enable remote wake up for
disconnect, connect, and overcurrent for all ports on the hub.  Modify
the xHCI driver's roothub code to handle that request, and set the "wake
on" bits in the port status registers accordingly.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2012-02-14 12:12:24 -08:00
Greg Kroah-Hartman
50e5dfb6c4 Merge branch 'usb-linus' into usb-next
This is needed so that Sarah can queue up some xhci changes for 3.4

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-13 15:10:12 -08:00
Heikki Krogerus
298b083cf9 usb: otg: ulpi: Start using struct usb_otg
Use struct usb_otg members with OTG specific functions instead
of usb_phy members.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-02-13 13:35:56 +02:00
Heikki Krogerus
1d4c9293ae usb: otg: msm: Start using struct usb_otg
Use struct usb_otg members with OTG specific functions instead
of usb_phy members.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-02-13 13:35:38 +02:00
Heikki Krogerus
7a8a3a9bec usb: otg: Separate otg members from usb_phy
Introducing struct otg and collecting otg specific members
to it from struct usb_phy. There are no changes to
struct usb_phy at this stage. This also renames
transceiver specific functions, and offers aliases for the
old otg ones.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-02-13 13:35:06 +02:00
Heikki Krogerus
de07e18c00 usb: otg: Rename usb_xceiv_event to usb_phy_event
Convert all users.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-02-13 13:34:56 +02:00
Heikki Krogerus
8675381109 usb: otg: Rename otg_transceiver to usb_phy
This is the first step in separating USB transceivers from
USB OTG utilities.

Includes fixes to IMX code from Sascha Hauer.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Acked-by: Li Yang <leoli@freescale.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-02-13 13:34:36 +02:00
Sarah Sharp
d9f5343e35 USB: Remove duplicate USB 3.0 hub feature #defines.
Somehow we ended up with duplicate hub feature #defines in ch11.h.
Tatyana Brokhman first created the USB 3.0 hub feature macros in 2.6.38
with commit 0eadcc0920 "usb: USB3.0 ch11
definitions".  In 2.6.39, I modified a patch from John Youn that added
similar macros in a different place in the same file, and committed
dbe79bbe9d "USB 3.0 Hub Changes".

Some of the #defines used different names for the same values.  Others
used exactly the same names with the same values, like these gems:

 #define USB_PORT_FEAT_BH_PORT_RESET     28
...
 #define USB_PORT_FEAT_BH_PORT_RESET            28

According to my very geeky husband (who looked it up in the C99 spec),
it is allowed to have object-like macros with duplicate names as long as
the replacement list is exactly the same.  However, he recalled that
some compilers will give warnings when they find duplicate macros.  It's
probably best to remove the duplicates in the stable tree, so that the
code compiles for everyone.

The macros are now fixed to move the feature requests that are specific
to USB 3.0 hubs into a new section (out of the USB 2.0 hub feature
section), and use the most common macro name.

This patch should be backported to 2.6.39.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Tatyana Brokhman <tlinder@codeaurora.org>
Cc: John Youn <johnyoun@synopsys.com>
Cc: Jamey Sharp <jamey@minilop.net>
Cc: stable@vger.kernel.org
2012-02-10 14:24:31 -08:00
Greg Kroah-Hartman
7483948fdd Merge tag 'usb-3.3-rc3' into usb-next
This is done to resolve a merge conflict with:
	drivers/usb/class/cdc-wdm.c
and to better handle future patches for this driver as it is under
active development at the moment.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10 11:13:53 -08:00
Johan Hovold
e688355bfe USB: serial: add macro for console error reporting
Add macro which prints an error message only once if port is used a
console.

Reporting errors in a write path when port is used as a console could
otherwise result in an infinite loop.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09 08:43:02 -08:00
Sebastian Andrzej Siewior
ee398b59ec usb/uas: add usb_pipe_usage_descriptor
usb_pipe_usage_descriptor defines the struct which is used to describe
the type of the endpoint in UAS (status/command/data in+out). It will be
used by the UAS gadget, the host code is using a char array for the
access.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2012-02-02 14:51:19 -08:00
Sebastian Andrzej Siewior
348748b0e8 usb/uas: move UAS structs / defines into a header file
The protocol specific structures and defines which are used by UAS are
moved into a header files by this patch so it can be accessed by the UAS
gadget as well.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2012-02-02 14:51:11 -08:00
Kuninori Morimoto
504b61630a usb: ch9.h: usb_endpoint_maxp() uses __le16_to_cpu()
The usb/ch9.h will be installed to /usr/include/linux,
and be used from user space.
But le16_to_cpu() is only defined for kernel code.
Without this patch, user space compile will be broken.
Special thanks to Stefan Becker

Reported-by: Stefan Becker <chemobejk@gmail.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-02-01 15:56:19 -08:00
Alexander Shishkin
c1084a56da usb: otg: kill langwell_otg driver
The way this driver was added by f0ae849 (usb: Add Intel Langwell USB
OTG Transceiver Driver) never even compiled together with langwell_udc,
and that's the only way for it to be useful.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: stable@vger.kernel.org # v2.6.31+
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Alan Cox <alan@linux.intel.com>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-01-24 15:41:51 +02:00
Shimoda, Yoshihiro
5ea4399457 usb: renesas_usbhs: add support for SUDMAC
The SUDMAC uses 8-bit width only. So, when the driver uses SUDMAC,
we have to clear the MBW_32.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-01-24 11:33:04 +02:00
Felipe Balbi
18b7ede5f7 usb: ch9: fix up MaxStreams helper
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>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-04 15:52:42 -08:00
Greg Kroah-Hartman
ee0db58ade Merge branch 'for-gadget/next' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
* 'for-gadget/next' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb: (24 commits)
  usb: dwc3: gadget: add support for SG lists
  usb: dwc3: gadget: don't force 'LST' always
  usb: dwc3: gadget: don't return anything on prepare trbs
  usb: dwc3: gadget: re-factor dwc3_prepare_trbs()
  usb: gadget: introduce support for sg lists
  usb: renesas: pipe: convert a long if into a XOR operation
  usb: gadget: remove useless depends on Kconfig
  usb: gadget: s3c-hsudc: remove the_controller global
  usb: gadget: s3c-hsudc: use release_mem_region instead of release_resource
  usb: gadget: s3c-hsudc: Add regulator handling
  usb: gadget: s3c-hsudc: use udc_start and udc_stop functions
  usb: gadget: s3c-hsudc: move device registration to probe
  usb: gadget: s3c-hsudc: add missing otg_put_transceiver in probe
  usb: gadget: s3c-hsudc: add __devinit to probe function
  usb: gadget: s3c-hsudc: move platform_data struct to global header
  USB: EHCI: Add Marvell Host Controller driver
  USB: OTG: add Marvell usb OTG driver support
  usb: gadget: mv_udc: drop ARCH dependency
  usb: gadget: mv_udc: fix bug in ep_dequeue
  usb: gadget: enlarge maxburst bit width.
  ...
2011-12-22 14:05:19 -08:00
Felipe Balbi
898c608678 usb: gadget: introduce support for sg lists
Some controllers support scatter/gather transfers
and that might be very useful for some gadget drivers.

This means that we can make use of larger buffer
allocations which means we will have less completion
IRQs overtime, thus improving the perceived performance.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-12-21 13:24:44 +02:00
Yu Xu
a7250db363 usb: gadget: enlarge maxburst bit width.
For super speed bulk transfer, the max burst size
is 16, so that 4 bits of maxburst cannot store it.

Signed-off-by: Yu Xu <yuxu@marvell.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-12-19 12:19:50 +02:00
Greg Kroah-Hartman
121a8cdd79 Merge branch 'for-next/gadget' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
* 'for-next/gadget' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb: (50 commits)
  usb: renesas_usbhs: show error reason on usbhsh_urb_enqueu()
  usb: renesas_usbhs: add force packet remove method
  usb: renesas_usbhs: care usb_hcd_giveback_urb() status
  usb: renesas_usbhs: add usbhsh_is_running()
  usb: renesas_usbhs: disable attch irq after device attached
  usb: renesas_usbhs: care pipe sequence
  usb: renesas_usbhs: add usbhs_pipe_attach() method
  usb: renesas_usbhs: add usbhsh_endpoint_detach_all() for error case
  usb: renesas_usbhs: modify device attach method
  usb: renesas_usbhs: pop packet when urb dequeued
  usb: renesas_usbhs: add lost error value when enqueue
  usb: gadget: mv_udc: replace some debug info
  usb: gadget: mv_udc: refine suspend/resume function
  usb: gadget: mv_udc: refine the clock relative code
  usb: gadget: mv_udc: disable ISR when stopped
  usb: gadget: mv_udc: add otg relative code
  usb: gadget: Use kcalloc instead of kzalloc to allocate array
  usb: renesas_usbhs: remove the_controller_link
  usb: renesas_usbhs: add test-mode support
  usb: renesas_usbhs: call usbhsg_queue_pop() when pipe disable.
  ...
2011-12-13 09:37:40 -08:00
Qinglin Ye
c91043adaf USB: Remove the duplicate definition of HUB_SET_DEPTH
The macro HUB_SET_DEPTH is defined twice in ch11.h (introduced by
commit 0eadcc0 "usb: USB3.0 ch11 definitions" and dbe79bb "USB 3.0
Hub Changes"), so remove the duplicate one in the USB 2.0 part.

Signed-off-by: Qinglin Ye <yestyle@gmail.com>
Cc: John Youn <John.Youn@synopsys.com>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-12 14:46:47 -08:00
Michal Nazarewicz
7177aed44f usb: gadget: rename usb_gadget_driver::speed to max_speed
This commit renames the “speed” field of the usb_gadget_driver
structure to “max_speed”.  This is so that to make it more
apparent that the field represents the maximum speed gadget
driver can support.

This also make the field look more like fields with the same
name in usb_gadget and usb_composite_driver structures.  All
of those represent the *maximal* speed given entity supports.

After this commit, there are the following fields in various
structures:
* usb_gadget::speed - the current connection speed,
* usb_gadget::max_speed - maximal speed UDC supports,
* usb_gadget_driver::max_speed - maximal speed gadget driver
  supports, and
* usb_composite_driver::max_speed - maximal speed composite
  gadget supports.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-12-12 11:45:12 +02:00
Michal Nazarewicz
d327ab5b6d usb: gadget: replace usb_gadget::is_dualspeed with max_speed
This commit replaces usb_gadget's is_dualspeed field with
a max_speed field.

[ balbi@ti.com : Fixed DWC3 driver ]

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-12-12 11:45:11 +02:00
Kuninori Morimoto
f1ee56a000 usb: gadget: renesas_usbhs: add platform power control function
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-12-12 11:44:58 +02:00
Kuninori Morimoto
a49a88f108 usb: gadget: renesas_usbhs: tidyup the unit of detection_delay
detection_delay was assumed as msec

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-12-12 11:44:57 +02:00
Aman Deep
7bf01185c5 USB: Adding #define in hub_configure() and hcd.c file
This patch is in succession of previous patch
commit c842114792
        xHCI: Adding #define values used for hub descriptor

Hub descriptors characteristics #defines values are added in
hub_configure() in place of magic numbers as asked by Alan Stern.
And the indentation for switch and case is changed to be same.

Some #defines values are added in ch11.h for defining hub class
protocols and used in hub.c and hcd.c in which magic values were
used for hub class protocols.

Signed-off-by: Aman Deep <amandeep3986@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 16:20:38 -08:00
Aman Deep
c842114792 xHCI: Adding #define values used for hub descriptor
xhci-hub used some numerical values for initialisation of root hub
descriptors. #define values are addded in usb 2.0 hub specification
file and these values are used for root hub characteristics
initialisation.

Also use some #defines in places where magic numbers are being used.

Signed-off-by: Aman Deep <amandeep3986@gmail.com>
Acked-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 19:58:47 -08:00
Johan Hovold
d83b405383 USB: serial: add support for multiple read urbs
Add support for multiple read urbs to generic read implementation.

Use a static array of two read urbs for now which is enough to get a
50% throughput increase in one test setup.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-15 10:46:13 -08:00
Johan Hovold
4556143cab USB: serial: remove write_urb_busy field from usb_serial_port
Remove no longer used write_urb_busy field from struct usb_serial_port.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-15 10:33:12 -08:00
Alan Stern
968b822c00 USB: Remove the SAW_IRQ hcd flag
The HCD_FLAG_SAW_IRQ flag was introduced in order to catch IRQ routing
errors: If an URB was unlinked and the host controller hadn't gotten
any IRQs, it seemed likely that the IRQs were directed to the wrong
vector.

This warning hasn't come up in many years, as far as I know; interrupt
routing now seems to be well under control.  Therefore there's no
reason to keep the flag around any more.  This patch (as1495) finally
removes it.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-14 16:46:06 -08:00
Linus Torvalds
1eb6337835 Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (348 commits)
  [media] pctv452e: Remove bogus code
  [media] adv7175: Make use of media bus pixel codes
  [media] media: vb2: fix incorrect return value
  [media] em28xx: implement VIDIOC_ENUM_FRAMESIZES
  [media] cx23885: Stop the risc video fifo before reconfiguring it
  [media] cx23885: Avoid incorrect error handling and reporting
  [media] cx23885: Avoid stopping the risc engine during buffer timeout
  [media] cx23885: Removed a spurious function cx23885_set_scale()
  [media] cx23885: v4l2 api compliance, set the audioset field correctly
  [media] cx23885: hook the audio selection functions into the main driver
  [media] cx23885: add generic functions for dealing with audio input selection
  [media] cx23885: fixes related to maximum number of inputs and range checking
  [media] cx23885: Initial support for the MPX-885 mini-card
  [media] cx25840: Ensure AUDIO6 and AUDIO7 trigger line-in baseband use
  [media] cx23885: Enable audio line in support from the back panel
  [media] cx23885: Allow the audio mux config to be specified on a per input basis
  [media] cx25840: Enable support for non-tuner LR1/LR2 audio inputs
  [media] cx23885: Name an internal i2c part and declare a bitfield by name
  [media] cx23885: Ensure VBI buffers timeout quickly - bugfix for vbi hangs during streaming
  [media] cx23885: remove channel dump diagnostics when a vbi buffer times out
  ...

Fix up trivial conflicts in drivers/misc/altera-stapl/altera.c (header
file rename vs add)
2011-10-31 15:42:54 -07:00