Commit Graph

10928 Commits

Author SHA1 Message Date
Johan Hovold
5e4211f1c4 USB: spcp8x5: fix device initialisation at open
Do not use uninitialised termios data to determine when to configure the
device at open.

Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-10 11:00:49 -07:00
Johan Hovold
21886725d5 USB: f81232: fix device initialisation at open
Do not use uninitialised termios data to determine when to configure the
device at open.

This also prevents stack data from leaking to userspace.

Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-10 11:00:48 -07:00
Yuan-Hsin Chen
b84a8dee23 usb: gadget: add Faraday fotg210_udc driver
Faraday fotg210 udc driver supports only Bulk transfer so far.
fotg210 could be configured as an USB2.0 peripheral.

This driver is tested with mass storage gadget driver on Faraday
EVB a369.

Signed-off-by: Yuan-Hsin Chen <yhchen@faraday-tech.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:58:11 +03:00
Andrzej Pietrasiewicz
b3df2faacb usb: gadget: f_rndis: add configfs support
f_rndis learns about configfs so we can, eventually,
remove in-kernel gadget drivers.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:58:10 +03:00
Andrzej Pietrasiewicz
4e75e72756 usb: gadget: f_rndis: use usb_gstrings_attach
use new usb_gstrings_attach interface

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:58:10 +03:00
Andrzej Pietrasiewicz
76da66d170 usb: gadget: rndis: init & exit rndis at module load/unload
This is required in preparation for using usb_gstrings_attach.

The rndis initialization so far has been performed on the first
occurence of rndis_bind(), but the condition to check it (first
or not first) was "borrowed" from strings handling.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:58:09 +03:00
Andrzej Pietrasiewicz
9bd4a10e1b usb: gadget: ether: convert to new interface of f_rndis
use new interface so old one can be removed.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:58:09 +03:00
Andrzej Pietrasiewicz
f466c63538 usb: gadget: f_rndis: convert to new function interface with backward compatibility
Converting rndis to the new function interface requires converting
the USB rndis' function code and its users.

This patch converts the f_rndis.c to the new function interface.

The file is now compiled into a separate usb_f_rndis.ko module.

The old function interface is provided by means of a preprocessor
conditional directives. After all users are converted, the old interface
can be removed.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:58:08 +03:00
Andrzej Pietrasiewicz
02832e56f8 usb: gadget: f_subset: add configfs support
f_subset learns about configfs so we can, eventually,
remove in-kernel gadget drivers.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:58:08 +03:00
Andrzej Pietrasiewicz
74bf963d1d usb: gadget: f_subset: use usb_gstrings_attach
use the new usb_gstrings_attach interface.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:58:07 +03:00
Andrzej Pietrasiewicz
8af5232d6f usb: gadget: ether: convert to new interface of f_subset
teach ethernet code about the new interface of f_subset so
the old one can eventually be removed.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:58:07 +03:00
Andrzej Pietrasiewicz
8cedba7c73 usb: gadget: f_subset: convert to new function interface with backward compatibility
Converting ecm subset to the new function interface requires converting
the USB subset's function code and its users.

This patch converts the f_subset.c to the new function interface.

The file is now compiled into a separate usb_f_subset.ko module.

The old function interface is provided by means of a preprocessor
conditional directives. After all users are converted, the old interface
can be removed.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:58:06 +03:00
Andrzej Pietrasiewicz
cf99e8c689 usb: gadget: multi: Remove unused include
cleanup only, no functional changes.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:58:06 +03:00
Andrzej Pietrasiewicz
17b80976f0 usb: gadget: f_eem: add configfs support
f_eem learns about our configfs interface so we
can remove in-kernel gadget drivers in future.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:58:00 +03:00
Andrzej Pietrasiewicz
998da497ec usb: gadget: f_eem: use usb_gstrings_attach
use the new usb_gstrings_attach interface

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:57:47 +03:00
Andrzej Pietrasiewicz
c96022ded7 usb: gadget: f_eem: remove compatibility layer
There are no old function interface users left, so the old interface
can be removed.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:57:47 +03:00
Andrzej Pietrasiewicz
94b5573e97 usb: gadget: ether: convert to new interface of f_eem
use new interface so old one can be removed.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:57:46 +03:00
Andrzej Pietrasiewicz
b29002a157 usb: gadget: f_eem: convert to new function interface with backward compatibility
Converting eem to the new function interface requires converting
the USB eem's function code and its users.

This patch converts the f_eem.c to the new function interface.

The file is now compiled into a separate usb_f_eem.ko module.

The old function interface is provided by means of a preprocessor
conditional directives. After all users are converted, the old interface
can be removed.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:57:46 +03:00
Andrzej Pietrasiewicz
9c62ce83e4 usb: gadget: ether: convert to new interface of f_ecm
moving to new interface so we can remove the older one.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:57:45 +03:00
Andrzej Pietrasiewicz
bf4277c73a usb: gadget: u_ether: allow getting binary-form host address
helper function to copy MAC address to proper place.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:57:45 +03:00
Andrzej Pietrasiewicz
83408745b2 usb: gadget: f_phonet: add configfs support
f_phonet learns about configfs so we can remove
in-kernel gadget drivers.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:57:39 +03:00
Andrzej Pietrasiewicz
b904d0811d usb: gadget: nokia: convert to new interface of f_ecm
this will let us deprecate (and remove) the old interface.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:32:23 +03:00
Andrzej Pietrasiewicz
0383070e8d usb: gadget: f_phonet: remove compatibility layer
There are no old function interface users left, so the old interface
can be removed.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:31:55 +03:00
Andrzej Pietrasiewicz
83167f12da usb: gadget: nokia: convert to new interface of f_phonet
use the new interface which will allow us to deprecate the
legacy way of binding functions.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:31:39 +03:00
Andrzej Pietrasiewicz
fcbdf12ebe usb: gadget: f_phonet: convert to new function interface with backward compatibility
Converting f_phonet to the new function interface requires converting
the f_phonet's function code and its users.

This patch converts the f_phonet.c to the new function interface.

The file is now compiled into a separate usb_f_phonet.ko module.

The old function interface is provided by means of preprocessor
conditional directives. After all users are converted, the old interface
can be removed.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:31:07 +03:00
Andrzej Pietrasiewicz
0189e63ad8 usb: gadget: phonet: move global dev variable to its user
cleanup patch only in preparation for configfs.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:30:46 +03:00
Andrzej Pietrasiewicz
9b2252cace usb: gadget: f_obex: remove compatibility layer
There are no old function interface users left, so the old interface
can be removed.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:29:08 +03:00
Andrzej Pietrasiewicz
3a34344979 usb: gadget: nokia: convert to new interface of f_obex
preparation to use configfs-based approach on g_nokia.ko

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:28:51 +03:00
Andrzej Pietrasiewicz
1af877c409 usb: gadget: f_obex: use usb_gstrings_attach
use the new usb_gstrings_attach interface

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:28:19 +03:00
Andrzej Pietrasiewicz
da92801c64 usb: gadget: f_ecm: add configfs support
f_ecm learns about our new configfs-based binding.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:27:54 +03:00
Andrzej Pietrasiewicz
06b72598e8 usb: gadget: f_ecm: use usb_gstrings_attach
use the new usb_gstrings_attach interface.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:27:14 +03:00
Andrzej Pietrasiewicz
a38a275030 usb: gadget: cdc2: convert to new interface of f_ecm
f_ecm has been converted to new configfs infrastructure,
fixing cdc2 gadget driver.

