Commit graph

9536 commits

Author SHA1 Message Date
Bill Pemberton d3608b6daf usb: remove use of __devinitdata
CONFIG_HOTPLUG is going away as an option so __devinitdata is no
longer needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 13:27:16 -08:00
Bill Pemberton 41ac7b3ab7 usb: remove use of __devinit
CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Peter Korsgaard <jacmet@sunsite.dk>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Cc: Li Yang <leoli@freescale.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Geoff Levand <geoff@infradead.org>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: Olav Kongas <ok@artecdesign.ee>
Cc: Lennert Buytenhek <kernel@wantstofly.org>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 13:27:16 -08:00
Bill Pemberton 7690417db5 usb: remove use of __devexit_p
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Peter Korsgaard <jacmet@sunsite.dk>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Cc: Li Yang <leoli@freescale.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 13:27:16 -08:00
Bill Pemberton 2bd6a021e8 usb-core: remove CONFIG_HOTPLUG ifdefs
Remove conditional code based on CONFIG_HOTPLUG being false.  It's
always on now in preparation of it going away as an option.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 13:27:16 -08:00
Olof Johansson 90919bf214 ARM: tegra: device tree changes
A wide variety of device tree additions are made across many Tegra
 boards:
 
 * WiFi is supported on Seaboard, Ventana, and Cardhu.
 * An I2C mux is added for Ventana, and Tamonten.
 * SPI flash is added to Cardhu, and TrimSlice.
 * Temperature sensors are added to Harmony, Tamonten, and Ventana.
 * host1x (graphics/display controller) is added to the SoC include files.
 * HDMI displays are enabled on Harmony, TrimSlice, Tamonten, Plutux, Tec,
   and Whistler.
 
 This pull request is based on tegra-for-3.8-soc.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJQppFoAAoJEMzrak5tbycx1WsQALzqZBCebkEIo0CfuYlVtZrX
 co2HBLsTis8KOI1lB5hZZdLvOD2sevwkw+YDtoG1k2ymZvR/Lpl3zdYdPCinA7gb
 Qzs+OlwnAla7J5BkgV0v69lZHBYd8jvxsFt9MZo1XkHjw2IRPyrzLhdmBHGLVj3J
 Tk7kk4OH64sDhDb+vZJXCtBJV0fvn10WNSskUHoQYZveGOCFGZXogrAht25tcoQO
 TM89tasMdRq3IhOxuzHHo/7AegyuTZdDzV4blNr1xOMzyz1b3P3sBh2ZiK+aBztX
 CCfpJ2ZUlRqTKSOU4qlM48dWffr/ZyP1u0VVi9Bu4Df/qBpS37NjagiVxMhiEasz
 0f3SZTAkZGh7yxi/BTmqu6vvQ0FWYgtOJPezK19RMXistdQkA/uiQDKqeBMTLTeA
 UXCnJdC05uBWhymy8DhJyryPQCJ1k3PJ+4pSmzemWIaAoQqpaH/q5yp4IAccr8wO
 pxZPtddD030iVdT5oYqBoAhn2W/mKtG1fShhp7wpj/qRYecUQICocTavuFG3DK0N
 k1OJ9rTxBZfnyeCBF/wdS/nNuI9xDk2WULVIya2cNu8I/te6QKp1fd4Jr3aPnZ/9
 4hiw5+L2dw2z7447EwlryC4sHttjVYEDHqsedR39YNPIn55D3mfsNX2iCczk1ZDU
 +OoRMiATrjILb1sOjJAs
 =ytxh
 -----END PGP SIGNATURE-----

Merge tag 'tegra-for-3.8-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra into next/dt

From Stephen Warren:
ARM: tegra: device tree changes

A wide variety of device tree additions are made across many Tegra
boards:

* WiFi is supported on Seaboard, Ventana, and Cardhu.
* An I2C mux is added for Ventana, and Tamonten.
* SPI flash is added to Cardhu, and TrimSlice.
* Temperature sensors are added to Harmony, Tamonten, and Ventana.
* host1x (graphics/display controller) is added to the SoC include files.
* HDMI displays are enabled on Harmony, TrimSlice, Tamonten, Plutux, Tec,
  and Whistler.

This pull request is based on tegra-for-3.8-soc.

* tag 'tegra-for-3.8-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra: (47 commits)
  ARM: tegra: whistler: enable HDMI port
  ARM: tegra: tec: Enable HDMI output
  ARM: tegra: plutux: Enable HDMI output
  ARM: tegra: tamonten: Add host1x support
  ARM: tegra: trimslice: enable HDMI port
  ARM: tegra: harmony: enable HDMI port
  ARM: tegra: Add Tegra30 host1x support
  ARM: tegra: Add Tegra20 host1x support
  ARM: tegra: trimslice: enable SPI flash
  ARM: tegra: dts: add sflash controller dt entry
  ARM: tegra: ventana: Add NCT1008 temperature sensor
  ARM: tegra: tamonten: Add NCT1008 temperature sensor
  ARM: tegra: harmony: Add ADT7641 temperature sensor
  ARM: tegra: tec: Remove redundant DT properties
  ARM: tegra: tamonten: Add DDC/PTA pinmux
  ARM: tegra: dts: cardhu: enable SLINK4
  ARM: tegra: dts: add slink controller dt entry
  ARM: dt: tegra: ventana: define pinmux for ddc
  ARM: dt: t30 cardhu: set pinmux and power for wlan
  ARM: dt: t20 ventana: set pinmux and power for wlan
  ...
2012-11-21 00:29:21 -08:00
Olof Johansson bcc5155d05 ARM: tegra: cleanup for 3.8
Various trivial cleanup changes of the Tegra code for 3.8.
 
 Many of the changes simply remove useless #include statements, which
 enable those headers to be removed or moved later, as work towards
 multi-platform zImage support.
 
 <mach/{iram,io}map.h> are moved up to arch/arm/mach-tegra to prevent
 any new code outside mach-tegra from using them.
 
 Finally, the regulator definitions in all board device tree files are
 updated to use the new simpler syntax that was agreed upon.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJQpo5eAAoJEMzrak5tbycxhpoQAIZPMMXemJP7Hqvtx0iza5jG
 LVbBqb+sTEhESpdd43XeMK8n9umjVszseRJYm3vbekJp3crVE/Z0ikTTzmDUiwIj
 iz1t9U1i+EsAVZ977DF68InA/lWociKVqaDO4WEN4YZ19zGQJbghFKVic5yVZvNq
 hRWNvDUkRi+9FJHS7wBHQNuRIghSDxh90zFoc0UUs12J2z2OjXKPYypU7Ttp6aUY
 rBvuDlqRQ9SjFxuE2dYDvEWnB69ONL7LauAkSkoqgXGGP1a6v5pphm+Y3badCOrO
 q5hGUpvzO+DTfOncj5dlZedRq9vjS/QEF+qJQFvMPrUpv8QkOulY4nf7w/sYmk9o
 Rhm9G6BxFGDMdxruA9SBkqjEzPcI9cT18FRYkMtsHfWwUgu6NUB6bMhc++R6rOJS
 JNkH+DoWuEsGP2RyopZZEjKlrCxPv3vNNOz4wkaLH+gEQvE9EZ5mkqy8xNYQbMBb
 Yv93TCADrX9tw/3JfWjB6/WhZ9GVBcSie0hcW+2Nm7lUzzQ8q9DKMZobG20+KHBZ
 /+L4NmK7DR5u8M6xnZqPat2VAraFxYZFjy3Xd50ul7PphfJnR4c7ITqt4u6lJ6hn
 Bnc7/DNM5hgAncH+APon1tffLMqgsJphC4Chn7y7Y/wSYi216IA21pmSrrmpKkh9
 OqBOasN9GVmmHVnxNzHn
 =aH3p
 -----END PGP SIGNATURE-----

Merge tag 'tegra-for-3.8-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra into next/cleanup

From Stephen Warren:
ARM: tegra: cleanup for 3.8

Various trivial cleanup changes of the Tegra code for 3.8.

Many of the changes simply remove useless #include statements, which
enable those headers to be removed or moved later, as work towards
multi-platform zImage support.

<mach/{iram,io}map.h> are moved up to arch/arm/mach-tegra to prevent
any new code outside mach-tegra from using them.

Finally, the regulator definitions in all board device tree files are
updated to use the new simpler syntax that was agreed upon.

