History log of /drivers/usb/musb/musb_dsps.c
Revision Date Author Comments
f042e9cbae607c323e3de86fc714b7306774a151 13-Oct-2014 Sebastian Andrzej Siewior <bigeasy@linutronix.de> usb: musb: musb_dsps: fix NULL pointer in suspend

So testing managed to configure musb in DMA mode but not load the
matching cppi41 driver for DMA. This results in

|musb-hdrc musb-hdrc.0.auto: Failed to request rx1.
|musb-hdrc musb-hdrc.0.auto: musb_init_controller failed with status -517
|platform musb-hdrc.0.auto: Driver musb-hdrc requests probe deferral

which is "okay". Once the driver is loaded we re-try probing and
everyone is happy. Until then if you try suspend say
echo mem > /sys/power/state
then you go boom

|Unable to handle kernel NULL pointer dereference at virtual address 000003a4
|pgd = cf50c000
|[000003a4] *pgd=8f6a3831, *pte=00000000, *ppte=00000000
|Internal error: Oops: 17 [#1] ARM
|PC is at dsps_suspend+0x18/0x9c [musb_dsps]
|LR is at dsps_suspend+0x18/0x9c [musb_dsps]
|pc : [<bf08e268>] lr : [<bf08e268>] psr: a0000013
|sp : cbd97e00 ip : c0af4394 fp : 00000000
|r10: c0831d90 r9 : 00000002 r8 : cf6da410
|r7 : c03ba4dc r6 : bf08f224 r5 : 00000000 r4 : cbc5fcd0
|r3 : bf08e250 r2 : bf08f264 r1 : cf6da410 r0 : 00000000
|[<bf08e268>] (dsps_suspend [musb_dsps]) from [<c03ba508>] (platform_pm_suspend+0x2c/0x54)
|Code: e1a04000 e9900041 e2800010 eb4caa8e (e59053a4)

because platform_get_drvdata(glue->musb) returns a NULL pointer as long as the
device is not fully probed.

Tested-by: George Cherian <george.cherian@ti.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
53185b3a441a6cc9bb3f57e924342d249138dcd6 13-Oct-2014 Sebastian Andrzej Siewior <bigeasy@linutronix.de> usb: musb: dsps: start OTG timer on resume again

Commit 468bcc2a2ca ("usb: musb: dsps: kill OTG timer on suspend") stopped
the timer in suspend path but forgot the re-enable it in the resume
path. This patch fixes the behaviour.

Cc: <stable@vger.kernel.org> # v3.14+
Fixes 468bcc2a2ca "usb: musb: dsps: kill OTG timer on suspend"
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
468bcc2a2ca071f652009d2d20d97f2437630cae 15-Sep-2014 Felipe Balbi <balbi@ti.com> usb: musb: dsps: kill OTG timer on suspend

if we don't make sure to kill the timer, it could
expire after we have already gated our clocks.

That will trigger a Data Abort exception because
we would try to access register while clock is gated.

Fix that bug.

Cc: <stable@vger.kernel.org> # v3.14+
Fixes 869c597 (usb: musb: dsps: add support for suspend and resume)
Tested-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
371254ce462fcea2d09ffa30e20f01538b833080 16-Jul-2014 George Cherian <george.cherian@ti.com> usb: musb: dsps: Add the sw_babble_control() and Enable for newer silicon

Add sw_babble_control() logic to differentiate between transient
babble and real babble condition. Also add the SW babble control
register definitions.

Babble control register logic is implemented in the latest
revision of AM335x.

Find whether we are running on newer silicon. The babble control
register reads 0x4 by default in newer silicon as opposed to 0
in old versions of AM335x. Based on this enable the sw babble
control logic.

Signed-off-by: George Cherian <george.cherian@ti.com>
Tested-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
d871c622e202efc663f953a4fcbd2cba6a28a24f 16-Jul-2014 George Cherian <george.cherian@ti.com> usb: musb: core: Convert the musb_platform_reset to have a return value.

Currently musb_platform_reset() is only used by dsps.
In case of BABBLE interrupt for other platforms the musb_platform_reset()
is a NOP. In such situations no need to re-initialize the endpoints.
Also in the latest silicon revision of AM335x, we do have a babble recovery
mechanism without resetting the IP block. In preperation to add that support
its better to have a rest_done return for musb_platform_reset().

Signed-off-by: George Cherian <george.cherian@ti.com>
Tested-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
8035691365b80428c58908215d4408559afe7cb3 30-Jun-2014 Lothar Waßmann <LW@KARO-electronics.de> usb: musb: dsps: fix the base address for accessing the mode register

commit 943c13971c08 "usb: musb: dsps: implement ->set_mode()"
should have made it possible to use the driver with boards that have
the USBID pin unconnected. This doesn't actually work, since the
driver uses the wrong base address to access the mode register.
Furthermore it uses different base addresses in different places to
access the same register (phy_utmi).

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
56700178493eaab243b7b7b04077775cea6a87bd 26-May-2014 George Cherian <george.cherian@ti.com> usb: musb: dsps: Call usb_phy(_shutdown/_init) during musb_platform_reset()

For DSPS platform usb_phy_vbus(_off/_on) are NOPs.
So during musb_platform_reset() call usb_phy(_shutdown/_init)

Signed-off-by: George Cherian <george.cherian@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
fc7af215f9151316e9b4ce261f52043966f06976 30-Jun-2014 Lothar Waßmann <LW@KARO-electronics.de> usb: musb: dsps: coding style cleanup

There is no reason for the register accessor functions not to adhere
to the CodingStyle rules.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
5b7839836109a802b144a05cfbd4f57e6564d8e5 17-Apr-2014 Wolfram Sang <wsa@sang-engineering.com> usb: musb: dsps: compile suspend/resume only with PM_SLEEP

Depending on PM is not enough, because only PM_RUNTIME could be
selected. Fixes:

drivers/usb/musb/musb_dsps.c:703:12: warning: 'dsps_suspend' defined but not used [-Wunused-function]
drivers/usb/musb/musb_dsps.c:721:12: warning: 'dsps_resume' defined but not used [-Wunused-function]

Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
1d57de306e1f3e73c607811a974f6662162e5df6 02-Apr-2014 Daniel Mack <zonque@gmail.com> usb: musb: dsps: handle babble interrupts

When the dsps isr sees a babble error, pass it down to the core for
fixup. Also, provide a .reset hook so the core can call us back.

A babble interrupt error occured when a USB mass storage device
("CHIPSBNK v3.3.9.1", 1e3d:2093) was disconnected from a AM33xx host.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Reported-by: Thomas Mellenthin <mellenthin@teufel.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
d7078df6be6e9e5e3ac354859f5b8d60114391b4 16-Apr-2014 Felipe Balbi <balbi@ti.com> usb: phy: rename <linux/usb/usb_phy_gen_xceiv.h> to <linux/usb/usb_phy_generic.h>

now that all functions match the driver name,
the only missing piece is to rename the header
file itself.

Signed-off-by: Felipe Balbi <balbi@ti.com>
0fca91b8a446d4a38b8f3d4772c4a8665ebcd7b2 02-Apr-2014 Daniel Mack <zonque@gmail.com> usb: musb: dsps: move debugfs_remove_recursive()

When the platform initialization fails due to missing resources, it will
return -EPROBE_DEFER after dsps_musb_init() has been called.

dsps_musb_init() calls dsps_musb_dbg_init() to allocate the debugfs
nodes. At a later point in time, the probe will be retried, and
dsps_musb_dbg_init() will be called again. debugfs_create_dir() will
fail this time, as the node already exists, and so the entire device
probe will fail with -ENOMEM.

Fix this by moving debugfs_remove_recursive() from dsps_remove() to the
plaform's exit function, so it will be cleanly torn down when the probe
fails. It also feels more natural this way, as .exit is the counterpart
to .init.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
40f099e32c2a06bad7d75683421e30fcc74924cd 17-Jan-2014 Markus Pargmann <mpa@pengutronix.de> usb: musb: dsps, debugfs files

debugfs files to show the contents of important dsps registers.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
de9db572fe5135bb2cf5bb2d8520f99a56b21d9b 17-Jan-2014 Markus Pargmann <mpa@pengutronix.de> usb: musb: dsps, use devm_kzalloc

Replace kzalloc by devm_kzalloc and remove the kfree() calls.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
803a536243b3a1ed2289f41897b11b72bd083309 08-Jan-2014 Paul Gortmaker <paul.gortmaker@windriver.com> usb: delete non-required instances of include <linux/init.h>

None of these files are actually using any __init type directives
and hence don't need to include <linux/init.h>. Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5ace3d00fa11bb9ec5e1cc02805ac27201f27e61 30-Oct-2013 Bin Liu <b-liu@ti.com> usb: musb: dsps: polling ID pin status only in otg mode

Only start the otg_timer in dual role mode; otherwise in peripheral mode
when musb is disconnected from the host port, otg_timer starts and
continuously toggles the session, which causes VBUS pulse.

Signed-off-by: Bin Liu <b-liu@ti.com>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
869c597829817af4b9f85c5e4181c622918dc781 26-Nov-2013 Daniel Mack <zonque@gmail.com> usb: musb: dsps: add support for suspend and resume

The dsps platform needs to save save some registers at suspend time and
restore them after resume. This patch adds a struct for these registers,
and also lets the musb core know that the core registers need to be
saved as well.

We also have to explicitly de-assert the port reset upon resume on this
platform, but musb_port_reset() should not be called from glue layers.

Hence, introduce a flag in struct musb_hdrc_config for this.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
b991f9b77c029135f6e0d1d5d16869ebf755c4c0 25-Nov-2013 Daniel Mack <zonque@gmail.com> usb: musb: dsps: add {tx,rx}_mode to wrapper

rx_mode and tx_mode need to be read at suspend time and restored on
resume for dsps platforms. So add it to the wrapper struct first, and
initialize the values.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
943c13971c08ddeb06f4cb9dea1addb76f6b4423 29-Oct-2013 Felipe Balbi <balbi@ti.com> usb: musb: dsps: implement ->set_mode()

this will let us support broken designs such
as AM335x EVM SK where ID pin isn't routed
anywhere on a host port.

With this we can toggle internal IDDIG signal
and make sure MUSB goes into host mode as
necessary.

Signed-off-by: Felipe Balbi <balbi@ti.com>
24616eb66a996d30bf6449feb313a29cd1083cf9 15-Oct-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de> usb: musb: dsps: run the timer only on OTG systems

I introduced this check here because it looked wrong in HOST only
configurions. The timer would remove that session bit and will never
come back and so there would not be another session.
Now that I played with OTG for a while I belive this workaround is
only required for the OTG mode because we have to end the session and
then we have to try to start manually.
Therefore, this patch limits this timer to the OTG only port mode so we
don't need to poll around in device only mode.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
0f901c980110cd69b63670096465b35377e73b1c 15-Oct-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de> usb: musb: dsps: redo the otg timer

According to the comments, we rely on the OTG timer because the core
does not expose some important OTG details. So far this is all I
know. After playing with OTG I stumbled over a problem:
musb is recognized as a B-device without a problem. Whenever a cable is
plugged, the VBUS rises, musb recognizes this as a starting session,
sets the MUSB_DEVCTL_SESSION bit by itself and a RESET interrupt occurs,
the session starts. Good.
After a disconnect, the timer is started and re-starts itself because
it remains in B_IDLE with the BDEVICE set. I didn't figure the the
reason or the need for it. Nothing changes here except for OTG state
from B to A device if the BDEVICE bit disappears. This doesn't make much
sense to me because nothing happens after this. _IF_ we receive an
interrupt before the state change then we may act on wrong condition.
Plugging a B-device (and letting MUSB act as host) doesn't work here.
The reason seems to be that the MUSB tries to start a session, it fails
and then it removes the bit. So we never start as a host.

This patch sets the MUSB_DEVCTL_SESSION bit in the IDLE state so musb
can try to establish a session as host. After the bit is set, musb tries
to start a session and if it fails it clears the bit. Therefore it will
try over and over again until a session either as host or as device is
established.

The readout of the MUSB_DEVCTL register after the removal the
MUSB_DEVCTL_SESSION (in A_WAIT_BCON) has been removed because it did not
contain the BDEVICE bit set (in the second read) leading to A_IDLE. After
plugging a host musb assumed that it is also a host and complained about
a missing reset. However a third read of the register has has the BDEVICE
bit set so it seems that it is not stable.
This mostly what da8xx.c is doing except that we set the timer also
after A_WAIT_BCON so the session bit can be triggered.

Whit this change I was able to keep am335x-evm in OTG mode and plug in
either a HOST or a DEVICE and in a random order and the device was
recognized.

Cc: stable@vger.kernel.org # v3.11
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
807d0d2b35f94a8074d195bfdabe407f0089a694 15-Oct-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de> usb: musb: dsps: remove declartion for dsps_musb_try_idle()

This patch moves dsps_musb_try_idle() before dsps_musb_enable() so the
declaration (of dsps_musb_try_idle() can be removed.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
8b9fcce2d88586b9a120ff3e039d8f42413f0bb0 15-Oct-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de> usb: musb: dsps: move try_idle to start hook

The timer is initialized right after musb is probed. There is actually
no need to have this timer running because _nothing_ will happen until
we have the gadget loaded. Also we need this timer only if we run in OTG
mode _and_ we need it also after the gadget has been replaced with
another one.

I've been looking at am35x.c, da8xx.c, omap2430.c, tusb6010.c. da8xx
seem to have the same problem as dsps and doing mostly the same thing.
tusb6010 seem to do something different and do some actual "idle / power
saving" work so I am not too comfortable to remove
musb_platform_try_idle() from musb_gadget_setup().

Therefore this patch does not start the timer if there is no gadget
active (which is at musb_gadget_setup() at time). In order to have the
timer active after the gadget is loaded it will be triggered from
dsps_musb_enable().

Cc: stable@vger.kernel.org # v3.11
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2b84f92b8141679be6b90396655fa4887589ec28 09-Oct-2013 Joe Perches <joe@perches.com> usb: Remove unnecessary semicolons

These aren't necessary after switch and if blocks.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
b432cb837480d7b93f95c2c5766828e9ac7f036a 30-Sep-2013 Sachin Kamat <sachin.kamat@linaro.org> usb: musb_dsps: Remove redundant of_match_ptr

The data structure of_match_ptr() protects is always compiled in.
Hence of_match_ptr() is not needed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Ravi B <ravibabu@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
4fc4b274f9b3b5f18896a069e5f9f8dd8f0d450a 01-Oct-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de> usb: musb: dsps: do not bind to "musb-hdrc"

This went unnoticed in durin the merge window:
The dsps driver creates a child device for the musb core driver _and_
attaches the of_node to it so devm_usb_get_phy_by_phandle() grabs the
correct phy and attaches the devm resources to the proper device. We
could also use the parent device but then devm would attach the
resource to the wrong device and it would be destroyed once the parent
device is gone - not the device that is used by the musb core driver.

If the phy is now not available then dsps_musb_init() /
devm_usb_get_phy_by_phandle() returns with EPROBE_DEFER. Since the
of_node is attached it tries OF drivers as well and matches the driver
against DSPS. That one creates a new child device for the musb core
driver which gets probed immediately.

The whole thing repeats itself until the stack overflows.

I belive the same problem exists in ux500 glue code (since 313bdb11
("usb: musb: ux500: add device tree probing support") but the drivers are
now probed in the right order so they don't see it.

The problem is that the dsps driver gets bound to the musb-child device
due to the same of_node / matching binding. I don't really agree with
having yet another child node in DT to fix this. Ideally we would have
musb core driver with DT bindings and according to the binding we would
select the few extra hacks / gleue layer.

Therefore I suggest the driver to reject the musb-core device.

Cc: Lee Jones <lee.jones@linaro.org>
Tested-by: Tom Rini <trini@ti.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
781f17983015dae33324e34d1bb831e715fa04d4 20-Aug-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de> usb: musb: am335x-evm: Do not remove the session bit HOST-only mode

This is what I observe:
On the first connect, the musb starts with DEVCTL.Session set. On
disconnect, musb_core calls try_idle. That functions removes the Session
bit signalizing that the session is over (something that only in OTG is
required). A new device, that is plugged, is no longer recognized.
I've setup a timer and checked the DEVCTL register and I haven't seen a
change in VBus and I saw the B-Device bit set. After setting the IDDIG
into A mode and forcing the device to behave like a A device, I didn't
see a change.
Neither VBUS goes to 0b11 nor does a session start request comes.
In the TI-v3.2 kernel they skip to call musb_platform_try_idle() in the
OTG_STATE_A_WAIT_BCON state while not in OTG mode.
Since the second port hast a standard A plug the patch changes the port
to run in host mode only and skips the timer which would remove
DEVCTL.Session so we can reconnect to another device later.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9dfa36218dadf1821da5823773dd689b4e650e00 20-Aug-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de> usb: musb: dsps: do not set is_active on the first drvbus interrupt

Quite early on init there is an vbus / drvvbus interrupt comming and the
dsps code sets is_active to one. As a result we see a lot of

|musb_bus_suspend 2459: trying to suspend as a_wait_bcon while active

until a device is plugged in with pm_runtime enabled in the kernel.
After checking davinci, am35, da8xx I noticed that dsps is actually the
only one doing this.
So remove it and we won't flooded with mesages and the idle port can be
suspended.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
c031a7d419340f30e66dc18fab4373ad646ca7e6 20-Aug-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de> usb: usb: dsps: update code according to the binding document

This relfects the code and dts requires changes due to recent .dts
binding updates:
- use mg prefix for the Metor Graphics specific attributes
- use power in mA not in mA/2 as specifed in the USB2.0 specification
- remove the child node for USB. This is driver specific on won't be
reflected in the device tree
- use the "mentor" prefix instead of "mg".
- use "dr_mode" istead of "mg,port-mode" for the port mode. The former
is used by a few other drivers.

Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: devicetree@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
51ef74f6400c731827454d010b35b122103fe9f9 19-Aug-2013 Julia Lawall <Julia.Lawall@lip6.fr> usb: musb: dsps: fix devm_ioremap_resource error detection code

devm_ioremap_resource returns an ERR_PTR value, not NULL, on failure.
Furthermore, the value returned by devm_ioremap_resource should be tested.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e,e1;
statement S;
@@

*e = devm_ioremap_resource(...);
if (!e1) S

// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Felipe Balbi <balbi@ti.com>
97238b35d5bbb5d5312d83c30a429824b777619f 05-Jul-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de> usb: musb: dsps: use proper child nodes

This moves the two instances from the big node into two child nodes. The
glue layer ontop does almost nothing.

There is one devices containing the control module for USB (2) phy,
(2) usb and later the dma engine. The usb device is the "glue device"
which contains the musb device as a child. This is what we do ever since.

The new file musb_am335x is just here to prob the new bus and populate
child devices.

There are a lot of changes to the dsps file as a result of the changes:

- musb_core_offset
This is gone. The device tree provides memory ressources information
for the device there is no need to "fix" things

- instances
This is gone as well. If we have two instances then we have have two
child enabled nodes in the device tree. For instance the SoC in beagle
bone has two USB instances but only one has been wired up so there is
no need to load and init the second instance since it won't be used.

- dsps_glue is now per glue device
In the past there was one of this structs but with an array of two and
each instance accessed its variable depending on the platform device
id.

- no unneeded copy of structs
I do not know why struct dsps_musb_wrapper is copied but it is not
necessary. The same goes for musb_hdrc_platform_data which allocated
on demand and then again by platform_device_add_data(). One copy is
enough.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
e96bdc3dafe471375e2e780e319e3ead2d9ad4a7 05-Jul-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de> usb: musb: dsps: remove the hardcoded phy pieces

dsps uses a nop driver which is added in dsps itself and does the PHY
on/off calls within dsps. Since those calls are now moved the nop driver
itself, we can now request the phy proper phy and remove those calls.
Currently only the first musb interface is used so we only add one phy
node for now.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
3fa4d7344be0afebd80382ffeea6b1787cccf971 26-Jul-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de> usb: phy: rename nop_usb_xceiv => usb_phy_gen_xceiv

The "nop" driver isn't a do-nothing-stub but supports a couple functions
like clock on/off or is able to use a voltage regulator. This patch
simply renames the driver to "generic" since it is easy possible to
extend it by a simple function istead of writing a complete driver.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
c1a7d67c1901347bdb3d06536cd69d018fbf2c4b 30-Jul-2013 Jingoo Han <jg1.han@samsung.com> usb: musb: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9be73bae70ac5b0149daa243eeae2bdacd970574 26-Jul-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de> usb: musb: dsps: remove EOI access

The EOI register is not present in the AM335x memory space according to
the TRM and thus removed.
Should any platform using the EOI register get merged then it may be
used again if the register address is not zero.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
fa7b4ca50f03b6e71665ccef66ca000311353fc8 26-Jul-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de> usb: musb: dsps: rename ti81xx_driver_data to am33xx_driver_data

The ti81xx platform is not fully supported right now. This patch renames
the date structure to a am33xx prefix which is actually used.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
e9eb2e08d93afc8f334ffe269fc84ea6257ff02c 22-Jul-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de> usb: musb: remove ti81xx pieces from musb

ti81xx does not have a baseport mainline i.e. it should not boot. The
amount of rework that is required makes it easier to simply remove that
platform (i.e. that possible platform device) and add it later once it
comes back with DT support.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
7557a57f5e649c99239975529e2b30dc4990c548 22-Jul-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de> usb: musb: dsps: init / shutdown the phy

If the init / shutdown function of the phy moves out of dsps into the
phy driver, then dsps needs to call the callbacks of the phy driver to
ensure that this happens.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
8b513d0cf603c0a9ccf86a92cb22931f05a7bc86 21-May-2013 Masanari Iida <standby24x7@gmail.com> treewide: Fix typo in printk

Correct spelling typo in various part of drivers

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
b25e5f1c4416cf96fac0918a8f1b0429642570a9 07-May-2013 Wei Yongjun <yongjun_wei@trendmicro.com.cn> usb: musb: dsps: fix error return code in dsps_create_musb_pdev()

Fix to return -ENOMEM in the devm_kzalloc() error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
96449f097e3874af0e8ddd721d3ebeed2ec389da 02-Apr-2013 Ravi Babu <ravibabu@ti.com> usb: musb: dsps: print babble message only when musb is active host

The musb controller uses single bit defintion for both reset and
babble events. The babble event is valid only when controller is
active a-host, and hence print the babble message only when the
controller is active a-host.

Signed-off-by: Ravi Babu <ravibabu@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
42c0bf1ce7c067bbc3e77d5626f102a16bc4fb6b 07-Mar-2013 Felipe Balbi <balbi@ti.com> usb: otg: prefix otg_state_string with usb_

all other functions under drivers/usb/ start
with usb_, let's do the same thing.

This patch is in preparation for moving otg_state_string
to usb-common.c and deleting otg.c completely.

Signed-off-by: Felipe Balbi <balbi@ti.com>
cc5060366b3c8cc20f0f4020a15fa5d39f4dc936 06-Feb-2013 Felipe Balbi <balbi@ti.com> usb: musb: dsps: fix possible compile warning

if CONFIG_OF is disabled, np will be unused
and that will give us a compile warning. This
patch just avoids it.

Signed-off-by: Felipe Balbi <balbi@ti.com>
0f53e48132cd95b359fc79e0aa44db1c406b4eff 06-Feb-2013 Felipe Balbi <balbi@ti.com> usb: musb: dsps: add missing include

<linux/sizes.h> is the header defining SZ_4
and SZ_16M, we shouldn't depend on indirect
inclusion so let's explicitly include it.

Signed-off-by: Felipe Balbi <balbi@ti.com>
148e11349b0c9c7199fd3096254bd3ea16d59a05 21-Jan-2013 Thierry Reding <thierry.reding@avionic-design.de> usb: Convert to devm_ioremap_resource()

Convert all uses of devm_request_and_ioremap() to the newly introduced
devm_ioremap_resource() which provides more consistent error handling.

devm_ioremap_resource() provides its own error messages so all explicit
error messages can be removed from the failure code paths.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25736e0c8269e9613aa6036fbc591818daa30d14 04-Jan-2013 Ming Lei <ming.lei@canonical.com> usb: musb: fix dependency on transceiver driver

This patch let glue driver return -EPROBE_DEFER if the transceiver
is not readly, so we can support defer probe on musb to fix the
below error on 3.7-rc5 if transceiver drivers are built as module:

[ 19.052490] unable to find transceiver of type USB2 PHY
[ 19.072052] HS USB OTG: no transceiver configured
[ 19.076995] musb-hdrc musb-hdrc.0.auto: musb_init_controller failed with status -19
[ 19.089355] musb-hdrc: probe of musb-hdrc.0.auto rejects match -19
[ 19.096771] driver: 'musb-omap2430': driver_bound: bound to device 'musb-omap2430'
[ 19.105194] bus: 'platform': really_probe: bound device musb-omap2430 to driver musb-omap2430
[ 19.174407] bus: 'platform': add driver twl4030_usb
[ 19.179656] bus: 'platform': driver_probe_device: matched device twl4030_usb with driver twl4030_usb
[ 19.202270] bus: 'platform': really_probe: probing driver twl4030_usb with device twl4030_usb
[ 19.214172] twl4030_usb twl4030_usb: HW_CONDITIONS 0xc0/192; link 3
[ 19.239624] musb-omap2430 musb-omap2430: musb core is not yet ready
[ 19.246765] twl4030_usb twl4030_usb: Initialized TWL4030 USB module
[ 19.254516] driver: 'twl4030_usb': driver_bound: bound to device 'twl4030_usb'
[ 19.263580] bus: 'platform': really_probe: bound device twl4030_usb to driver twl4030_usb

Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Cc: <stable@vger.kernel.org> v3.8
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
7e56e621ce9cf4604694c969087456aced338be6 19-Nov-2012 Sachin Kamat <sachin.kamat@linaro.org> usb: musb: dsps: Remove duplicate inclusion of linux/of.h

linux/of.h was included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
deeeb9ee1ed5b06864f530c6123976209badd489 27-Nov-2012 Afzal Mohammed <afzal@ti.com> usb: musb: dsps: header movement build error fix

"54db6ee ARM: OMAP2+: Introduce local usb.h" moved control module bit
definitions from plat/usb.h (which dsps glue was using) to a local
header in mach-omap2. And in parallel,
"c68bb4c usb: musb: dsps: control module handling (quirk)" added
control module handling capability to dsps glue driver that used
those control module bit definitions.

Integration of above two changes would cause build error in musb dsps
glue driver (they go through different trees upstream) as is seen now
in linux-next. Fix it by adding necessary definitions in dsps glue
driver.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
fb4e98ab63433c4d3a1588ea91c73f1cd7ebaa00 19-Nov-2012 Bill Pemberton <wfp5p@virginia.edu> usb: remove use of __devexit

CONFIG_HOTPLUG is going away as an option so __devexit 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2f82686e8c261d96d07bb1594d987cd6d5c64af6 19-Nov-2012 Bill Pemberton <wfp5p@virginia.edu> usb: remove use of __devinitconst

CONFIG_HOTPLUG is going away as an option so __devinitconst is no
longer needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Li Yang <leoli@freescale.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
41ac7b3ab7fe1d6175839947a877fdf95cbd2211 19-Nov-2012 Bill Pemberton <wfp5p@virginia.edu> 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>
7690417db5085f0de03aa70b8ca01b0118e8a1b4 19-Nov-2012 Bill Pemberton <wfp5p@virginia.edu> 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>
d75542263a0b005876d112bbf9ffb23180cc3149 06-Nov-2012 Afzal Mohammed <afzal@ti.com> Revert "usb: musb: dsps: remove explicit NOP device creation"

This reverts commit d8c3ef256f88b7c6ecd673d03073b5645be9c5e4.

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>
984e833c2bb6cba11e7cbc84c0dfb7b43792ff80 31-Oct-2012 Masanari Iida <standby24x7@gmail.com> 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>
c68bb4c679e68b2814bc5de812665fbd37f8a9b1 02-Nov-2012 Santhapuri, Damodar <damodar.santhapuri@ti.com> 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>
3e594b18f1871a758812aa5e705873012cabf0e8 02-Nov-2012 Afzal Mohammed <afzal@ti.com> 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>
3b46dd76a9b3ce25a5177f61eed844f85ddb3ca6 02-Nov-2012 Afzal Mohammed <afzal@ti.com> 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>
12fc9266dec3706ece7c4aafefc60d429149c3bd 02-Nov-2012 Afzal Mohammed <afzal@ti.com> 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>
2f7711642559851c187d09795a3eb51c2bde36ec 31-Oct-2012 Sebastian Andrzej Siewior <bigeasy@linutronix.de> 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>
b415c8fa9ee46f07a5a8c0dbf34c75519290a912 23-Oct-2012 Wei Yongjun <yongjun_wei@trendmicro.com.cn> usb: musb: dsps: use platform_device_unregister in dsps_delete_musb_pdev()

platform_device_unregister() only calls platform_device_del() and
platform_device_put(), thus use platform_device_unregister() to
simplify the code.

Also the documents in platform.c shows that platform_device_del
and platform_device_put must _only_ be externally called in error
cases. All other usage is a bug.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
e8c4a7acc9ec0ee82feedcdc3c6d0ee44d67918a 24-Oct-2012 Felipe Balbi <balbi@ti.com> ARM: OMAP: move OMAP USB platform data to <linux/platform_data/omap-usb.h>

In order to make single zImage work for ARM architecture,
we need to make sure we don't depend on private headers.

Move USB platform_data to <linux/platform_data/omap-usb.h>
and add a minimal drivers/mfd/usb-omap.h.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Partha Basak <parthab@india.ti.com>
Cc: Keshava Munegowda <keshava_mgowda@ti.com>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Felipe Balbi <balbi@ti.com>
[tony@atomide.com: updated for local mfd/usb-omap.h]
Signed-off-by: Tony Lindgren <tony@atomide.com>
ca749b2a2e72b39b3a46d1e4d096e338bf714a3c 17-Oct-2012 Daniel Mack <zonque@gmail.com> usb: musb: dsps: fix res_name length

The res_name is used for the name construction of a DT property as
follows:

sprintf(res_name, "port%d-mode", id);

Hence, res_name must be at least 11 characters long in order to store
the name including the terminating '\0'.

While at it, use to snprintf() rather than sprintf() when accessing this
buffer.

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
d8c3ef256f88b7c6ecd673d03073b5645be9c5e4 31-Aug-2012 Ajay Kumar Gupta <ajay.gupta@ti.com> usb: musb: dsps: remove explicit NOP device creation

As NOP device node is now added in am33xx tree so remove the call
which creates the NOP platform_device.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Santhapuri, Damodar <damodar.santhapuri@ti.com>
Signed-off-by: Ravi Babu <ravibabu@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
65145677a65c31a8fd2704e244801bdb11061f9a 31-Aug-2012 Ajay Kumar Gupta <ajay.gupta@ti.com> usb: musb: dsps: add dt support

Added device tree support for dsps musb glue driver and updated the
Documentation with device tree binding information.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Santhapuri, Damodar <damodar.santhapuri@ti.com>
Signed-off-by: Ravi Babu <ravibabu@ti.com>
[afzal@ti.com: use '-' instead of '_' for dt properties]
Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
db4a93202e086dbdb5789149666dbbff48f708bf 31-Aug-2012 B, Ravi <ravibabu@ti.com> usb: musb: am335x: add support for dual instance

AM335x and TI81xx platform has dual musb controller so updating the
musb_dspc.c to support the same.

Changes:
- Moved otg_workaround timer to glue structure
- Moved static local variable last_timer to glue structure
- PHY on/off related cleanups

Signed-off-by: Ravi Babu <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Santhapuri, Damodar <damodar.santhapuri@ti.com>
[afzal@ti.com: remove control module related modifications]
Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
65b3d52d02a558fbfe08e43688e15390c5ab3067 31-Aug-2012 B, Ravi <ravibabu@ti.com> usb: musb: add musb_ida for multi instance support

Added musb_ida in musb_core.c to manage the multi core ids.

Signed-off-by: Ravi Babu <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Santhapuri, Damodar <damodar.santhapuri@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
032ec49f5351e9cb242b1a1c367d14415043ab95 24-Nov-2011 Felipe Balbi <balbi@ti.com> usb: musb: drop useless board_mode usage

we are compiling the driver always with full OTG
capabilities, so that board_mode trick becomes
useless.

Signed-off-by: Felipe Balbi <balbi@ti.com>
78c289f8769aaefcc52d26ca53c8b2ee545fb332 19-Jul-2012 Felipe Balbi <balbi@ti.com> usb: xceiv: create nop-usb-xceiv.h and avoid pollution on otg.h

nop-usb-xceiv was polluting otg.h with its own
function prototypes. Move those prototypes to
a nop-usb-xceiv.h header.

Signed-off-by: Felipe Balbi <balbi@ti.com>
0e38c4ed83027e7e7d16568e43fb34a32c14f800 03-Jul-2012 Ajay Kumar Gupta <ajay.gupta@ti.com> usb: musb: reorder runtime pm call

The clock need to be enabled before the musb_core platform device is
created and registered.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
3bb5534853dbb1e445a9b26ecab8ad331ff14a7e 03-Jul-2012 Ajay Kumar Gupta <ajay.gupta@ti.com> usb: musb: am335x: fix pdev resource bug

We are overwriting the resource->name to "mc" so that musb_core.c
can understand it but this is also changing the platform device's
resource->name as the "name" address remains same.

Fixing the same by changing the resource->name field of local
structure only.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
ded017ee6c7b90f7356bd8488f8af1c10ba90490 26-Jun-2012 Kishon Vijay Abraham I <kishon@ti.com> usb: phy: fix return value check of usb_get_phy

usb_get_phy will return -ENODEV if it's not able to find the phy. Hence
fixed all the callers of usb_get_phy to check for this error condition
instead of relying on a non-zero value as success condition.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
662dca54ca67c92b7aa14b9a2ec54acacf33ce45 22-Jun-2012 Kishon Vijay Abraham I <kishon@ti.com> usb: otg: support for multiple transceivers by a single controller

Add a linked list for keeping multiple PHY instances with different
types so that we can have separate USB2 and USB3 PHYs on one single
board. _get_phy_ has been changed so that the controller gets
the transceiver by type. _remove_phy_ has been added to let the phy
be removed from the phy list.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
721002ec1dd55a52425455826af49cf8853b2d4f 22-Jun-2012 Kishon Vijay Abraham I <kishon@ti.com> usb: otg: utils: rename function name in OTG utils

_transceiver() in otg.c is replaced with _phy. usb_set_transceiver is
replaced with usb_add_phy to make it similar to other usb standard
function names like usb_add_hcd.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9ecb887522a0483fdde8db7ec41d72b8235f2fe8 12-Mar-2012 Ajay Kumar Gupta <ajay.gupta@ti.com> usb: musb: Add support for ti81xx platform

TI81XX platform has two musb interfaces and uses CPPI4.1 DMA engine.
It has builtin USB PHYs as AM35x. The current set of patches adds support
for one instance and only in PIO mode.

[ balbi@ti.com : make it compile and solve a "may be used
uninitialized" warning ]

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Ravi Babu <ravibabu@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>