[ balbi@ti.com : fixed a bunch of errors when adding ECM function ]

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:26:56 +03:00
Andrzej Pietrasiewicz
fee562a645 usb: gadget: f_ecm: convert to new function interface with backward compatibility
Converting ecm to the new function interface requires converting
the USB ecm's function code and its users.

This patch converts the f_ecm.c to the new function interface.

The file is now compiled into a separate usb_f_ecm.ko module.

The old function interface is provided by means of a preprocessor
conditional directives. After all users are converted, the old interface
can be removed.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:16:02 +03:00
Andrzej Pietrasiewicz
aa83c6adf7 usb: gadget: add helpers for configfs support for USB Ethernet
All USB Ethernet functions will have very similar attributes in configfs.

This patch provides helper definitions to ease writing the functions and
reduce source code duplication.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:15:43 +03:00
Andrzej Pietrasiewicz
e730660378 usb: gadget: f_ncm: add configfs support
Add configfs support to the NCM function driver so
that we can, eventually, get rid of kernel-based
gadget drivers.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:15:02 +03:00
Andrzej Pietrasiewicz
8feffd0030 usb: gadget: f_ncm: use usb_gstrings_attach
Trivial patch making use of the new usb_gstrings_attach
interface.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:13:57 +03:00
Andrzej Pietrasiewicz
dd67a17f2b usb: gadget: f_ncm: remove compatibility layer
There are no old function interface users left, so the old interface
can be removed.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:13:22 +03:00
Andrzej Pietrasiewicz
9575bcf9c0 usb: gadget: ncm: convert to new function interface
Utilize our new configfs-based interface.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:12:52 +03:00
Andrzej Pietrasiewicz
40d133d7f5 usb: gadget: f_ncm: convert to new function interface with backward compatibility
Converting ncm to the new function interface requires converting
the USB ncm's function code and its users.

This patch converts the f_ncm.c to the new function interface.

The file is now compiled into a separate usb_f_ncm.ko module.

The old function interface is provided by means of a preprocessor
conditional directives. After all users are converted, the old interface
can be removed.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:12:18 +03:00
Andrzej Pietrasiewicz
bcd4a1c40b usb: gadget: u_ether: construct with default values and add setters/getters
Add an interface to create a struct netdev_dev filled with default values, an
interface which makes it an interface to fill the struct with useful values and
an interface to read the values set.

The patch also adds an interface to register the net device associated with an
ethernet-over-usb link.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:11:51 +03:00
Andrzej Pietrasiewicz
cbbd14a902 usb: gadget: rndis: convert into module
In order to convert to configfs the usb functions need to be converted
to a new interface and compiled as modules. This patch creates an rndis
module which will be used by the new functions. After all users of
f_rndis are converted to the new interface, this module can be
merged with f_rndis module.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:11:33 +03:00
Andrzej Pietrasiewicz
f1a1823ff2 usb: gadget: u_ether: convert into module
u_ether.c has been #include'd by all gadgets which implement
USB Ethernet functions. In order to add configfs support,
the f_ecm.c, f_eem.c, f_ncm.c, f_subset.c, f_rndis.c need to be
converted into modules and must not be #include'd. Consequently,
the u_ether.c needs to be a module too, in a manner similar
to u_serial.c. The resulting module should not take any parameters,
so they are pushed to the current users of it, that is ether.c,
g_ffs.c, multi.c, ncm.c, nokia.c.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:10:57 +03:00
UCHINO Satoshi
d68c277b50 usb: gadget: f_mass_storage: add missing memory barrier for thread_wakeup_needed
Without this memory barrier, the file-storage thread may fail to
escape from the following while loop, because it may observe new
common->thread_wakeup_needed and old bh->state which are updated by
the callback functions.

	/* Wait for the CBW to arrive */
	while (bh->state != BUF_STATE_FULL) {
		rc = sleep_thread(common);
		if (rc)
			return rc;
	}

Cc: stable@vger.kernel.org
Signed-off-by: UCHINO Satoshi <satoshi.uchino@toshiba.co.jp>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:10:34 +03:00
Jassi Brar
eb127cb519 USB: gadget: f_uac2: Fix broken prm to uac2 mapping
prm_to_uac2() is broken because it tests against pointer it itself
mapped onto, which will never be different.
Fix the mapping by adding pointer to parent chip in each rtd param
and removing the prm_to_uac2().

Reported-by: Julien Rouviere <jrouviere@qualistream.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:10:23 +03:00
Alexey Khoroshilov
f37d49ad6e usb: gadget: r8a66597-udc: do not unlock unheld spinlock in r8a66597_sudmac_irq()
r8a66597_irq() processes sudmac part (r8a66597_sudmac_irq()) before locking r8a66597->lock.
But transfer_complete(), that is called inside (r8a66597_sudmac_irq()->sudmac_finish()->transfer_complete()),
expects r8a66597->lock is locked. As a result unheld spinlock can be unlocked.

The patch just moves locking before calling r8a66597_sudmac_irq().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-10 17:08:48 +03:00
Greg Kroah-Hartman
141dc40ee3 Merge 3.10-rc5 into usb-next
We need the changes in this branch.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-08 21:27:51 -07:00
Greg Kroah-Hartman
1ba7055af2 Merge 3.10-rc5 into tty-next 2013-06-08 21:23:33 -07:00
Greg Kroah-Hartman
1c83d94ff6 xHCI: USB 2.0 Link PM and misc cleanup patches
Hi Greg,
 
 Here's six patches to be queued for 3.11.
 
 The first four add support for a new type of host hardware-managed USB
 2.0 Link Power Management.  Hosts with BESL support, including Intel
 Haswell ULT systems, will now be able to have USB 2.0 devices go into
 the lower power link state (L1) in between packets.  These patches have
 been tested on Haswell ULT platforms with USB 2.0 webcams that support
 Link PM.
 
 The other two patches are clean up.  One from Julius clarifies the xHCI
 endpoint context debugging to make it consistent with standard endpoint
 addresses, instead of xHCI endpoint context indexes.  The one from Alex
 changes the xHCI driver to be consistent about passing a void pointer to
 the xHCI IRQ handler.
 
 Sarah Sharp
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJRsPbvAAoJEBMGWMLi1Gc5Gq8P/RZ31S1KWeB0psXXYbrm9Slq
 79VP3cBYdx7FzBw87bDGDQ3KNsircMLkwVpWjpP3K3y3JFRgK8iUvs4rmd1xiqC3
 Mx6UjHYhiIDKukI79Dg7hHFizD0dx3u6iQc+CBagQs7YH7o/EEFwX4UaNA3LbYq8
 jC6mrAGPHjR5kfU5wtYizFLZo5FMlquGfNjCg8xabl3aOqEDtOZ3K8B2PVYfVMzh
 RC+dat4cCyBJXSXoA/vqXZ7OOLFM+knTKWlaYevemA2a4PYGd25uMziTTto9TA9I
 KrUx0UQa7s8PfCWsnX+sW152dUeVaeamDcxAKaYv2XcXDZhRuZQSTdsmDpmWILm/
 pqEaQJgSQhq0dbmNG1mlaSw9MXO85Nq9eetkAgJ1wKmF/P1z7Q31KH0Ss/5MvjHG
 VjoN3mo5Tb0GlitIoB/SVsMqjlUMtCGdJSG7z16M6G9CQd2Qu8riJgg9K8ZdBYty
 IrjR/ypeoOJWtHd3CdnyFcyIN9eBaDpjALSM2WWexndS7+tLmo67xWgDZC19iX3/
 Q78nHdcjVBhcV/vH7DlF7PQA+fXkBfvkIelPqgxhvd5Wia8j5Qtm61QkPxZ5zDac
 3tGmW8JgRLCVMzVccE+0I4EypWf6+UWadpJx/YIdL12FEWs8Qv+W3IjwLSmSo4Gk
 Vt8TbDSIVBezNXrLDpN7
 =NDUW
 -----END PGP SIGNATURE-----