* tag 'tegra-for-3.8-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra:
  ARM: tegra: move irammap.h to mach-tegra
  ARM: tegra: move iomap.h to mach-tegra
  ARM: tegra: remove <mach/dma.h>
  ARM: tegra: move tegra-ahb.h out of arch/arm/mach-tegra/
  ARM: tegra: remove unnecessary includes of <mach/*.h>
  iommu: tegra: remove include of <mach/iomap.h>
  staging: nvec: remove include of <mach/iomap.h>
  crypto: tegra: remove include of <mach/clk.h>
  ARM: tegra: update *.dts for regulator-compatible deprecation
  usb: phy: tegra remove include of <mach/iomap.h>
  usb: host: tegra remove include of <mach/iomap.h>
2012-11-21 00:17:40 -08:00
Adam Buchbinder 48fc7f7e78 Fix misspellings of "whether" in comments.
"Whether" is misspelled in various comments across the tree; this
fixes them. No code changes.

Signed-off-by: Adam Buchbinder <adam.buchbinder@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-19 14:31:35 +01:00
Masanari Iida 02582e9bcc treewide: fix typo of "suport" in various comments and Kconfig
Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-19 14:16:09 +01:00
Masanari Iida d755814808 treewide: fix typo of "suppport" in various comments
Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-19 14:13:52 +01:00
Masanari Iida 744627e91c treewide: fix printk typo in multiple drivers
Correct spelling typo in multiple drivers.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-11-19 11:08:17 +01:00
Greg Kroah-Hartman 0c864d8b3e Merge 3.7-rc6 into usb-next.
This resolves a conflict with these files:
	drivers/usb/early/ehci-dbgp.c
	drivers/usb/host/ehci-ls1x.c
	drivers/usb/host/ohci-xls.c
	drivers/usb/musb/ux500.c

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-16 18:46:21 -08:00
Greg Kroah-Hartman 1e619a1bf9 Merge 3.7-rc6 into tty-next 2012-11-16 18:26:00 -08:00
Arnd Bergmann bac2f66886 ARM i.MX dt updates for 3.8
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABCAAGBQJQpmDiAAoJEPFlmONMx+ezSJMP/Az4J4R6ZEh8J8xt/Uf4bw78
 k6jMg1cBRa/DRJWUWvymjyFH/NvjnbtntV4bOBbey05efB+RCGRl9TW6hGLtL5M6
 EfA2Nr7flw/BCdEuf0uI64p0rWmtfzV+SZOsPk6HKAzHo2uV/hQWYUUmvzNrVqVz
 8XVEfTQWgipA8SOPKfdvCezoO7PWHD6l9fy/mJkMyyf4Py1WDXXt+gCHUGZlFKAq
 8ZXE3B+ftwDUOwlrLl7mcJJtRjabUHQpDS/hmkhjVzTrrMQb+V2/BIzODkT35B6m
 bHc5zRlYVXVgE/XqxcD79zzl+ixvyfdYThLQ8GzoxyhUmKNOEjub+8udzX2YEB+b
 VLS06QmhhJn8xj6EIVM5WZIK4bR2OZoT2hCpuO2nJUyhbVSksO1GF1T8v8H3IHQf
 THw3WSh7bFIFrgJhj//UbLXkTaQ4/bkqAP064EyuABMvKoaybPOmFe0boN/QoFDz
 yC2/b1xTTiG/6nLupz7gLJabdV6iOF9f2rqta65hz+//Qk+Iyeh7iuWfrBspDJCb
 3vKBcB75IgRWaaPxJxRFWzP9CN2ouv5q763xSjqldFt9pOF4zvfBfpERkzYn3rwG
 /93X1tazBLo+mM7D5QVTrPgfXQs/B3GxIA6tsIIrPqxMpM5u/ONNNCYwINvFI/Xo
 aklrgV6n88q3C/Zewebz
 =CFfP
 -----END PGP SIGNATURE-----

Merge tag 'imx-dt' of git://git.pengutronix.de/git/imx/linux-2.6 into next/dt

From Sascha Hauer <s.hauer@pengutronix.de>:

ARM i.MX dt updates for 3.8

* tag 'imx-dt' of git://git.pengutronix.de/git/imx/linux-2.6:
  Add device tree file for the armadeus apf27
  ARM i.MX: Add Ka-Ro TX25 devicetree
  ARM i.MX25: Add devicetree
  ARM i.MX25: Add devicetree support
  ARM i.MX25: Add missing clock gates

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2012-11-16 17:11:46 +01:00
Linus Torvalds ec0148736f USB fixes for 3.7-rc5
Here are some USB fixes for the 3.7 tree.
 
 Nothing huge here, just a number of tiny bugfixes resolving issues that
 have been found, and two reverts of patches that were found to have
 caused problems.
 
 All of these have been in linux-next already.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iEYEABECAAYFAlCmRoUACgkQMUfUDdst+ynwAACg2if9XANSq4+GqdR7lSF5jCRO
 hwMAoNh7XAM4GEXPB9m3rB395p9rHsN0
 =31VS
 -----END PGP SIGNATURE-----

Merge tag 'usb-3.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg Kroah-Hartman:
 "Here are some USB fixes for the 3.7 tree.

  Nothing huge here, just a number of tiny bugfixes resolving issues
  that have been found, and two reverts of patches that were found to
  have caused problems.

  All of these have been in linux-next already.

  Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"

* tag 'usb-3.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  Revert "USB/host: Cleanup unneccessary irq disable code"
  USB: option: add Alcatel X220/X500D USB IDs
  USB: option: add Novatel E362 and Dell Wireless 5800 USB IDs
  USB: keyspan: fix typo causing GPF on open
  USB: fix build with XEN and EARLY_PRINTK_DBGP enabled but USB_SUPPORT disabled
  USB: usb_wwan: fix bulk-urb allocation
  usb: otg: Fix build errors if USB_MUSB_OMAP2PLUS is selected as module
  usb: musb: ux500: fix 'musbid' undeclared error in ux500_remove()
  Revert "usb: musb: use DMA mode 1 whenever possible"
2012-11-16 07:47:18 -08:00
Kishon Vijay Abraham I 4fd24483d1 usb: dwc3: core: move dwc3_cache_hwparams before dwc3_alloc_event_buffers
commit 392142 moved event buffer allocation out of dwc3_core_init() but
event buffer allocation uses the cached copy of hwparams to determine
the number of event buffers and the caching is done in dwc3_core_init.
So moved dwc3_cache_hwparams function before dwc3_alloc_event_buffers so
that dwc3_alloc_event_buffers sees the correct number of event buffers.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-16 04:47:52 -08:00
Russell King 46000065a6 ARM: move udc_pxa2xx.h to linux/platform_data
Move the PXA2xx/IXP4xx UDC header file into linux/platform_data as it
only contains a driver platform data structure.

Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Krzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-11-16 11:35:30 +00:00
Peter Chen ac96511bb5 usb: phy: change phy notify connect/disconnect API
The old parameter "port" is useless for phy notify, as one usb
phy is only for one usb port. New parameter "speed" stands for
the device's speed which is on the port, this "speed" parameter
is needed at some platforms which will do some phy operations
according to device's speed.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Tested-by: Mike Thompson <mpthompson@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-15 17:44:51 -08:00
Peter Chen b76baa8154 usb: refine phy notify operation during connection and disconnection
At commit 925aa46ba9, Richard Zhao
<richard.zhao@freescale.com> adds the phy notification callback
when port change occurs. In fact, this phy notification should
be added according to below rules:

1. Only set HW_USBPHY_CTRL.ENHOSTDISCONDETECT
during high speed host mode.
2. Do not set HW_USBPHY_CTRL.ENHOSTDISCONDETECT
during the reset and speed negotiation period.
3. Do not set HW_USBPHY_CTRL.ENHOSTDISCONDETECT
during host suspend/resume sequence.

Please refer: i.mx23RM(page: 413) for below rules.
http://www.freescale.com/files/dsp/doc/ref_manual/IMX23RM.pdf

Freescale i.MX SoC, i.mx23, i.mx28 and i.mx6(i.mx6SL does not
need to follow the 3rd rule) need to follow above rules.

Current code set connect notification (HW_USBPHY_CTRL.ENHOSTDISCONDETECT)
at hub_port_connect_change, it conflicts with above the 2th rule.

The correct notification setting method should be:
1. Set connect notify after the second bus reset.
2. Set disconnect notify after disconnection.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Tested-by: Mike Thompson <mpthompson@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-15 17:44:51 -08:00
Peter Chen 0e1a024d1a usb: mxs-phy: re-init phy during the connection is useless
As phy is working, re-init phy may cause unexpected results

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-15 17:44:51 -08:00
Peter Chen ff84f0e9f7 Revert "usb: otg: mxs-phy: Fix mx23 operation"
The real reason causes mx23 fail are:

- Calling mxs_phy_hw_init(mxs_phy) again at connection
- Error connect/disconnect nodity at hub.c

The coming patch will fix above two problems, Mike Thompson
tested his hardware works OK after commented out this delay
setting.

This reverts commit 363366cf61.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-15 17:44:51 -08:00
Dan Williams ba2d8ce9db cdc-acm: implement TIOCSSERIAL to avoid blocking close(2)
Some devices (ex Nokia C7) simply don't respond at all when data is sent
to some of their USB interfaces.  The data gets stuck in the TTYs queue
and sits there until close(2), which them blocks because closing_wait
defaults to 30 seconds (even though the fd is O_NONBLOCK).  This is
rarely desired.  Implement the standard mechanism to adjust closing_wait
and let applications handle it how they want to.

See also 02303f7337 for usb_wwan.c.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Cc: stable <stable@vger.kernel.org>
Acked-by: Oliver Neukum <oneukum@suse.de>
Tested-by: Aleksander Morgado <aleksander@gnu.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-15 17:39:03 -08:00
Jiri Slaby 191c5f1027 TTY: call tty_port_destroy in the rest of drivers
After commit "TTY: move tty buffers to tty_port", the tty buffers are
not freed in some drivers. This is because tty_port_destructor is not
called whenever a tty_port is freed. This was an assumption I counted
with but was unfortunately untrue. So fix the drivers to fulfil this
assumption.

To be sure, the TTY buffers (and later some stuff) are gone along with
the tty_port, we have to call tty_port_destroy at tear-down places.
This is mostly where the structure containing a tty_port is freed.
This patch does exactly that -- put tty_port_destroy at those places.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-15 17:20:58 -08:00
Hindin Joseph c13b86a336 USB: fix authorization and claimed port logic
It looks like I've run into some inconsistency in the USB stack behavior.

    The USB stack maintains, among others, two states for the attach
USB device: authorized and owned. Authorization state is accessible to
the user space code through correspondent sysfs files, the ownership
can be set by claiming the hub's port with ioctl call. Both state may
be set before the device is attached, by access the hub settings. When
the new device is attached, both authorization and ownership prevent
the kernel USB stack from setting the newly attached device
configuration, but when the device is authorized, the ownership state
is ignored. It looks like ignoring the ownership state on
authorization make the stack behavior inconsistent; it also prevents
the user space code from completely overriding configuration
selection, important for implementing workarounds for bugs in the
device configuration selection.

   The following patch makes the stack behavior more consistent, by
moving ownership test into usb_choose_configuration - the later
function is used both by generic_probe and usb_authorize_device

Signed-off-by: Joseph Hindin <hindin@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-15 16:56:22 -08:00
Arnd Bergmann b1f71bd032 Merge branch 'omap/headers4' into next/dt
These changes are needed for the following omap DT changes

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2012-11-15 17:09:41 +01:00
Arnd Bergmann 9265c6a186 Merge branch 'omap/headers4' into next/cleanup 2012-11-15 17:06:24 +01:00
Peter Ujfalusi 9d94e16be7 usb: otg: twl4030: Change TWL4030_MODULE_* ids to TWL_MODULE_*
To facilitate upcoming cleanup in twl stack.
No functional changes.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-14 12:15:49 -08:00
Boyan Nedeltchev 4b85c62411 usb: misc: usbtest: send ISO packets for g_zero
since commit b4036cc (usb: gadget: add
isochronous support to gadget zero), g_zero
has learned about isochronous transfers, which
allows us to use usbtest.ko to exercise
isochronous pipes.

All we need to do to enable that functionality
on usbtest.ko, is set the "iso" to 1 on
struct usbtest_info

Signed-off-by: Boyan Nedeltchev <boyan@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-14 12:15:49 -08:00
Viresh Kumar 98515e5923 usb: spear-ehci/ohci: Use devm_*() routines
This patch frees SPEAr ehci/ohci drivers from tension of freeing resources :)
devm_* derivatives of multiple routines are used while allocating resources,
which would be freed automatically by kernel.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-14 12:15:20 -08:00
Amardeep Rai d8fd7d5ae3 usb: spear-ehci/ohci: Do clk_get using dev-id
We used to get clk using con-id, but now we have device struct available for
these devices as they are probed using DT. And so must get clk using dev-id.

Signed-off-by: Amardeep Rai <amardeep.rai-ext@st.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-14 12:15:20 -08:00
Fabio Estevam bc13364b34 usb: ehci-mxc: Remove unused 'echi' variable
Since commit c73cee7 (USB: EHCI: remove ehci_port_power() routine), the
'ehci' variable is no longer used, so remove it and fix the following
build warning:

drivers/usb/host/ehci-mxc.c:41:19: warning: unused variable 'ehci' [-Wunused-variable]

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-14 12:14:12 -08:00
Wei Yongjun 70847780dc usb: host: tegra: remove pointless NULL check in tegra_ehci_remove()
Test for tegra and hcd in tegra_ehci_remove() look like potential
NULL pointer dereference, but in fact those tests are not needed,
so remove these pointless tests entirely.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-14 12:14:11 -08:00
Martin K. Petersen 5db44863b6 [SCSI] sd: Implement support for WRITE SAME
Implement support for WRITE SAME(10) and WRITE SAME(16) in the SCSI disk
driver.

 - We set the default maximum to 0xFFFF because there are several
   devices out there that only support two-byte block counts even with
   WRITE SAME(16). We only enable transfers bigger than 0xFFFF if the
   device explicitly reports MAXIMUM WRITE SAME LENGTH in the BLOCK
   LIMITS VPD.

 - max_write_same_blocks can be overriden per-device basis in sysfs.

 - The UNMAP discovery heuristics remain unchanged but the discard
   limits are tweaked to match the "real" WRITE SAME commands.

 - In the error handling logic we now distinguish between WRITE SAME
   with and without UNMAP set.

The discovery process heuristics are:

 - If the device reports a SCSI level of SPC-3 or greater we'll issue
   READ SUPPORTED OPERATION CODES to find out whether WRITE SAME(16) is
   supported. If that's the case we will use it.

 - If the device supports the block limits VPD and reports a MAXIMUM
   WRITE SAME LENGTH bigger than 0xFFFF we will use WRITE SAME(16).

 - Otherwise we will use WRITE SAME(10) unless the target LBA is beyond
   0xFFFFFFFF or the block count exceeds 0xFFFF.

 - no_write_same is set for ATA, FireWire and USB.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Mike Snitzer <snitzer@redhat.com>
Reviewed-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-11-13 22:45:42 -08:00
Martin K. Petersen 3c6bdaeab4 [SCSI] Add a report opcode helper
The REPORT SUPPORTED OPERATION CODES command can be used to query
whether a given opcode is supported by a device. Add a helper function
that allows us to look up commands.

We only issue RSOC if the device reports compliance with SPC-3 or
later. But to err on the side of caution we disable the command for ATA,
FireWire and USB.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-11-13 21:11:31 -08:00
Greg Kroah-Hartman e592c5d0b7 Revert "USB/host: Cleanup unneccessary irq disable code"
This reverts commit 73d4066055.

Martin Steigerwald reported that this change caused a hard lockup when
using USB if threadirqs are enabled.  Thomas pointed out that this patch
is incorrect, and can cause problems.  So revert it to get the
previously working functionality back.

Reported-by: Martin Steigerwald <Martin@lichtvoll.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Chuansheng Liu <chuansheng.liu@intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 10:52:52 -08:00
Dan Williams c0bc309887 USB: option: add Alcatel X220/X500D USB IDs
Signed-off-by: Dan Williams <dcbw@redhat.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 10:45:16 -08:00
Dan Williams fcb21645f1 USB: option: add Novatel E362 and Dell Wireless 5800 USB IDs
The Dell 5800 appears to be a simple rebrand of the Novatel E362.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 10:45:16 -08:00
Bjørn Mork f0e3e35c90 USB: keyspan: fix typo causing GPF on open
Commit f79b2d0f (USB: keyspan: fix NULL-pointer dereferences and
memory leaks) had a small typo which made the driver use wrong
offsets when mapping serial port private data.  This results in
in a GPF when the port is opened.

Reported-by: Richard <richjunk@pacbell.net>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Acked-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 10:45:16 -08:00
Arnd Bergmann b5932cc839 Merge branch 'cleanups/dma' into next/cleanup
Separate patches from Marek Szyprowski <m.szyprowski@samsung.com>:

Commit e9da6e9905 ("ARM: dma-mapping: remove custom consistent dma
region") replaced custom consistent memory handling, so setting
consistent dma memory size is not longer required. This patch series
cleans sub-architecture platform code to remove all calls to the
obsolated init_consistent_dma_size() function and finally removes the
init_consistent_dma_size() stub itself.

* cleanups/dma:
  ARM: at91: remove obsoleted init_consistent_dma_size()
  ARM: u300: remove obsoleted init_consistent_dma_size()
  ARM: dma-mapping: remove init_consistent_dma_size() stub
  ARM: shmobile: remove obsoleted init_consistent_dma_size()
  ARM: davinci: remove obsoleted init_consistent_dma_size()
  ARM: samsung: remove obsoleted init_consistent_dma_size()

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2012-11-13 10:14:38 +01:00
Arnd Bergmann 8a6ff8a0a2 arm: at91: mach header cleanup
This first patch serie start the cleanup of the header in mach
 by moving all the platform data to include/linux/platform_data
 
 and move the board header and drivers header next to them
 
 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
 Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQmQMyAAoJEOrjwV5ZMRf2N8kP/1J2DI26zhNWGIdiTPFX/HXG
 o03lvElDKDDyNtC87gU2DnYkOdjFVRpagZxv089whDs4Lt22A8ClaxEFca9K1oPg
 XO0NtuHbTL3wGlPLJH4C90bpQWY4FyIQLMfPaMeifrP1OpRkeSWAYKfFUB/wOtRC
 KWNl+WmpBt9JN9H1RIezYxpRteC+wUBKpYVZkRdT3OkQ4/oMqDIWzZqkMCTKy+Bb
 Ucs9ZFqkJ/5fSGYjHLG34VpbepFKgCqeDVugz2v+7SHvIkl0/XbRhGOdxJek54GD
 0OW8Gg5Utw47YQ1uYDR3IM00cod41/l9NYMKZm/DIEUdvNP3Mp+/X0Knehov+O+7
 7Xs8eSzBHE0mRAx2as71av08PNptNVAcJh/UAO8PWE5yLGivGrp8kQWzJItnl2ma
 8GmIK26bmMAqGuR+wANrT/pCCW5kxALE8L1JnCMzjhv5TvKE88mjUZuVmNnZGCdY
 SE/hotD2c2asZ15zv52wrGGpOALW6ZaQdlRafuDli1/yHeJ1uPOWec7NKnzytDpL
 A0r22RDyvqR7N2hunFu2aO757ojAsIWS8qfF2Yztr0UaE6rC+aoYKBwTfzvC5yhh
 gaurkH8jCUJ9EHw+GBs1pZQK9wWaK7MrlNj7/mVZ1iXErWCHZYcYNbxlx/xAFzUv
 IoHsmg6lL5By3p3nvElG
 =c5hx
 -----END PGP SIGNATURE-----

Merge tag 'for-3.8-at91_header_clean' of git://github.com/at91linux/linux-at91 into next/headers

From Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>:
arm: at91: mach header cleanup

This first patch serie start the cleanup of the header in mach
by moving all the platform data to include/linux/platform_data

and move the board header and drivers header next to them

* tag 'for-3.8-at91_header_clean' of git://github.com/at91linux/linux-at91:
  arm: at91: move at91rm9200 rtc header in drivers/rtc
  arm: at91: move reset controller header to arm/arm/mach-at91
  arm: at91: move pit define to the driver
  arm: at91: move at91_shdwc.h to arch/arm/mach-at91
  arm: at91: move board header to arch/arm/mach-at91
  arn: at91: move at91_tc.h to arch/arm/mach-at91
  arm: at91 move at91_aic.h to arch/arm/mach-at91
  arm: at91 move board.h to arch/arm/mach-at91
  arm: at91: move platfarm_data to include/linux/platform_data/atmel.h
  arm: at91: drop machine defconfig

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2012-11-12 22:54:08 +01:00
Felipe Balbi 77b847677e usb: host: xhci: move HC_STATE_SUSPENDED check to xhci_suspend()
that check will have to be done by all users
of xhci_suspend() so it sounds a lot better to
move the check to xhci_suspend() in order to
avoid code duplication.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2012-11-12 11:45:34 -08:00
Alexis R. Cortes b0e4e606ff usb: host: xhci: Stricter conditional for Z1 system models for Compliance Mode Patch
This minor patch creates a more stricter conditional for the Z1 sytems for applying
the Compliance Mode Patch, this to avoid the quirk to be applied to models that
contain a "Z1" in their dmi product string but are different from Z1 systems.

This patch should be backported to stable kernels as old as 3.2, that
contain the commit 71c731a296 "usb: host:
xhci: Fix Compliance Mode on SN65LVPE502CP Hardware"

Signed-off-by: Alexis R. Cortes <alexis.cortes@ti.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@vger.kernel.org
2012-11-12 11:45:32 -08:00
Sarah Sharp bba18e33f2 xhci: Extend Fresco Logic MSI quirk.
Ali reports that plugging a device into the Fresco Logic xHCI host with
PCI device ID 1400 produces an IRQ error:

 do_IRQ: 3.176 No irq handler for vector (irq -1)

Other early Fresco Logic host revisions don't support MSI, even though
their PCI config space claims they do.  Extend the quirk to disabling
MSI to this chipset revision.  Also enable the short transfer quirk,
since it's likely this revision also has that quirk, and it should be
harmless to enable.

04:00.0 0c03: 1b73:1400 (rev 01) (prog-if 30 [XHCI])
        Subsystem: 1d5c:1000
        Physical Slot: 3
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0, Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 51
        Region 0: Memory at d4600000 (32-bit, non-prefetchable) [size=64K]
        Capabilities: [50] Power Management version 3
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold-)
                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
                Address: 00000000feeff00c  Data: 41b1
        Capabilities: [80] Express (v1) Endpoint, MSI 00
                DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <2us, L1 <32us
                        ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
                DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
                        RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
                        MaxPayload 128 bytes, MaxReadReq 512 bytes
                DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
                LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 unlimited, L1 unlimited
                        ClockPM- Surprise- LLActRep- BwNot-
                LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk+
                        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
        Kernel driver in use: xhci_hcd

This patch should be backported to stable kernels as old as 2.6.36, that
contain the commit f5182b4155 "xhci:
Disable MSI for some Fresco Logic hosts."

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-by: A Sh <smr.ash1991@gmail.com>
Tested-by: A Sh <smr.ash1991@gmail.com>
Cc: stable@vger.kernel.org
2012-11-12 11:45:31 -08:00
Julius Werner 68e5254adb xhci: fix null-pointer dereference when destroying half-built segment rings
xhci_alloc_segments_for_ring() builds a list of xhci_segments and links
the tail to head at the end (forming a ring). When it bails out for OOM
reasons half-way through, it tries to destroy its half-built list with
xhci_free_segments_for_ring(), even though it is not a ring yet. This
causes a null-pointer dereference upon hitting the last element.

Furthermore, one of its callers (xhci_ring_alloc()) mistakenly believes
the output parameters to be valid upon this kind of OOM failure, and
calls xhci_ring_free() on them. Since the (incomplete) list/ring should
already be destroyed in that case, this would lead to a use after free.

This patch fixes those issues by having xhci_alloc_segments_for_ring()
destroy its half-built, non-circular list manually and destroying the
invalid struct xhci_ring in xhci_ring_alloc() with a plain kfree().

This patch should be backported to kernels as old as 2.6.31, that
contains the commit 0ebbab3742 "USB: xhci:
Ring allocation and initialization."

A separate patch will need to be developed for kernels older than 3.4,
since the ring allocation code was refactored in that kernel.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@vger.kernel.org
2012-11-12 11:45:29 -08:00
Sarah Sharp 4525c0a10d xHCI: Fix TD Size calculation on 1.0 hosts.
The xHCI 1.0 specification made a change to the TD Size field in TRBs.
The value is now the number of packets that remain to be sent in the TD,
not including this TRB.  The TD Size value for the last TRB in a TD must
always be zero.

The xHCI function xhci_v1_0_td_remainder() attempts to calculate this,
but it gets it wrong.  First, it erroneously reuses the old
xhci_td_remainder function, which will right shift the value by 10.  The
xHCI 1.0 spec as of June 2011 says nothing about right shifting by 10.
Second, it does not set the TD size for the last TRB in a TD to zero.

Third, it uses roundup instead of DIV_ROUND_UP.  The total packet count
is supposed to be the total number of bytes in this TD, divided by the
max packet size, rounded up.  DIV_ROUND_UP is the right function to use
in that case.

With the old code, a TD on an endpoint with max packet size 1024 would
be set up like so:
TRB 1, TRB length = 600 bytes, TD size = 0
TRB 1, TRB length = 200 bytes, TD size = 0
TRB 1, TRB length = 100 bytes, TD size = 0

With the new code, the TD would be set up like this:
TRB 1, TRB length = 600 bytes, TD size = 1
TRB 1, TRB length = 200 bytes, TD size = 1
TRB 1, TRB length = 100 bytes, TD size = 0

This commit should be backported to kernels as old as 3.0, that contain
the commit 4da6e6f247 "xhci 1.0: Update TD
size field format."

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-by: Chintan Mehta <chintan.mehta@sibridgetech.com>
Reported-by: Shimmer Huang <shimmering.h@gmail.com>
Tested-by: Bhavik Kothari <bhavik.kothari@sibridgetech.com>
Tested-by: Shimmer Huang <shimmering.h@gmail.com>
Cc: stable@vger.kernel.org
2012-11-12 11:45:28 -08:00
Sarah Sharp 392a07ae33 xhci: Fix conditional check in bandwidth calculation.
David reports that at drivers/usb/host/xhci.c:2257:

static bool xhci_is_sync_in_ep(unsigned int ep_type)
{
    return (ep_type == ISOC_IN_EP || ep_type != INT_IN_EP);
}

The static analyser cppcheck says

[linux-3.7-rc2/drivers/usb/host/xhci.c:2257]: (style) Redundant condition: If ep_type == 5, the comparison ep_type != 7 is always true.

Maybe the original programmer intention was something like

static bool xhci_is_sync_in_ep(unsigned int ep_type)
{
    return (ep_type == ISOC_IN_EP || ep_type == INT_IN_EP);
}

Fix this.

This patch should be backported to stable kernels as old as 3.2, that
contain the commit 2b69899934 "xhci: USB
3.0 BW checking."

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-by: David Binderman <dcb314@hotmail.com>
Cc: stable@vger.kernel.org
2012-11-12 11:45:26 -08:00
Sarah Sharp 2611bd189e xhci: Avoid global symbol pollution with handshake.
Non-static xHCI driver symbols should start with the "xhci_" prefix, in
order to avoid namespace pollution.  Rename the "handshake" function to
"xhci_handshake".

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-by: Ben Hutchings <ben@decadent.org.uk>
2012-11-12 11:44:25 -08:00
Sascha Hauer 53640f41b9 Merge remote-tracking branch 'arm-soc/imx/multiplatform' into imx25-dt 2012-11-12 12:08:12 +01:00
Alan Stern 2f02bc8af3 USB: report submission of active URBs
This patch (as1633) changes slightly the way usbcore handled
submissions of URBs that are already active.  It will now return
-EBUSY rather than -EINVAL, and it will call WARN_ONCE to draw
people's attention to the bug.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-11 18:10:46 -08:00
Alan Stern 2656a9abcf USB: EHCI: bugfix: urb->hcpriv should not be NULL
This patch (as1632b) fixes a bug in ehci-hcd.  The USB core uses
urb->hcpriv to determine whether or not an URB is active; host
controller drivers are supposed to set this pointer to a non-NULL
value when an URB is queued.  However ehci-hcd sets it to NULL for
isochronous URBs, which defeats the check in usbcore.

In itself this isn't a big deal.  But people have recently found that
certain sequences of actions will cause the snd-usb-audio driver to
reuse URBs without waiting for them to complete.  In the absence of
proper checking by usbcore, the URBs get added to their endpoint list
twice.  This leads to list corruption and a system freeze.

The patch makes ehci-hcd assign a meaningful value to urb->hcpriv for
isochronous URBs.  Improving robustness always helps.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Artem S. Tashkinov <t.artem@lycos.com>
Reported-by: Christof Meerwald <cmeerw@cmeerw.org>
CC: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-11 18:10:45 -08:00
Alan Stern 1b36810e27 USB: EHCI: miscellaneous cleanups for the library conversion
This patch (as1630) cleans up a few minor items resulting from the
split-up of the ehci-hcd driver:

	Remove the product_desc string from the ehci_driver_overrides
	structure.  All drivers will use the generic "EHCI Host
	Controller" string.  (This was requested by Felipe Balbi.)

	Allow drivers to pass a NULL pointer to ehci_init_driver()
	if they don't have to override any settings.

	Remove a #define symbol that is no longer used from the
	ChipIdea host driver.

	Rename overrides to pci_overrides in ehci-pci.c, for
	consistency with ehci-platform.c.

	Mark the *_overrides structures as __initdata.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-11 18:06:48 -08:00
Alan Stern 36caff5d79 USB: fix endpoint-disabling for failed config changes
This patch (as1631) fixes a bug that shows up when a config change
fails for a device under an xHCI controller.  The controller needs to
be told to disable the endpoints that have been enabled for the new
config.  The existing code does this, but before storing the
information about which endpoints were enabled!  As a result, any
second attempt to install the new config is doomed to fail because
xhci-hcd will refuse to enable an endpoint that is already enabled.

The patch optimistically initializes the new endpoints' device
structures before asking the device to switch to the new config.  If
the request fails then the endpoint information is already stored, so
we can use usb_hcd_alloc_bandwidth() to disable the endpoints with no
trouble.  The rest of the error path is slightly more complex now; we
have to disable the new interfaces and call put_device() rather than
simply deallocating them.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: Matthias Schniedermeyer <ms@citd.de>
CC: Sarah Sharp <sarah.a.sharp@linux.intel.com>
CC: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-11 18:06:48 -08:00
Greg Kroah-Hartman 7fd94beeca usb: gadget: patches for v3.8
renesas_usbhs implements ->pullup() method, switches over
 to devm_request_irq(), adds support for DMA Engine and
 got a few miscelaneous cleanups.
 
 The NCM gadget got an endianness fix and the Ethernet
 gadget a frame size fix.
 
 We're finally removing the g_file_storage gadget and
 sticking to g_mass_storage and the new tcm_usb_gadget
 gadgets since that was a huge duplicaton of effort anyway.
 
 While removing g_file_storage, we also had to fix a bunch
 of defconfigs which were still pointing to the old gadget.
 
 There's a big series getting us closer to being able to
 introduce our configfs interface. The series converts
 functions into loadable modules which will, eventually,
 be registered to the configfs interface.
 
 Other than that there's the usual typo fixes and miscelaneous
 cleanups all over the place.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQnXPMAAoJEIaOsuA1yqREkygQALIuhY6veRPZoZJltuADeAOV
 h7lBkuseJxvlJsbMLnjqP5tw4W/haE1deGR+ee1ZItkPrERCX1++jkQ6hmm7e00R
 mvr8rI+n3eBHSKUO89tUfCaz5UBsTl0cowPWdTwxRrV4VRJ1wVBw/oII9sfyss03
 jDo+11DSjTGTB+Bz72p2NTkRiv9my2Kz+ihhqFR5VSl5FyoutG53RNKRmciJKGB+
 i+RptOI+prdW1uOURHbie5FAI0xOBrE1Up2XdNiZ9blT6zcsK754Lc8erFJEZXX5
 7s8Ys/HJZLQCF/fRt4WAw8e1lSPELD2xuDMqV+WKu93aXOiAWL1SbzqK3Y+PaUDg
 Red07jOxgPqgq0F1mAp3+0Rs1RnshSvKREtQhZqsttg7suXhDB0q7h61CX8uQbRA
 hBZh8eFexRjqOZxveeV+h4ATz00c2nlEa8cJscr5zLf4R/LSxJWT7LV5227BDkBV
 9NUMA3dunDYZLqnxBv5lS2gQzmYO6G11wzdpgjnABL2WlM8Pv1lUDhY+erwvTRzd
 BM+9qMd7K40BuI1JyUsbBdmuEpJAD/yWE77pT2aBrr4767x0CYjBPZqQAxXFcWi8
 5NG1BzqWmH9HhwxKyWueWgNgY253cRcAzFlUN80NRA2UuNkMAeOAeJjvK48isAqJ
 T1MUkQgIFNvSecpRPrEl
 =umtl
 -----END PGP SIGNATURE-----

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

USB gadget patches from Felipe:
"usb: gadget: patches for v3.8

renesas_usbhs implements ->pullup() method, switches over
to devm_request_irq(), adds support for DMA Engine and
got a few miscelaneous cleanups.

The NCM gadget got an endianness fix and the Ethernet
gadget a frame size fix.

We're finally removing the g_file_storage gadget and
sticking to g_mass_storage and the new tcm_usb_gadget
gadgets since that was a huge duplicaton of effort anyway.

While removing g_file_storage, we also had to fix a bunch
of defconfigs which were still pointing to the old gadget.

There's a big series getting us closer to being able to
introduce our configfs interface. The series converts
functions into loadable modules which will, eventually,
be registered to the configfs interface.

Other than that there's the usual typo fixes and miscelaneous
cleanups all over the place."
2012-11-11 17:31:53 -08:00
Greg Kroah-Hartman 0f89fc3fd8 usb: dwc3: patches for v3.8
We can finaly drop HAVE_CLK dependency from exynos glue layer
 now that clk API provides no-op stubs when it's not linked
 into the kernel.
 
 We're also switching over event buffer allocation to devm_kzalloc()
 and moving the allocation out of dwc3_core_init() so that can be
 re-used when implementing PM support for v3.9.
 
 After the introduction of PLATFORM_DEVID_AUTO, we can also drop the
 homebrew platform device ID handling we had on dwc3 core and let
 driver core take care of that for us.
 
 Exynos glue layer learns about DeviceTree and drops platform_data
 support completely.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQnWwFAAoJEIaOsuA1yqREBCwP/0QH34TL292W0BH9wKj7GVgK
 fT9DOKWGJFNr238WcDmnl+NBVVtWuEjqcAplNNWpJndwRm36lD1WCYOe/fPEh01h
 rm0scCijJcvgpBbQDOAR4B9UbMe9YcymWvuZ7Rx9217ryHiy352OlNoKfAkJOt2e
 JXMREHl7yJwWv6x5pN44NaMDgL/LqFnhvf8KAqo5LjR7XUJlkKQcmUmzkqyxGvnq
 9BFiOoIiRSwmTtnieulgvocgWgmlzkMabeAWvY/w5Cq3g2FKWVwBqg1zyRQK9MrE
 YEoEFy6Edc37C2CrmjaK6g/3Mw7p4v5s0AmU4jCRSFcpk2jpqZa+TEHkdCwgyXXY
 g/nlerxhprc5OFw7BnX26A7u1tIEfVMc9K3lcbadc5PpyiHnsveQHlr7kxhfPocF
 12AhfQRx8G/a365Fle88fTZs+aDKiBnIqpzzLNTHBw3riBdgvQsIjx4X+7Y0rE46
 v1SXqW/H0thlY38YpUQ5a4jNVKUNJJM4vamQ7cu7i9m2n0nHshfMPx2xe5NFKUHW
 bI44+pTq1FO73mmkFbWmMRCdE7aRv63aQInQ4nSbVHBi7Nv+xv8nNT8Y3XJu9T27
 bEv9nXxpx0GFwLQYcwzrhyI7Ws7+EZU5W13vemQUf4EEtwBZq4d9NxUYCUg2OpYo
 ivHz3p1AtBkjL6ImFxjc
 =wqLI
 -----END PGP SIGNATURE-----

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

USB dwc3 patches from Felipe:

"usb: dwc3: patches for v3.8

We can finaly drop HAVE_CLK dependency from exynos glue layer
now that clk API provides no-op stubs when it's not linked
into the kernel.

We're also switching over event buffer allocation to devm_kzalloc()
and moving the allocation out of dwc3_core_init() so that can be
re-used when implementing PM support for v3.9.

After the introduction of PLATFORM_DEVID_AUTO, we can also drop the
homebrew platform device ID handling we had on dwc3 core and let
driver core take care of that for us.

Exynos glue layer learns about DeviceTree and drops platform_data
support completely."
2012-11-11 17:22:01 -08:00
Greg Kroah-Hartman 3a3f2e5095 usb: musb: patches for v3.8 merge window
We have here the usual set of cleanups for the MUSB driver; a
 big set of patches converting platform_device_del() and
 platform_device_put() into platform_device_unregister().
 
 Another big set was applied converting to module_platform_driver()
 macro in order to reduce some boilerplate code from all glue
 layers.
 
 Other than that, we had a series fixing one known silicon errata
 where we couldn't read a few registers. In order to fix that
 we're now using shadow variables for reads and only writing
 to the registers which are known to break functionality when
 read.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQnWnTAAoJEIaOsuA1yqREsb8P/2fYBTfwJSzlr4Gw7CWIedw1
 6l0VsHRBPr7cnUFmbkxdVAcDbuqfDrtEZoYSxF97DoDmqKqM4JXcGsozLn62J4pL
 E0jscaojx1ZbELEoWWTY4Sr7KBIz5SPYnZhQFj2S3oXWtDvQe+3NyGU6uJxwTjzD
 A57xpSAJmruQE+8hPL2e1/rPR+I9ZmaebhpQ2cyNTFWu/tv+Q7VtpvjtreD1C/fZ
 0IVlyz6r/2OXB4C//xWfJ2BRPa6wRHAu/BpH5HU0P84hPi7hshtjKHjWUZFkuDHy
 JsBArA2LGJN2Jc62H9tiKaD28kHWNm99P7XPkCnPRY7bfAINZ6SwDxYCrQ9QKpNq
 ExLLhdJA4rhVQATRlwczluFNK1rTVSxJQFEcK/hkopK8wK/B+mgWqDu4OZDDhowu
 u8/pPNM9gJe1/NNVfSigJ9f/h0wb25Ua+V7MyrmCOuQq1tdVELYfHCj+VhjqAIud
 YzBLsGTnrto7TYYV2wuc6iiHW0nJ0zrBOiSfsUjLiGoB0dH224MqCvezwUREqyob
 fy25JmyCVjlxZ5wkfjJ9UlFuruWJHJf2zVr04xfdxaUY9eUk1rmEmhNR9mAlfnQG
 3fJC580fVgHVceucOP2knsnXAzGjy/jr+xiFzOU9lE8NopO46qtbmBm5CwcW0STX
 L9IJq7SA2KhuVpGpQkwf
 =tr2i
 -----END PGP SIGNATURE-----

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

USB musb merge from Felipe:

"usb: musb: patches for v3.8 merge window

We have here the usual set of cleanups for the MUSB driver; a
big set of patches converting platform_device_del() and
platform_device_put() into platform_device_unregister().

Another big set was applied converting to module_platform_driver()
macro in order to reduce some boilerplate code from all glue
layers.

Other than that, we had a series fixing one known silicon errata
where we couldn't read a few registers. In order to fix that
we're now using shadow variables for reads and only writing
to the registers which are known to break functionality when
read."
2012-11-11 17:13:16 -08:00
Greg Kroah-Hartman 8e06c6a7f4 usb: phy: patches for v3.8 merge window
Not too many patches this time. First two patches are only
 cleanups where one of them switches over to module_platform_driver
 macro and the second removes inclusion of <mach/iomap.h> and is
 part of a bigger set of include cleanups from the Tegra folks.
 
 The only substantial change here is the addition of a driver
 for Renesas' R-Car USB Phy controller.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQnWcbAAoJEIaOsuA1yqREmSAQALGLSzrFrcmJcUBEckTlSLu3
 H9Dc4GzJk1R8eyyippPgMeJKDwsXBZuZUC+KoEoeyTdm5lqBKLYwkqdHlYrlxlFX
 J8FpIzXNYih4hEaOuhkCsojSsJXZODASDowqRunEcFaOOSv6J1zZQVe3mtw9H5Ap
 59gXz9Fdcyc4D9JnPvkJpNxBiGBTQMNUjJ0yyUZNwHh1N+zdwQ+De3msxEaDHoJF
 it9e92QdfCZrSPIXC+hjVLgPG3JeMsQsJabRq8hlRfJzdMP5rdE6WVadkaDFcaPl
 pbNIKxSmz9QaD8IfVivmyRw6oG0/yiSbmKXgz+npj6bo/nzlYaTYbgWNaIeLA2US
 E9QM8MSGYl1nefNjhfobVTxVUOmi5vYcBXo9OMXBS6NO3TczGGQLMQzOO6Xmnqf6
 MzsvdmbMgWsz0OjT2MopxyUTVTh/ps5nUaySyrnSlXC95yUH65Ky5avBUC1jqWxj
 YbZiqaLgSccKDIo4UOgQFaMR6jKxUQx+fgJy/s9uCdFh0EGAhfrVP+DpX12erHQ/
 F+5uVja4H/nLeCff2ea0kIV9tyouaRe/89stWQ28RIE/yLrHN41KmrwppoJZwhxl
 fzW3kWKASIVTy976Hk/N9d13TnpZIj2eJWR2LIzkt2BDb6dfN+IV0NPwreiTe92L
 l7RScAepGbF5HK3aFAuu
 =6i3J
 -----END PGP SIGNATURE-----

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

Pull USB phy patches from Felipe:

"usb: phy: patches for v3.8 merge window

Not too many patches this time. First two patches are only
cleanups where one of them switches over to module_platform_driver
macro and the second removes inclusion of <mach/iomap.h> and is
part of a bigger set of include cleanups from the Tegra folks.

The only substantial change here is the addition of a driver
for Renesas' R-Car USB Phy controller."
2012-11-11 16:12:14 -08:00
Tony Lindgren edf8dde393 Merge branch 'linus' into omap-for-v3.8/cleanup-headers-prepare-multiplatform-v3 2012-11-09 14:58:01 -08:00
Afzal Mohammed d75542263a Revert "usb: musb: dsps: remove explicit NOP device creation"
This reverts commit d8c3ef256f.

Above mentioned change was made along with multi usb phy change and
adding DT support for nop transceiver. But other two changes did not
make it to mainline. This in effect makes dsps musb wrapper unusable
even for single instance.

Hence revert it so that at least single instance can be supported.

Cc: stable@vger.kernel.org # v3.7
Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-09 08:01:54 +02:00
Dmytro Milinevskyy f72e3b7886 usb: gadget: ncm: correct endianess conversion
Convert USB descriptor's fields to CPU byte order before using locally in USB
NCM gadget driver.

Tested on MIPS32 big-endian device.

Signed-off-by: Dmytro Milinevskyy <milinevskyy@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-08 16:05:39 +02:00
Ian Coolidge 23834e5331 usb: gadget: g_ether: fix frame size check
Checking skb->len against ETH_FRAME_LEN assumes a 1514
ethernet frame size. With an 802.1Q VLAN header, ethernet
frame length can now be 1518. Validate frame length against that.

Signed-off-by: Ian Coolidge <iancoolidge@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-08 16:04:50 +02:00
Michal Nazarewicz be44f1c80b usb: gadget: Remove reference to is_dualspeed from sysfs.
This commit removes the /sys/devices/platform/<UDC>/udc/<UDC>/is_dualspeed
file and is_dualspeeed line from /sys/devices/platform/ci13xxx_*/udc/device
file.

The is_dualspeed file is superseded by maximum_speed in the same directory
and is_dualspeed line in device file is superseded by max_speed line in
the same file.

The maximum_speed/max_speed specifies maximum speed supported by UDC.
To check if dualspeeed is supported, check if the value is >= 3.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-08 16:04:34 +02:00
Michal Nazarewicz fea20dbcfd usb: gadget: storage_common: Make fsg_lun_is_open() a function.
Since function-line macros are to be avoided, this commit replaces
the fsg_lun_is_open() macro with a static inline function.

While at it, this commit also adds “inline” modifier to the
fsg_lun_from_dev() function.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-08 16:04:04 +02:00
Michal Nazarewicz 8575f7a706 usb: gadget: storage_common: Drop #ifdefs used for the sake of FSG.
storage_common.c has been used by both file_storage.c and f_mass_storage.c
which had some different requirements in a few places.  To accomodate for
that, storage_common.c provided configuratian macros which were to be
defined (or not) prior to the file #inclusion.  Because now
file_storage.c is no longer with us, we can remove support for those
macros and thus simplify the code slightly.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-08 16:03:35 +02:00
Michal Nazarewicz c7800a34ac usb: gadget: storage_common: Remove FSG specific definitions.
Since g_file_storage has been removed, this commit removes code from
the storage_common.c file which has been used by file_storage.c only
(and not by f_mass_storage.c).

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-08 16:02:55 +02:00
Michal Nazarewicz fa06920a3e usb: gadget: Remove File-backed Storage Gadget (g_file_storage).
The File-backed Storage Gadget (g_file_storage) gadget has been replaced
with Mass Storage Gadget (g_mass_storage) which uses the composite
framework.  This commit removes g_file_storage (and most references to it).

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-08 16:01:04 +02:00
Kuninori Morimoto 1c90ee0b3e usb: renesas_usbhs: use transfer counter if IN direction bulk pipe
received data will break if it was bulk pipe and large data size,
because pipe kept BUF PID even though it doesn't have enough buffer.
To avoid this issue, renesas_usbhs can use transfer counter.
Pipe PID will be NAK if it didn't have enough buffer by this patch.