Merge tag 'for-usb-next-2013-06-06' of git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-next

Sarah writes:

xHCI: USB 2.0 Link PM and misc cleanup patches

Hi Greg,

Here's six patches to be queued for 3.11.

The first four add support for a new type of host hardware-managed USB
2.0 Link Power Management.  Hosts with BESL support, including Intel
Haswell ULT systems, will now be able to have USB 2.0 devices go into
the lower power link state (L1) in between packets.  These patches have
been tested on Haswell ULT platforms with USB 2.0 webcams that support
Link PM.

The other two patches are clean up.  One from Julius clarifies the xHCI
endpoint context debugging to make it consistent with standard endpoint
addresses, instead of xHCI endpoint context indexes.  The one from Alex
changes the xHCI driver to be consistent about passing a void pointer to
the xHCI IRQ handler.

Sarah Sharp
2013-06-06 15:21:02 -07:00
Thomas Pugliese
3a57aa8161 wusbcore wire adapter: ignore HWA_NOTIF_BPST_ADJ notifications
No action is needed for the HWA_NOTIF_BPST_ADJ event.  Ignore it instead
of printing a warning to the log since these events can happen dozens of
times per second.

Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-06 13:11:14 -07:00
Thomas Pugliese
ee0218fa43 USB: wusbcore: add HWA-specific fields to usb_rpipe_descriptor
This patch adds the HWA specific members to struct usb_rpipe_descriptor
and sets them correctly based on the wireless endpoint compananion
descriptor.

Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-06 12:14:39 -07:00
Thomas Pugliese
edc40a4bbe wusbhc: disable suspend and resume on the root hub.
Suspend and resume are not currently supported on the wireless root hub.
Remove the suspend and resume op functions in the host controller driver
to avoid constant error messages in the system log.

Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-06 12:14:38 -07:00
Alexey Khoroshilov
de5535f5f5 USB: fix PTR_ERR translation in init_usb_class()
There is a misprint in init_usb_class():
IS_ERR is used to get error code instead of PTR_ERR.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-06 12:14:38 -07:00
Thomas Pugliese
7d9852a88c wusbcore: reduce keepalive threshold from timeout/2 to timeout/3
This patch reduces the keepalive threshold of WUSB host controllers from
timeout/2 to timeout/3.  The keepalive timer fires every timeout/2 ms, but
due to rounding errors and jitter, the host may decide not to send a
keepalive at timeout/2.  By the time the next timer fires, a full timeout
period may have expired causing the device to be disconnected without ever
having been sent a keepalive.  Changing the keepalive threshold to
timeout/3 ensures that at least one keepalive will be sent before a device
is disconnected.  The patch also updates the code to use msecs_to_jiffies
consistently.

Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-06 11:19:27 -07:00
Arnd Bergmann
d9ea21a779 usb: host: make USB_ARCH_HAS_?HCI obsolete
The three options USB_ARCH_HAS_{EHCI,OHCI,XHCI} are all well beyond
their recommended shelf life. They have caused numerous build failures
over the years because they are never completely correct, and with
the move to splitting out the platform specific back-ends out of the
driver, there is no real need for them any more. Also, the use of making
USB_ARCH_HAS_HCD depend on it is questionable since one can always enable
dummy_hc these days.

This patch enables them unconditionally for all platforms and
architectures, which means it is now possible to build host controller
drivers for machines that are known not to come with this hardware,
but that is just how we treat most other drivers.

In order to minimise the impact on existing architecture code and
defconfig files, all the Kconfig are left present for now. All platforms
that currently do 'select USB_ARCH_HAS_*' should subsequently be changed
not to select that. All drivers depending on USB_ARCH_HAS_HCD should
be changed to depend on USB_SUPPORT instead.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-06 11:16:44 -07:00
Arnd Bergmann
358e91175c USB: OHCI: remove bogus #error
The OHCI host controller driver can be built standalone now,
without enabling any of the available bus glue drivers, so
there is not really a reason to error out here:

drivers/usb/host/ohci-hcd.c:1258: error:
 #error "missing bus glue for ohci-hcd"  #error "missing bus glue for ohci-hcd"

This follows the same change done in ehci recently as 843e56c0
"USB: EHCI: remove bogus #error" and hopefully avoids future
merge conflicts in this list.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-06 11:16:44 -07:00
Dan Williams
73228a0538 USB: option,zte_ev: move most ZTE CDMA devices to zte_ev
Per some ZTE Linux drivers I found for the AC2716, the following patch
moves most ZTE CDMA devices from option to zte_ev.  The blacklist stuff
that option does is not required with zte_ev, because it doesn't
implement any of the send_setup hooks which the blacklist suppressed.

I did not move the 2718 over because I could not find any ZTE Linux
drivers for that device, nor even any Windows drivers.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-06 09:06:25 -07:00
Bjørn Mork
b8a24e6281 USB: option: blacklist network interface on Huawei E1820
The mode used by Windows for the Huawei E1820 will use the
same ff/ff/ff class codes for both serial and network
functions.

Reported-by: Graham Inggs <graham.inggs@uct.ac.za>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-06 09:02:36 -07:00
Johan Hovold
9eecf22d2b USB: whiteheat: fix broken port configuration
When configuring the port (e.g. set_termios) the port minor number
rather than the port number was used in the request (and they only
coincide for minor number 0).

Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-06 09:02:36 -07:00
Mathias Nyman
17f34867e9 usb: add usb2 Link PM variables to sysfs and usb_device
Adds abitilty to tune L1 timeout (inactivity timer for usb2 link sleep)
and BESL (best effort service latency)via sysfs.

This also adds a new usb2_lpm_parameters structure with those variables to
struct usb_device.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2013-06-05 16:48:40 -07:00
Mathias Nyman
a558ccdcc7 usb: xhci: add USB2 Link power management BESL support
usb 2.0 devices with link power managment (LPM) can describe their idle link
timeouts either in BESL or HIRD format, so far xHCI has only supported HIRD but
later xHCI errata add BESL support as well

BESL timeouts need to inform exit latency changes with an evaluate
context command the same way USB 3.0 link PM code does.
The same xhci_change_max_exit_latency() function is used as with USB3
but code is pulled out from #ifdef CONFIG_PM as USB2.0 BESL LPM
funcionality does not depend on CONFIG_PM.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2013-06-05 16:48:24 -07:00
Mathias Nyman
b6e76371c8 usb: xhci: define port register names and use them instead of magic numbers
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2013-06-05 16:47:21 -07:00
Mathias Nyman
b630d4b9d0 usb: xhci: check usb2 port capabilities before adding hw link PM support
Hardware link powermanagement in usb2 is a per-port capability.
Previously support for hw lpm was enabled for all ports if any usb2 port supported it.

Now instead cache the capability values and check them for each port individually

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2013-06-05 16:46:19 -07:00
Alex Shi
851ec164b1 usb/xhci: unify parameter of xhci_msi_irq
According to Felipe and Alan's comments the second parameter of irq
handler should be 'void *' not a specific structure pointer.
So change it.