renesas_usbhs has strange address mapping.
Thus, it is difficult to calculate transfer counter setting address.
This patch use fixed table for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-08 15:46:06 +02:00
Felipe Balbi e32672f0bc usb: dwc3: core: don't kfree() devm_kzalloc()'ed memory
commit 380f0d2 (usb: dwc3: core: switch event
buffer allocation to devm_kzalloc()) was incomplete
leaving a trailing kfree(evt) in an error exit
path.

Fix this problem by removing the trailing kfree(evt).

Cc: Julia Lawall <julia.lawall@lip6.fr>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-08 15:26:41 +02:00
Ian Coolidge 4fe5f079b4 usb: gadget: g_ether: fix frame size check for 802.1Q
Checking skb->len against ETH_FRAME_LEN assumes a 1514
ethernet frame size. With an 802.1Q VLAN header, ethernet
frame length can now be 1518. Validate frame length against that.

Signed-off-by: Ian Coolidge <iancoolidge@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-07 21:12:26 -05:00
Olof Johansson 66267ee587 Merge branch 'arm-next' of git://git.xilinx.com/linux-xlnx into next/cleanup
From Michal Simek:

* 'arm-next' of git://git.xilinx.com/linux-xlnx:
  zynq: move static peripheral mappings
  zynq: remove use of CLKDEV_LOOKUP
  zynq: use pl310 device tree bindings
  zynq: use GIC device tree bindings
  + Linux 3.7-rc3
2012-11-06 07:51:06 -08:00
Philippe De Swert baef653a50 usb: musb: remove generic_interrupt
This patch is based on the discussion of a previous patch to fix an issue
where the omap2430 musb driver is not working for N9/N950.

Moving all the interrupt handling to the devices. Avoids inclusion of generic
interrupt and breakage due to sometimes misleading CONFIG options. This makes
sure usb always works if on of the subdrivers is chosen. Tested on Nokia N9/N950.

Partially clean up CONFIG_SOC_OMAP3430 which is not necessary in the cases
where I removed it. Also helps with the removal work of those options that
Tony Lindgren predicted would happen at some point.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-06 15:32:13 +02:00
Sergei Shtylyov 8b416b0b25 usb: musb: cppi_dma: export cppi_interrupt()
Now that DaVinci glue layer can be modular, we must export cppi_interrupt()
that it may call...

Cc: stable@vger.kernel.org # 3.0+
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-06 15:12:09 +02:00
Kuninori Morimoto 7b332e5fef usb: renesas_usbhs: host: add endpoint user counter
renesas_usbhs attaches pipe to endpoint when urb was queued, and it will be
detached when transfer was done.  Multi device controlling was enabled by this
behavior.

Now renesas_usbhs driver tried to wait until detaching if urb was queued to
endpoint which already has been attached to pipe, and it created strange driver
behavior.