Signed-off-by: Alex Shi <alex.shi@intel.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2013-06-05 16:45:33 -07:00
Julius Werner
01c5f4477d usb: xhci-dbg: Display endpoint number and direction in context dump
When CONFIG_XHCI_HCD_DEBUGGING is activated, the XHCI driver can dump
device and input contexts to the console. The endpoint contexts in that
dump are labeled "Endpoint N Context", where N is the XHCI endpoint
index (DCI - 1). This can be very confusing, especially for people who
are not that familiar with the XHCI specification. This patch introduces
an xhci_get_endpoint_address function (as a counterpart to the reverse
xhci_get_endpoint_index), and uses it to additionally display the
endpoint number and direction when dumping contexts, which are much more
commonly used concepts in USB.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2013-06-05 16:41:47 -07:00
Johan Hovold
f4488035ab USB: serial: fix TIOCMIWAIT return value
Fix regression introduced by commit 143d9d9616 ("USB: serial: add
tiocmiwait subdriver operation") which made the ioctl operation return
ENODEV rather than ENOIOCTLCMD when a subdriver TIOCMIWAIT
implementation is missing.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-05 08:34:42 -07:00
Michael Grzeschik
a2cc81d315 usb: gadget: uvc: Implement videobuf2 .wait_prepare and .wait_finish operations
Those optional operations are used to release and reacquire the queue
lock when videobuf2 needs to perform operations that sleep for a long
time, such as waiting for a buffer to be complete. Implement them to
avoid blocking qbuf or streamoff calls when a dqbuf is in progress.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-04 23:27:50 +03:00
Johan Hovold
a26f009a07 USB: mos7720: fix hardware flow control
The register access to enable hardware flow control depends on the
device port number and not the port minor number.

Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-04 10:17:10 -07:00
Johan Hovold
c1ec1bcf0c USB: keyspan: remove unused endpoint-array access
Remove the no longer used endpoint-array access completely.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-04 10:17:09 -07:00
Johan Hovold
a07088098a USB: keyspan: fix bogus array index
The outcont_endpoints array was indexed using the port minor number
(which can be greater than the array size) rather than the device port
number.

Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-04 10:17:09 -07:00
Johan Hovold
d8a1d0d54d USB: zte_ev: fix broken open
Remove bogus port-number check in open and close, which prevented this
driver from being used with a minor number different from zero.

Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-04 10:17:09 -07:00
Lee Jones
313bdb11e5 usb: musb: ux500: add device tree probing support
This patch will allow ux500-musb to be probed and configured solely from
configuration found in Device Tree.

Cc: Rob Herring <rob.herring@calxeda.com>
Cc: linux-usb@vger.kernel.org
Cc: devicetree-discuss@lists.ozlabs.org
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2013-06-04 11:12:05 +02:00
Lee Jones
2968da0b2c usb: musb: ux500: attempt to find channels by name before using pdata
If we can ever get to a state where we can solely search for DMA channels
by name, this will almost completely alleviate the requirement to pass
copious amounts of information though platform data. Here we take the
first step towards this. The next step will be to enable Device Tree
complete with name<->event_line mapping.

Cc: linux-usb@vger.kernel.org
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2013-06-04 11:12:04 +02:00
Lee Jones
5f6091a023 usb: musb: ux500: harden checks for platform data
In its current state, the ux500-musb driver uses platform data pointers
blindly with no prior checking. If no platform data pointer is passed
this will Oops the kernel. In this patch we ensure platform data and
board data are present prior to using them.

Cc: linux-usb@vger.kernel.org
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2013-06-04 11:12:04 +02:00
Lee Jones
1e6eebb4e9 usb: musb: ux500: take the dma_mask from coherent_dma_mask
The dma_mask will always be the same as the coherent_dma_mask, so let's
cut down on the platform_data burden and set it as such in the driver.
This also saves us from supporting it separately when we come to enable
this driver for Device Tree.

Cc: linux-usb@vger.kernel.org
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2013-06-04 11:12:03 +02:00
Lee Jones
a20b1b791e usb: musb: ux500: move the MUSB HDRC configuration into the driver
The MUSB HDRC configuration never changes between each of the ux500
supported platforms, so there's little point passing it though platform
data. If we set it in the driver instead, we can make good use of it
when booting with either ATAGs or Device Tree.

Cc: linux-usb@vger.kernel.org
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2013-06-04 11:12:03 +02:00
Lee Jones
be2dbb09a0 usb: musb: ux500: move channel number knowledge into the driver
For all ux500 based platforms the maximum number of end-points are used.
Move this knowledge into the driver so we can relinquish the burden from
platform data. This also removes quite a bit of complexity from the driver
and will aid us when we come to enable the driver for Device Tree.

Cc: linux-usb@vger.kernel.org
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2013-06-04 11:12:02 +02:00
Luca Olivetti
0c967e7ecd USB: serial: pl2303 works at 500kbps
My PL2303HX works at 500kbps after applying this patch.
I suppose that it could work at other non standard speeds since this fix

"correctly handle baudrates above 115200"
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/usb/serial/pl2303.c?id=8d48fdf689fed2c73c493e5146d1463689246442

came after this one

"fix baud rate handling in case of unsupported values"
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/usb/serial/pl2303.c?id=25b8286805e856c8c7fda127018e31032c918015

but I only can test it with 500000.
Patch made against mainline but tested with 3.4.45

Signed-off-by: Luca Olivetti <luca@ventoso.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-03 14:33:26 -07:00
Rafael J. Wysocki
45f0a85c82 PM / Runtime: Rework the "runtime idle" helper routine
The "runtime idle" helper routine, rpm_idle(), currently ignores
return values from .runtime_idle() callbacks executed by it.
However, it turns out that many subsystems use
pm_generic_runtime_idle() which checks the return value of the
driver's callback and executes pm_runtime_suspend() for the device
unless that value is not 0.  If that logic is moved to rpm_idle()
instead, pm_generic_runtime_idle() can be dropped and its users
will not need any .runtime_idle() callbacks any more.

Moreover, the PCI, SCSI, and SATA subsystems' .runtime_idle()
routines, pci_pm_runtime_idle(), scsi_runtime_idle(), and
ata_port_runtime_idle(), respectively, as well as a few drivers'
ones may be simplified if rpm_idle() calls rpm_suspend() after 0 has
been returned by the .runtime_idle() callback executed by it.

To reduce overall code bloat, make the changes described above.

Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Tested-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Kevin Hilman <khilman@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
2013-06-03 21:49:52 +02:00
Manjunath Goudar
31fc518b94 USB: OHCI: add a name for the platform-private field
This patch adds an ohci->priv field for private use by OHCI
platform drivers.

Until now none of the platform drivers has used this private space,
but that's about to change in the next patch of this series.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-03 11:03:18 -07:00
Manjunath Goudar
928fb68e23 USB: OHCI: make ohci-platform a separate driver
This patch splits the ohci-platform code from ohci-hcd out
into its own separate driver module.This work is part of enabling
multi-platform kernels on ARM.

In V2:
  -Passed "hcd" argument instead of "ohci" in ohci_setup() because it is
   using "struct usb_hcd" argument.
In V3:
  -Directly passed "hcd" argument not required to call ohci_to_hcd() function.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-03 11:02:26 -07:00
Yijing Wang
2373536537 usb, chipidea: remove redundant D0 power state set
Pci_enable_device() will set device power state to D0,
so it's no need to do it again in ci13xxx_pci_probe().

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-03 11:01:36 -07:00
Julius Werner
06a962fa7f usb: misc: usb3503: Remove 100ms sleep on reset, conform to data sheet
The usb3503 driver sleeps a flat 100ms when resetting the chip, with a
comment about waiting for the reference clock. This seems to be a
board-specific detail that should not hold up boot across all platforms.
This patch reduces the sleep to the 4ms initialization delay that the
chip itself actually requires (as per its data sheet). If certain boards
require more time to set up the reference clock, they should change this
through local patches or add a proper, configurable synchronization
mechanism.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-03 11:01:09 -07:00
Julius Werner
ccf92c9413 usb: misc: usb3503: Fix up whitespace
Remove an erroneous tab that should be a space.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-03 11:01:08 -07:00
Thomas Pugliese
1a81f8814c Allow the USB HCD to create Wireless USB root hubs
This patch adds Wireless USB root hub support to the USB HCD.  It allows
the HWA to create its root hub which previously failed because the HCD
treated wireless root hubs the same as USB2 high speed hubs.  The creation
of the root hub would fail in that case due to lack of TTs which wireless
root hubs do not support.

Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-03 10:52:40 -07:00
Yuan-Hsin Chen
2c7c658a23 usb: host: fusbh200-hcd: rename two functions
Remove redundant "_fusbh200_" from fusbh200_hcd_fusbh200_probe
and fusbh200_hcd_fusbh200_remove

Signed-off-by: Yuan-Hsin Chen <yhchen@faraday-tech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-03 10:52:40 -07:00
Wei Shuai
88f3ec2703 USB: serial: add support Infineon modem USB flashloader driver
If you want to download Infineon modem via USB, this Infineon USB
flashloader driver is required.

Signed-off-by: Wei Shuai <cpuwolf@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-03 10:52:40 -07:00
Richard Weinberger
8a2f132a01 USB: serial: Add Option GTM681W to qcserial device table.
The Option GTM681W uses a qualcomm chip and can be
served by the qcserial device driver.

Signed-off-by: Richard Weinberger <richard@nod.at>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-03 10:33:22 -07:00
Robert Butora
6529591e3e USB: Serial: cypress_M8: Enable FRWD Dongle hidcom device
The patch adds a new HIDCOM device and does not affect other devices
driven by the cypress_M8 module. Changes are:
- add VendorID ProductID to device tables
- skip unstable speed check because FRWD uses 115200bps
- skip reset at probe which is an issue workaround for this
particular device.

Signed-off-by: Robert Butora <robert.butora.fi@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-03 10:33:10 -07:00
Ruchika Kharwar
81fbf101f2 usb: phy: omap-usb3: updated dpll M,N values to support DRA7xx devices
Addition of the M and N recommended values for the USB3 PHY DPLL.
Sysclk for DRA7xx is 20MHz.

This yields:
Clk = 20MHz * M/(N+1) = 20MHz * 1000 /(7+1) = 2.5 Ghz

Signed-off-by: Ruchika Kharwar <ruchika@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-01 00:22:49 +03:00
Yijing Wang
f016a16d8c usb: dwc3: remove redundant D0 power state set
Pci_enable_device() will set device power state to D0,
so it's no need to do it again in dwc3_pci_probe().

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-01 00:21:45 +03:00
Manjunath Goudar
c1117afb85 USB: OHCI: make ohci-pci a separate driver
This patch splits the PCI portion of ohci-hcd out into its
own separate driver module, called ohci-pci.

The major point of difficulty lies in ohci-pci's many vendor- and
device-specific workarounds.  Some of them have to be applied before
calling ohci_start() some after, which necessitates a fair amount of
code motion.  The other platform drivers require much smaller changes.

The complete sb800_prefetch() function moved to ohci-q.c,because its
only related to ohci-pci driver.

USB_OHCI_HCD_PCI symbol no longer dependence on STB03xxx, PPC_MPC52xx and
USB_OHCI_HCD_PPC_OF that's what removed.

V2:
  - few specific content of pci related code in ohci_pci_start function has been moved to ohci_pci_reset
    and rest of the generic code is written in ohci_start of ohci-hcd.c file.
V3:
 - ohci_restart() has been called in ohci_pci_reset() function for to reset the ohci pci.

V4:
 -sb800_prefetch() moved to ohci-q.c,because its only related to ohci-pci.
 -no longer _creating_ CONFIG_USB_OHCI_PCI,creating CONFIG_USB_OHCI_HCD_PCI.
 -overrides renamed with pci_override,its giving proper meaning.

V5:
 -sb800_prefetch() moved to pci-quirks.c,because its only related to pci.

V6:
 -sb800_prefetch() function has been moved to pci-quirks.c made as separate patch in 2/3.
 -Most of the generic ohci pci changes moved in 2/3 patch,now this is complete  ohci-pci separation patch.

V7:
 -Unrelated include file has been removed from ohci.h file.

V8:
 -USB_OHCI_HCD_PCI symbol does not dependence on STB03xxx, PPC_MPC52xx and USB_OHCI_HCD_PPC_OF.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30 21:36:03 +09:00
Manjunath Goudar
2621d0119e USB: OHCI: Generic changes to make ohci-pci a separate driver
Note that this changes is part of separating the ohci pci host controller
driver from ohci-hcd host code.
This contains :
     -Moved sb800_prefetch() function from ohci-pci.c to pci-quirks.c file
      and EXPORTed, this is part of the effort to move the ohci pci related
      code to generic pci code.
     -Passed "device" argument instead  of "ohci_hcd" in sb800_prefetch()
      function to avoid extra include file in pci-quirks.c.

V2:
     -Passed "device" argment instead of "pci_dev", then we use to_pci_dev()
      to get the "pci_dev" structure.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30 21:36:03 +09:00
Manjunath Goudar
95e44d44fc USB: OHCI: prepare to make ohci-hcd a library module
This patch prepares ohci-hcd for being split up into a core
library and separate platform driver modules.  A generic
ohci_hc_driver structure is created, containing all the "standard"
values, and a new mechanism is added whereby a driver module can
specify a set of overrides to those values.  In addition the
ohci_restart(),ohci_suspend() and ohci_resume() routines need
to be EXPORTed for use by the drivers.

Added ohci_setip(() and ohci_start() routine for to start the generic
controller rather than each having its own idiosyncratic approach.
This allow to clean duplicated code in most of SOC driver

In V2:
 -ohci_hcd_init() ohci_run() and ohci_stop() are not made non-static.
 -Adds the ohci_setup() and ohci_start() routine.

In V3:
 -purpose of ohci_setup() and ohci_start() function description written in the patch
  description.
 -ohci_init() are not made non-static but now called beginning of the ohci_restart().
 -ohci_run() signature change reverted back.
 -unrelated changes removed.
 -duplicate comment line removed.
 -inline ohci_suspend() and ohci_resume() is not needed so removed from ohci.h file.

In V4:
 -ohci-init() EXPORTed because it is called by all bus glue modules.
 -ohci-setup() removed from 1/2 added into 2/2 patch.

In V5:
 -Again ohci_setup() is added and EXPORTed because to replace the ohci_init() from
  all bus glues.
 -ohci_init() is not made non-static function.

In V6:
  -ohci_init() call is removed from ohci_quirk_nec_worker(), because it is already called in ohci_restart().

In V8:
  -ohci_hcd_init() is called by ohci_setup() to make generic ohci initialization in all ohci drivers.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30 21:36:03 +09:00
Alan Stern
f467ff4c7d USB: FHCI: upgrade the isochronous API
This patch attempts to fix the isochronous API in the fhci-hcd
driver.  There are two problems with the current code:

	ed->last_iso is used but not set anywhere.  The patch changes
	its name to ed->next_iso and uses it to store the frame number
	of the next available slot in the isochronous stream.

	urb->start_frame isn't set when the URB_ISO_ASAP flag is off.
	The patch sets it to the next available slot if the stream is
	in use, or the current frame otherwise.

This won't give the right behavior when an underrun occurs, but I
don't know enough about the driver to handle that case.

Unfortunately, I don't have any way to test these changes.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Anton Vorontsov <avorontsov@ru.mvista.com>
CC: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30 21:34:31 +09:00
Alan Stern
9db33f3174 USB: IMX21: upgrade the isochronous API
This patch attempts to update the imx21-hcd driver to the current
standard for the isochronous API.  Firstly, urb->start_frame should
always be set by the driver; it is not an input parameter.  Secondly,
the URB_ISO_ASAP flag matters only when an URB is submitted to a
stream that has gotten an underrun.  It causes the URB to be scheduled
for the next available slot in the future, rather than the earliest
unused (and expired) slot.

Unfortunately, I don't have any way to test these changes.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Sascha Hauer <kernel@pengutronix.de>
CC: Martin Fuzzey <mfuzzey@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30 21:34:30 +09:00
Alan Stern
8a1ea51f87 USB: MUSB: upgrade the isochronous API
This patch attempts to fix the isochonour API in the musb host
driver.  In particular, the urb->start_frame field should always be
set by the driver; it isn't an input parameter.

The simplest way to accomplish this is to treat all URBs as though the
URB_ISO_ASAP flag was set.  This won't give the right behavior when an
underrun occurs, but I don't know enough about the musb driver to
handle that case.

Unfortunately, I have no way to test this change.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30 21:34:29 +09:00
Thomas Abraham
e6b0166f21 usb: ehci-s5p: skip phy setup for Exynos5440 based platforms
Exynos5440 does not require any explict USB phy configuration. So skip
the USB phy configuration for Exynos5440 based platforms.

Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
Ackked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30 21:34:29 +09:00
Andy Shevchenko
715cf92aeb usb: serial: dump small buffers with help of %*ph
There is a specifier we may use to dump small buffers.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30 21:34:28 +09:00
Jingoo Han
477527baf6 USB: host: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.

Also, unnecessary dev_set_drvdata() is removed, because the driver core
clears the driver data to NULL after device_release or on probe failure.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30 21:32:54 +09:00
Sachin Kamat
70de8f3ef0 usb: host: ehci-spear: Remove redundant checks
'hcd' can never be NULL and the spear_ehci_hcd_drv_remove routine
will never be called in_interrupt. Hence remove these checks.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30 21:32:53 +09:00
Wolfram Sang
16520a2cb2 drivers/usb/host: remove leftover release_mem_region
When converting this driver to devm_ioremap_resource, the removal of this now
unneeded function has been forgotten.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30 21:32:52 +09:00
Dongjin Kim
e8b58b4913 usb: misc: usb3503: Adding device tree entry 'disabled-ports'
This patch is to add a property 'disabled-ports' representing the unused port
of USB3503. USB3503 can support up to 3 USB host port and each ports can be
controlled to be enabled or disabled. Do not describe this property if all
ports must be enabled.

You can represent the ports to disable in the device tree.

	usb3503@08{
		...
		disabled-ports = <2 3>;
		...
	};

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30 21:32:52 +09:00
Dongjin Kim
e8e44a4896 usb: misc: usb3503: Add to select the ports to disable
This patch is to disable the USB ports unconnected to USB3503. In order to
disable the port, 'port_off_mask' must be set.

* Disable PORT1 only
	.port_off_mask = USB3503_OFF_PORT1;

* Disable PORT1 and PORT3 only
	.port_off_mask = USB3503_OFF_PORT1 | USB3503_OFF_PORT3;

* Enables all ports
	.port_off_mask = 0;

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30 21:32:52 +09:00
Alan Stern
077f5f1c23 USB: EHCI: fix regression related to qh_refresh()
This patch adds some code that inadvertently got left out of commit
c1fdb68e3d (USB: EHCI: changes related
to qh_refresh()).  The calls to qh_refresh() and qh_link_periodic()
were taken out of qh_schedule(); therefore it is necessary to call
these routines manually after calling qh_schedule().

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30 21:20:04 +09:00
Felipe Balbi
91e3af64c7 usb: musb: host: fix build warning
very minor patch fixing the following build warning on
a debug message:

drivers/usb/musb/musb_host.c: In function ‘musb_host_rx’:
drivers/usb/musb/musb_host.c:1763:4: warning: format ‘%x’ \
	expects argument of type ‘unsigned int’, but argument \
	6 has type ‘dma_addr_t’ [-Wformat]

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-30 03:07:09 +03:00
Venu Byravarasu
2d22b42db0 usb: phy: registering Tegra USB PHY as platform driver
Registered Tegra USB PHY as a separate platform driver.

To synchronize host controller and PHY initialization, used deferred
probe mechanism. As PHY should be initialized before EHCI starts running,
deferred probe of Tegra EHCI driver till PHY probe gets completed.

Got rid of instance number based handling in host driver.

Made use of DT params to get the PHY Pad registers.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-30 02:49:11 +03:00
Venu Byravarasu
6829f92f6e usb: phy: tegra: Add error handling & clean up.
Check return values from all GPIO APIs and handle errors accordingly.

Remove the call to clk_disable_unprepare(); this function does not
prepare or enable the clock, so the error path should not disable or
unprepare it.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-30 02:47:32 +03:00
Venu Byravarasu
12ea18e4f0 usb: phy: tegra: get ULPI reset GPIO info using DT.
As GPIO information is avail through DT, used it to get Tegra ULPI
reset GPIO number. Added a new member to tegra_usb_phy structure to
store this number.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-30 02:47:19 +03:00
Venu Byravarasu
9cd9384c73 usb: phy: tegra: Get PHY mode using DT
Added a new PHY mode to support OTG.
Obtained Tegra USB PHY mode using DT property.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-30 02:46:46 +03:00
Venu Byravarasu
9e69fae1a8 usb: phy: tegra: Return correct error value provided by clk_get_sys
In case if clk_get_sys fails, return correct error value provided by
the API.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-30 02:45:44 +03:00
Federico Manzan
e2e2f0ea1c usbfs: Increase arbitrary limit for USB 3 isopkt length
Increase the current arbitrary limit for isocronous packet size to a
value large enough to account for USB 3.0 super bandwidth streams,
bMaxBurst (0~15 allowed, 1~16 packets)
bmAttributes (bit 1:0, mult 0~2, 1~3 packets)
so the size max for one USB 3 isocronous transfer is
1024 byte * 16 * 3 = 49152 byte

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Federico Manzan <f.manzan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-29 17:06:36 +09:00
Johan Hovold
5cbfa3acdc USB: zte_ev: fix control-message timeouts
The control-message timeout is specified in milliseconds and should not
depend on HZ.

Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-29 10:50:44 +09:00
Johan Hovold
849513a780 USB: mos7720: fix message timeouts
The control and bulk-message timeouts are specified in milliseconds and
should not depend on HZ.

Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-29 10:50:44 +09:00
Johan Hovold
6c13ff68a7 USB: iuu_phoenix: fix bulk-message timeout
The bulk-message timeout is specified in milliseconds and should not
depend on HZ.

Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-29 10:50:43 +09:00
Johan Hovold
6343719117 USB: ark3116: fix control-message timeout
The control-message timeout is specified in milliseconds and should not
depend on HZ.

Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-29 10:50:43 +09:00
Johan Hovold
15ee89c334 USB: mos7840: fix DMA to stack
Fix regression introduced by commit 0eafe4de1a ("USB: serial: mos7840:
add support for MCS7810 devices") which used stack-allocated buffers for
control messages.

Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-29 10:50:42 +09:00
Johan Hovold
72ea18a558 USB: mos7720: fix DMA to stack
The read_mos_reg function is called with stack-allocated buffers, which
must not be used for control messages.

Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-29 10:50:41 +09:00
Johan Hovold
420021a395 USB: visor: fix initialisation of Treo/Kyocera devices
Fix regression introduced by commit 214916f2e ("USB: visor: reimplement
using generic framework") which broke initialisation of Treo/Kyocera
devices that re-mapped bulk-in endpoints.

Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-29 10:47:45 +09:00
Johan Hovold
5f8e2c07d7 USB: serial: fix Treo/Kyocera interrrupt-in urb context
The first and second interrupt-in urbs are swapped for some Treo/Kyocera
devices, but the urb context was never updated with the new port.

Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-29 10:47:45 +09:00
Alan Stern
fdc03438f5 USB: revert periodic scheduling bugfix
This patch reverts commit 3e619d0415
(USB: EHCI: fix bug in scheduling periodic split transfers).  The
commit was valid -- it fixed a real bug -- but the periodic scheduler
in ehci-hcd is in such bad shape (especially the part that handles
split transactions) that fixing one bug is very likely to cause
another to surface.  That's what happened in this case; the result was
choppy and noisy playback on certain 24-bit audio devices.

The only real fix will be to rewrite this entire section of code.  My
next project...

This fixes https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1136110.

Thanks to Tim Richardson for extra testing and feedback, and to Joseph
Salisbury and Tyson Tan for tracking down the original source of the
problem.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Joseph Salisbury <joseph.salisbury@canonical.com>
CC: Tim Richardson <tim@tim-richardson.net>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-29 10:41:06 +09:00
Greg Kroah-Hartman
1730ff27b1 xhci: Misc bug fixes for 3.10.
Hi Greg,
 
 Here's four xHCI bug fixes that should be queued for 3.10.
 
 The first two are generic bug fixes, and have been in my queue for a while
 because I've been doing the OPW internship coordination.  I suspect you'll be
 seeing more pull requests from me now that the intern selection process is
 almost over. :)
 
 The last two patches fix a nasty kernel crash on resume from S3 for TI hosts
 that have the compliance mode quirk.  Tony has confirmed that the patches fix
 the issue on the effected systems.
 
 All four patches are marked for stable.
 
 Sarah Sharp
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJRn/HbAAoJEBMGWMLi1Gc5BqkP/1BBofuukUTADySHMocTlPFG
 PtC/swG+luSMyDEUgt/YduVvHhlcalk++vPTbaBkGcioSKPuViinThPbQLpGh661
 zBLBrWsJ5hdOJHTVc+k5G2sVZi7hbrwA/xGAfjrKZZ/IOE18G/VMi+LuBnA8ekXl
 E/jlWFnWuQOnD5ylvMK3ANgt0PRE393I8MqJdqnCoh1DEi9em72Es9ZdpG1KbKAW
 nnIuM8IGeBJrDgw3yIIugGNuq5Dxajs4N9uXloaetxxGSevs80+0cZSAX08wBPOa
 XMVawMAF0nhZIEOKLYGG09jrGwfct95Rwk92+GpteunYSfN7tRHwmonHHd3Q1azp
 hJ0yrlytrgJm3ArBkcCfXoGE6zIBkRL3GsV8m/lQLXyGA7in8AGMMyAdIOAiIMwn
 89OckF3wFr0yR4/kidnvics/vVdE5GLIN2bqpPtzW8na1RIX0sZQVeZZ9LtWtal9
 I4LmIulIyFJNJAbhiEBdHamwuYZJrsDEpPyzwKq5YntJj4Jz1EJYFlbUWuCrq0QH
 cuCKgRPrMJjreOIT/XD5azNihkiHXtI0NGiuUlKAHAzVXlKAw4qinqdy4DLMbwil
 xvjRJdxXcIjPDM2aDDSi+QGHbWPop2+7UID7bkKLDtbVemjsmzJuPAJ0Hzub6AUd
 Pfl0lC+1pwraGm+LqjBE
 =CwKx
 -----END PGP SIGNATURE-----

Merge tag 'for-usb-linus-2013-05-24' of git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-linus

Sarah writes:

xhci: Misc bug fixes for 3.10.

Hi Greg,

Here's four xHCI bug fixes that should be queued for 3.10.

The first two are generic bug fixes, and have been in my queue for a while
because I've been doing the OPW internship coordination.  I suspect you'll be
seeing more pull requests from me now that the intern selection process is
almost over. :)

The last two patches fix a nasty kernel crash on resume from S3 for TI hosts
that have the compliance mode quirk.  Tony has confirmed that the patches fix
the issue on the effected systems.

All four patches are marked for stable.

Sarah Sharp
2013-05-29 10:25:34 +09:00
Virupax Sadashivpetimath
ed74df12dc usb: musb: make use_sg flag URB specific
Since highmem PIO URB handling was introduced in:

8e8a551 usb: musb: host: Handle highmem in PIO mode

when a URB is being handled it may happen that the static use_sg flag
was set by a previous URB with buffer in highmem.  This leads to error
in handling the present URB.

Fix this by making the use_sg flag URB specific.

Cc: stable <stable@vger.kernel.org> # 3.7+
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Virupax Sadashivpetimath <virupax.sadashivpetimath@stericsson.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 22:17:21 +03:00
George Cherian
5bf8fae33d usb: dwc3: gadget: free trb pool only from epnum 2
we never allocate a TRB pool for physical endpoints
0 and 1 so trying to free it (a invalid TRB pool pointer)
will lead us in a warning while removing dwc3.ko module.

In order to fix the situation, all we have to do is skip
dwc3_free_trb_pool() for physical endpoints 0 and 1 just
as we while deleting endpoints from the endpoints list.

Cc: stable@vger.kernel.org
Signed-off-by: George Cherian <george.cherian@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 22:17:20 +03:00
Peter Chen
022d0547aa usb: dwc3: exynos: PHY should be deleted later than dwc3 core
If the glue layer is removed first (core layer later),
it deletes the phy device first, then the core device.
But at core's removal, it still uses PHY's resources, it may
cause kernel's oops. It is much like the problem
Paul Zimmerman reported at:
http://marc.info/?l=linux-usb&m=136547502011472&w=2.

Besides, it is reasonable the PHY is deleted at last as
the controller is the PHY's user.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 22:17:08 +03:00
Peter Chen
f28c42c576 usb: dwc3: pci: PHY should be deleted later than dwc3 core
If the glue layer is removed first (core layer later),
it deletes the phy device first, then the core device.
But at core's removal, it still uses PHY's resources, it may
cause kernel's oops. It is much like the problem
Paul Zimmerman reported at:
http://marc.info/?l=linux-usb&m=136547502011472&w=2.

Besides, it is reasonable the PHY is deleted at last as
the controller is the PHY's user.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 22:16:49 +03:00
Jingoo Han
dae8eadf2a usb: gadget: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 20:16:56 +03:00
Dongjin Kim
6d3d61f821 usb: phy: samsung: Add support HSIC on Exynos4X12
This patch adds to enable High Speed Inter Chip on Exynos4X12. Both channels
are controlled by usbphy driver based on the patch series of usbphy driver
submitted by Tomasz Figa.

[1] https://patchwork.kernel.org/patch/2576121
[2] https://patchwork.kernel.org/patch/2576131
[3] https://patchwork.kernel.org/patch/2576141
[4] https://patchwork.kernel.org/patch/2576151
[5] https://patchwork.kernel.org/patch/2576161
[6] https://patchwork.kernel.org/patch/2576171

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Cc: Tomasz Figa <t.figa@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 20:16:37 +03:00
Sachin Kamat
7a22cc9709 usb: phy: phy-nop: Remove redundant use of of_match_ptr
'nop_xceiv_dt_ids' is always compiled in. Hence use of
of_match_ptr is unnecessary.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 20:14:39 +03:00
Sachin Kamat
e823aa7c6d usb: gadget: pxa27x_udc: Remove redundant platform_set_drvdata()
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 20:09:32 +03:00
Sachin Kamat
2d2428c027 usb: gadget: mv_u3d_core: Remove redundant platform_set_drvdata()
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Yu Xu <yuxu@marvell.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 20:09:20 +03:00
Tomasz Figa
1b635f0ff3 usb: phy: samsung: Add support for USB 2.0 PHY on Exynos 4x12
This patch adds driver data for Exynos 4x12 USB 2.0 PHY.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 20:07:31 +03:00
Tomasz Figa
84035f09ad usb: phy: samsung: Pass enable/disable callbacks through driver data
To remove unnecessary if statements, this patch introduces phy_enable
and phy_disable callbacks in driver data structure that implement
SoC-specific PHY initialization and deinitialization.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 20:07:15 +03:00
Tomasz Figa
3f339074ed usb: phy: samsung: Pass set_isolation callback through driver data
This patch extends driver data structure with set_isolation callback,
which allows to remove the need for checking for SoC type in a switch
statement.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 20:06:49 +03:00
Tomasz Figa
0aa823a2ca usb: phy: samsung: Consolidate reference clock rate handling
This patch cleans up handling of reference clock rate in Samsung USB PHY
drivers. It is mostly a cosmetic change but improves error handling in
case of failing to get reference clock or invalid clock rate.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 20:06:39 +03:00
Tomasz Figa
87331b0697 usb: phy: samsung: Use clk_get to get reference clock
There is no need to use devm_clk_get to get a clock that is being put
at the end of the function.

This patch changes the code getting reference clock to use clk_get
instead of useless in this case devm_clk_get.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 20:06:30 +03:00
Tomasz Figa
6278703bcc usb: phy: samsung: Select common driver part implicitly
Since phy-samsung-usb library can be used only by phy-samsung-usb2 and
phy-samsung-usb3 drivers, there is no need to give explicit control over
its Kconfig symbol.

This patch makes CONFIG_SAMSUNG_USBPHY symbol hidden and selected
implicitly by CONFIG_SAMSUNG_USB2PHY and CONFIG_SAMSUNG_USB3PHY.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 20:06:19 +03:00
Fabio Baltieri
f85bff5d1e usb: phy: ab8500-usb: add ab9540 support
Add support for the ab9540 variant of the ab8500 family.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Cc: Avinash Kumar <avinash.kumar@stericsson.com>
Cc: Thirupathi Chippakurthy <thirupathi.chippakurthy@stericsson.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 20:03:55 +03:00
Fabio Baltieri
0c380c0ee0 usb: phy: ab8500-usb: add ab8540 support
Add support for the ab8540 variant of the ab8500 family.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Cc: Avinash Kumar <avinash.kumar@stericsson.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 20:03:45 +03:00
Fabio Baltieri
bd4c9f0278 usb: phy: ab8500-usb: add flag bits to control driver features
Introduce a "flags" field in "struct ab8500_usb" to allow controlling
driver features and quirks depending on ab8500 chip variant and
revision.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 20:03:25 +03:00
Fabio Baltieri
16604a3c27 usb: phy: ab8500-usb: move phy tuning values on separate functions
Move each chip's PHY tuning value set code to a separate function to
improve code readability.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 20:02:09 +03:00
Fabio Baltieri
b3affc3991 usb: phy: ab8500-usb: add platform_device_id table
Add an initial platform_device_id table to the ab8500-usb driver to
allow probing additional variants of the ab8500 family chips.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 20:01:56 +03:00
Fabio Baltieri
a96afc6b75 usb: phy: ab8500-usb: fix phy tuning value select logic
The driver supports both ab8500 and ab8505, but the actual phy tuning
values logic sets ab8500 values:

if (!is_ab8500_2p0_or_earlier(ab->ab8500))

which is supposed to set values for ab8500, but incorrectly results true
for ab8505 too.

Fix this by adding an additional is_ab8500(ab->ab8500) check.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 20:01:34 +03:00
Sakethram Bommisetti
fb21f37a52 usb: phy: ab8500-usb: restart phy during probe
Add an ab8500_usb_restart_phy() function called during probe to ensure
that the AB8500 USB phy is initialized properly even when a cable is
connected at probe time.

Without this fix subsequent host reconnections are not detected
properly.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 20:01:01 +03:00
Mian Yousaf Kaukab
d0ed0645a5 usb: phy: ab8500-usb: add transceiver clock control
Add common clock support code for the ab8500-usb phy driver.

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 20:00:46 +03:00
Fabio Baltieri
3147dad6fa usb: musb: various cosmetic fixes on ux500 files
Various non functional coding style fixes on ux500_dma.c and
phy-ab8500-usb.c drivers.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 20:00:04 +03:00
Mian Yousaf Kaukab
aee5500f4f usb: musb: enable ux500 host side dma support
Host side dma support for ux500 is enabled by piggybacking on Inventra
dma support.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 19:58:57 +03:00
Laurent Pinchart
dbbafe666c usb: gadget: uvc: Remove unneeded endpoint descriptor fields initialization
The streaming endpoint bandwidth parameters are computed are runtime
from module parameters. Remove the corresponding static initializers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 19:57:45 +03:00
Daniel Mack
8b125df5b2 usb: musb: eliminate musb_to_hcd
With the hcd is now a direct member of struct musb, we can now simply
eliminate the musb_to_hcd() macro. There aren't that many users left
anyway, as some where already fixed up when parts were factored out to
musb_host.c

Signed-off-by: Daniel Mack <zonque@gmail.com>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 19:22:26 +03:00
Daniel Mack
6c5f6a6f53 usb: musb: use musb->port_mode
Initialize the host and gadget subsystems of the musb driver only when
the appropriate mode is selected from platform data, or device-tree
information, respectively.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 19:22:25 +03:00
Daniel Mack
9ad96e694c usb: musb: re-introduce musb->port_mode
Define MUSB_PORT_MODE_{HOST,GADGET,DUAL_ROLE} and store the
platform-specified value in struct musb.

Note that MUSB_PORT_MODE_HOST has to be set to 1 in order to match
existing device tree bindings which are already documented but in fact
unusued. For information on the bindings, please refer to

  Documentation/devicetree/bindings/usb/omap-usb.txt
  Documentation/devicetree/bindings/usb/am33xx-usb.txt

Signed-off-by: Daniel Mack <zonque@gmail.com>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-05-28 19:22:24 +03:00