But it can re-use this attached pipe if multi urb was queued.  This patch
implements it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-06 15:04:28 +02:00
Kuninori Morimoto 24e4c1c30d usb: renesas_usbhs: remove debug information from usbhsh_hub_status_data()
Because usbhsh_hub_status_data() will be called many times,
there are too many obstructive/useless debug informations if driver has #define DEBUG.
Thus, other important dev_dbg() information will hide.
This patch removed obstructive/useless dev_dbg().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-06 15:04:28 +02:00
Masanari Iida 984e833c2b usb: fix typo in drivers/usb
Correct spelling typo in debug messages within drivers/usb.

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-06 15:04:14 +02:00
Santhapuri, Damodar c68bb4c679 usb: musb: dsps: control module handling (quirk)
am335x uses nop transceiver driver and need to enable builtin phy
by writing into usb_ctrl register available in system control
module register space. This is being added at musb glue driver
layer until a separate system control module driver is available.

Proper solution is to make use of control module driver, but it is
not expected to be ready soon.

Other options available are providing control module register space
as memory resource via DT or using omap hwmod.

DT approach has been rejected by Rob Herring, while resources are
being moved from hwmod to DT. And both of the above approaches
require that control module registers be configured in wrapper
itself requring a quirk in driver as well as DT or hwmod.

Here another option is used, providing driver with control module
register physical address. Even though this a hack, there is no other
option left till control module driver is ready. As of now only
am335x is using dsps wrapper, and so driver is made aware of am335x
control module physical address.

Please note that this is a temporary arrangment till omap control
module driver is available.

[afzal@ti.com: limit quirk to dsps wrapper]

Signed-off-by: Santhapuri, Damodar <damodar.santhapuri@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Ravi Babu <ravibabu@ti.com>
Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-06 15:03:02 +02:00
Afzal Mohammed 3e594b18f1 usb: musb: dsps: get resources by index
dsps wrapper is now dt only. This requires that resources be obtained
using index and not name, modify accordingly.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-06 15:01:39 +02:00
Afzal Mohammed 3b46dd76a9 usb: musb: dsps: reduce musb instance to one
Currently multiple phy's of the same type are not supported, hence
reduce musb instances to one. This helps in supporting at least one
instance of musb, rather than having none. Even without this, it was
observed that both instances were working (by luck), but this holds
good iff wrapper is part of Image. And it is not correct for both
controller's to be associated with same phy, here it was working
because phy is a nop one. And having wrapper as a module and
rmmod'ing would crash.

This can be reverted once multi phy support for same type is available
and driver is enhanced to make use of it.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-06 15:01:36 +02:00
Afzal Mohammed 12fc9266de usb: musb: dsps: remove platform callback
dsps wrapper is dt only, it cannot execute platform callbacks.
Presence of this would cause NULL dereference, hence remove it.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-06 14:59:39 +02:00
Jean-Christophe PLAGNIOL-VILLARD bcd2360c1f arm: at91: move platfarm_data to include/linux/platform_data/atmel.h
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
2012-11-06 20:29:33 +08:00
Vivek Gautam 7947699a4e usb: dwc3: exynos: remove platform data support
We are removing plat data which was used till now to init and
exit phy. We no longer need this since dwc3-core takes care of
initializing and shutting-down the phy using usb_phy_init()
and usb_phy_shutdown().

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-06 13:44:29 +02:00
Vivek Gautam accefdd4b2 usb: dwc3: exynos: add support for device tree
This patch adds support to parse probe data for
dwc3-exynos driver using device tree.

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-06 13:44:15 +02:00
Stephen Warren dc9fe7f973 usb: phy: tegra remove include of <mach/iomap.h>
Almost nothing from this file is used, and the file will hopefully be
deleted soon. Copy the tiny portions that are used directly into
tegra_usb_phy.c. I believe that Venu Byravarasu is working on cleaning up
our USB driver, and those cleanups will remove the need for these
constants.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-05 11:36:04 -07:00
Stephen Warren f7d147dd87 usb: host: tegra remove include of <mach/iomap.h>
Almost nothing from this file is used, and the file will hopefully be
deleted soon. Copy the tiny portions that are used directly into
ehci-tegra.c. I believe that Venu Byravarasu is working on cleaning up
our USB driver, and those cleanups will remove the need for these
constants.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-05 11:36:04 -07:00
Olof Johansson 365480d67b Merge branch 'depends/omap-cleanup-headers-usb' into next/headers
Conflicts resolved same as Tony did in his later dependent branch:

	arch/arm/mach-omap1/clock.c
	arch/arm/mach-omap2/board-2430sdp.c
	arch/arm/mach-omap2/board-4430sdp.c
	arch/arm/mach-omap2/board-cm-t35.c
	arch/arm/mach-omap2/board-igep0020.c
	arch/arm/mach-omap2/board-ldp.c
	arch/arm/mach-omap2/board-omap3beagle.c
	arch/arm/mach-omap2/board-omap3logic.c
	arch/arm/mach-omap2/board-omap4panda.c
	arch/arm/mach-omap2/board-overo.c
	arch/arm/mach-omap2/board-rm680.c
	arch/arm/mach-omap2/board-rx51.c
	arch/arm/mach-omap2/twl-common.c
	arch/arm/mach-omap2/usb-host.c
	arch/arm/mach-omap2/usb-musb.c

Signed-off-by: Olof Johansson <olof@lixom.net>
2012-11-05 10:27:33 -08:00
Olof Johansson 6d06721570 Merge branch 'depends/tty' into next/headers
Merging in Greg's tty tree including a cleanup patch needed by the OMAP serial
header cleanups.

* depends/tty: (305 commits)
  tty/serial/8250: Make omap hardware workarounds local to 8250.h
  serial/8250/8250_early: Prevent rounding error in uartclk
  serial: samsung: use clk_prepare_enable and clk_disable_unprepare
  TTY: Report warning when low_latency flag is wrongly used
  console: use might_sleep in console_lock
  TTY: move tty buffers to tty_port
  TTY: add port -> tty link
  TTY: tty_buffer, cache pointer to tty->buf
  TTY: move TTY_FLUSH* flags to tty_port
  TTY: n_tty, propagate n_tty_data
  TTY: move ldisc data from tty_struct: locks
  TTY: move ldisc data from tty_struct: read_* and echo_* and canon_* stuff
  TTY: move ldisc data from tty_struct: bitmaps
  TTY: move ldisc data from tty_struct: simple members
  TTY: n_tty, add ldisc data to n_tty
  TTY: audit, stop accessing tty->icount
  TTY: n_tty, remove bogus checks
  TTY: n_tty, simplify read_buf+echo_buf allocation
  TTY: hci_ldisc, remove invalid check in open
  TTY: ldisc, wait for idle ldisc in release
  ...
2012-11-05 10:09:12 -08:00
Alan Stern cdb2fac783 USB: EHCI: fix build error in ChipIdea host driver
This patch (as1629) fixes a build error in the ChipIdea host driver
when compiled for the ARM architecture.  The error was introduced
by commit 99f91934a9 (USB: EHCI: make
ehci-platform a separate driver).

The fix is simple; an additional header-file #include is needed.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-03 10:17:38 -07:00
Jan Beulich bc8d51ea7e fix build of EHCI debug port code when USB_CHIPIDEA but !USB_EHCI_HCD
Relax condition of building the reset interface stubs in
drivers/usb/early/ehci-dbgp.c from USB_EHCI_HCD to just USB, to also
cover the chipidea driver re-using code from ehci-hcd.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 10:13:33 -07:00
Alan Stern 09f6ffde2e USB: EHCI: fix build error by making ChipIdea host a normal EHCI driver
This patch (as1627) splits the ehci-hcd core code, which has become a
separate library module, out from the ChipIdea host driver.  Instead
of #include-ing ehci-hcd.c directly, the ChipIdea module will now use
the ehci-hcd library in a normal fashion.

This fixes a build error caused by commit
3e02320399 (USB: EHCI: prepare to make
ehci-hcd a library module); I had forgotten about the unorthodox way
the ChipIdea driver uses the ehci-hcd code.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 10:03:50 -07:00
Vincent Palatin 57465109ce USB: ohci-exynos: initialize registers pointer earlier
In the former code, we have a race condition between the first interrupt
and the regs field initilization in the usb_hcd structure.
If the OHCI irq fires before hcd->regs is set, we are getting a null
pointer dereference in ohci_irq.

When calling usb_add_hcd(), it first executes the reset() callback,
then enables the ohci interrupt, and finally executes the start()
callback. So moving the ohci_init() call which actually initializes the
reg field from start() to reset() should remove the race.

Tested by enabling the external HSIC hub in the bootloader on an exynos5
machine and booting. With the former code, this triggers an early interrupt
about 50% of the boots and a subsequent kernel panic in ohci_irq when trying
to access the registers.

Cc: Olof Johansson <olofj@chromium.org>
Cc: Doug Anderson <dianders@chromium.org>
Cc: Arjun.K.V <arjun.kv@samsung.com>
Cc: Vikas Sajjan <vikas.sajjan@samsung.com>
Cc: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 09:25:20 -07:00
Alan Stern d1bb67a7a2 USB: EHCI: fix build error in ehci-platform.c under PowerPC
This patch (as1628) fixes a build error in the ehci-platform driver
when compiled for the PowerPC architecture.  The error was introduced
by commit 99f91934a9 (USB: EHCI: make
ehci-platform a separate driver).

The fix is simple; a few additional header-file #includes are needed.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 09:24:15 -07:00
Alan Stern 99f91934a9 USB: EHCI: make ehci-platform a separate driver
This patch (as1626) splits the ehci-platform code from ehci-hcd out
into its own separate driver module.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-01 08:51:13 -07:00
Alan Stern adfa79d1c0 USB: EHCI: make ehci-pci a separate driver
This patch (as1625) splits the PCI portion of ehci-hcd out into its
own separate driver module, called ehci-pci.  Consistently with the
current practice, the decision whether to build this module is not
user-configurable.  If EHCI and PCI are enabled then the module will
be built, always.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-01 08:51:12 -07:00
Alan Stern 3e02320399 USB: EHCI: prepare to make ehci-hcd a library module
This patch (as1624) prepares ehci-hcd for being split up into a core
library and separate platform driver modules.  A generic
ehci_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
ehci_setup(), ehci_suspend(), and ehci_resume() routines need to be
EXPORTed for use by the drivers.

As a side effect of this change, a few routines no longer need to be
marked __maybe_unused.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-01 08:51:12 -07:00
Sebastian Andrzej Siewior 2f77116425 usb: musb: remove hand-crafted id handling
This replaced the handcrafted id handling by the PLATFORM_DEVID_AUTO
value which should do the same thing.

This patch probably also fixes ux500 because I did not find the "musbid"
variable to remove. And we close a tiny-unlikely race window becuase the
old code gave the id back before device was destroyed in the remove
case.

[ balbi@ti.com : fixed up two failed hunks when applying patch ]

Cc: B, Ravi <ravibabu@ti.com>
Cc: Santhapuri, Damodar <damodar.santhapuri@ti.com>
Cc: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Cc: Bob Liu <lliubbo@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-01 12:32:23 +02:00
Kuninori Morimoto 1789e52acc usb: phy: add R-Car USB phy driver
This patch adds Renesas R-Car USB phy driver.
It supports R8A7779 chip at this point.

R-Car has some USB controllers, but has only one phy-initializer.
So, this driver is counting users.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-01 12:17:53 +02:00
Bjørn Mork 7c83b44836 USB: option: idVendor and idProduct are __le16
The exception is needed on big endian systems too.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-31 12:58:12 -07:00
Bjørn Mork dbdf680703 USB: option: replace vendor probe rule with match flags
No need for a vendor specific probe exception just to
match on the interface class.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-31 12:58:12 -07:00
Bjørn Mork 1b95bee563 USB: option: never bind to a usb-storage interface
There are many modems in addition to the D-Link DWM 652
exposing the CD interface in modem mode, and some expose
an integrated card reader as well. Always ignore these
interfaces.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-31 12:58:11 -07:00
Alan Stern c73cee717e USB: EHCI: remove ehci_port_power() routine
This patch (as1623) removes the ehci_port_power() routine and all the
places that call it.  There's no reason for ehci-hcd to change the
port power settings; the hub driver takes care of all that stuff.

There is one exception: When the controller is resumed from
hibernation or following a loss of power, the ports that are supposed
to be handed over to a companion controller must be powered on first.
Otherwise the handover won't work.  This process is not visible to the
hub driver, so it has to be handled in ehci-hcd.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-31 12:48:07 -07:00
Alan Stern 4968f95191 USB: EHCI: remove unused Link Power Management code
This patch (as1622) removes the USB-2.1 Link Power Management code
from the ehci-hcd driver.  This code was never integrated with
usbcore, it is full of bugs, and it was not getting used by anybody.

However, the debugging code for dumping the LPM-related fields in the
EHCI registers is left in place.  In theory it might be useful to see
these values, even though we don't use them.

This essentially amounts to a partial revert of commit
aa4d834298 (USB: EHCI: EHCI 1.1
addendum: preparation) and an almost full revert of commit
48f2497014 (USB: EHCI: EHCI 1.1
addendum: Basic LPM feature support) plus its follow-ons.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-31 12:48:07 -07:00
Alan Stern 571e41214e USB: remove iteration limit in hub_tt_work()
This patch (as1621) removes the limit on the number of loops allowed
in hub_tt_work().  The value is arbitrary, and it's silly to have a
limit in the first place -- anything beyond the limit would not get
handled.

Besides, it's most unlikely that we'll ever need to clear more than a
couple of TT buffers at any time.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-31 12:48:07 -07:00