Commit Graph

361413 Commits

Author SHA1 Message Date
Felipe Balbi
8698e2acf3 usb: dwc3: gadget: introduce and use enable/disable irq methods
we don't need to enable IRQs until we have
a gadget driver loaded and ready to work,
so let's delay IRQ enable to ->udc_start()
and IRQ disable to ->udc_stop().

While at that, also move the related use of
request_irq() and free_irq().

Tested-by: Vivek Gautam <gautam.vivek@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:17:00 +02:00
Felipe Balbi
f122d33e4b usb: dwc3: core: explicitly setup and cleanup event buffers
Make the call to dwc3_event_buffers_setup()
and dwc3_event_buffers_cleanup() explicit,
so it's easier to implement PM.

Tested-by: Vivek Gautam <gautam.vivek@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:59 +02:00
Felipe Balbi
4c0c6d0085 usb: gadget: mv_udc_core: switch over to usb_gadget_map/unmap_request()
we have generic implementations for a reason,
let's use them

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:59 +02:00
Felipe Balbi
369ac9cb3e usb: gadget: lpc32xx_udc: switch over to usb_gadget_map/unmap_request()
we have generic implementations for a reason,
let's use them

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:58 +02:00
Felipe Balbi
0324f25fc6 usb: gadget: fusb300: switch over to usb_gadget_map/unmap_request()
we have generic implementations for a reason,
let's use them

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:58 +02:00
Felipe Balbi
5f6da77857 usb: gadget: fsl_udc_core: switch over to usb_gadget_map/unmap_request()
we have generic implementations for a reason,
let's use them

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:57 +02:00
Felipe Balbi
1bda9df8dd usb: gadget: atmel_usba_udc: switch over to usb_gadget_map/unmap_request()
we have generic implementations for a reason,
let's use them.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:57 +02:00
Felipe Balbi
3be49f38d3 usb: gadget: amd5536udc: remove unused structure member
that member isn't used anywhere in the driver
and be removed with no mercy.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:56 +02:00
Felipe Balbi
e58ebcd142 usb: gadget: s3c-hsotg: switch over to usb_gadget_map/unmap_request()
we have generic implementations for a reason,
let's use them.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:56 +02:00
Felipe Balbi
7bce401cc6 usb: gadget: drop now unnecessary flag
We don't need the ->register_my_device flag
anymore because all UDC drivers have been
properly converted.

Let's remove every history of it.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:55 +02:00
Felipe Balbi
dc9e2873b7 usb: chipidea: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:54 +02:00
Felipe Balbi
45f596a6d7 usb: gadget: pxa27x_udc: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:54 +02:00
Felipe Balbi
b73f5a2a0a usb: gadget: pxa25x_udc: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:53 +02:00
Felipe Balbi
0972ef71b4 usb: renesas_usbhs: gadget: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:53 +02:00
Felipe Balbi
b1e1eaba29 usb: gadget: s3c2410_udc: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:52 +02:00
Felipe Balbi
40ed30cff5 usb: gadget: s3c-hsudc: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:52 +02:00
Felipe Balbi
b8d833a327 usb: gadget: s3c-hsotg: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:51 +02:00
Felipe Balbi
80bf5343de usb: gadget: r8a66597-udc: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:51 +02:00
Felipe Balbi
5a8a375714 usb: gadget: pch_udc: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:50 +02:00
Felipe Balbi
654dfe4d2a usb: gadget: net2280: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:49 +02:00
Felipe Balbi
c9f9c849ae usb: gadget: net2272: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:49 +02:00
Felipe Balbi
5dc7b77365 usb: gadget: mv_udc_core: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:48 +02:00
Felipe Balbi
2cd807e7a8 usb: gadget: mv_u3d_core: fix a compile warning
Fix the following compile warning:

mv_u3d_core.c:1766:12: warning: 'mv_u3d_remove' \
	defined but not used [-Wunused-function]

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:48 +02:00
Felipe Balbi
7a071890b4 usb: gadget: mv_u3d_core: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:47 +02:00
Felipe Balbi
96d20c32f6 usb: gadget: m66592-udc: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:47 +02:00
Felipe Balbi
e0c9e4739a usb: gadget: lpc32xx_udc: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:46 +02:00
Felipe Balbi
0b3702c62e usb: gadget: imx_udc: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:46 +02:00
Felipe Balbi
5637bf5b7a usb: gadget: goku_udc: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:45 +02:00
Felipe Balbi
fc84d2fbe7 usb: gadget: fusb300_udc: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:45 +02:00
Felipe Balbi
eab35c4e6d usb: gadget: fsl_udc_core: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:44 +02:00
Felipe Balbi
c07d1b63ac usb: gadget: fsl_qe_udc: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:44 +02:00
Felipe Balbi
002cb13f4a usb: gadget: dummy_hcd: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:43 +02:00
Felipe Balbi
9b4ead05e7 usb: gadget: bcm63xx_udc: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:43 +02:00
Felipe Balbi
621c723eb7 usb: gadget: atmel_usba_udc: let udc-core manage gadget->dev
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:42 +02:00
Felipe Balbi
2533beea90 usb: gadget: at91_udc: let udc-core manage gadget->dev
By simply setting a flag, we can remove some
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:42 +02:00
Felipe Balbi
12ad0fcaf2 usb: gadget: amd5536udc: let udc-core manage gadget->dev
By simply setting a flag, we drop some boilerplate
code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:41 +02:00
Felipe Balbi
6dfc84fcb6 usb: gadget: omap_udc: let udc-core manage gadget->dev
By simply setting a flag, we drop some boilerplate
code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:41 +02:00
Felipe Balbi
5ed01c6400 usb: musb: gadget: let udc-core manage gadget-dev
By simply setting a flag, we can delete a little
boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:40 +02:00
Felipe Balbi
1e1930bd3d usb: dwc3: gadget: let udc-core manage gadget->dev
We don't need to register that device ourselves
if we simply set gadget->register_my_device.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:40 +02:00
Felipe Balbi
f07bd56bbd usb: gadget: udc-core: allow udc class register gadget device
Currently all UDC drivers are calling
device_register() before calling
usb_add_gadget_udc(). In order to avoid
code duplication, we can allow udc-core.c
register that device.

However that would become a really large patch,
so to cope with the meanwhile and allow us
to write bite-sized patches, we're adding
a flag which will be set by UDC driver once
it removes the code for registering the
gadget device.

Once all are converted, the new flag will
be removed.

Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:39 +02:00
Kishon Vijay Abraham I
7eaf8f2a7d usb: dwc3: omap: stop using nop-usb-xceiv
Now that we have drivers for omap-usb2 phy and omap-usb3 phy, stop
using nop-usb-xceiv.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:39 +02:00
Kishon Vijay Abraham I
4495afcf71 usb: dwc3: omap: remove platform data associated with dwc3-omap
omap5 is not going to have support for non-dt boot making the platform
data associated with dwc3 useless. Removed it here.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:38 +02:00
Kishon Vijay Abraham I
e36a0c870f usb: dwc3: omap: minor fixes to get dt working
Includes few minor fixes in dwc3-omap like populating the compatible
string in a correct way, extracting the utmi-mode property properly and
changing the index of get_irq since irq of core is removed from hwmod
entry.

Also updated the documentation with dwc3-omap device tree binding
information.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>

[ balbi@ti.com : fix a compile warning introduced by
	this commit ]

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:16:33 +02:00
Roger Quadros
b54b5f5653 USB: phy: nop: Defer probe if device needs VCC/RESET
Add 2 flags, needs_vcc and needs_reset to platform data.
If the flag is set and the regulator couldn't be found
then we bail out with -EPROBE_DEFER.

For device tree boot we depend on presensce of vcc-supply/
reset-supply properties to decide if we should bail out
with -EPROBE_DEFER or just continue in case the regulator
can't be found.

This is required for proper functionality in cases where the
regulator is needed but is probed later than the PHY device.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:15:18 +02:00
Roger Quadros
0eba387973 usb: phy: nop: Add device tree support and binding information
The PHY clock, clock rate, VCC regulator and RESET regulator
can now be provided via device tree.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:15:12 +02:00
Roger Quadros
90f4232f31 usb: phy: nop: use new PHY API to register PHY
We would need to support multiple PHYs of the same type
so use the new PHY API usb_add_phy_dev() to register the PHY.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:15:02 +02:00
Roger Quadros
ad63ebfc35 usb: phy: nop: Handle RESET for the PHY
We expect the RESET line to be modeled as a regulator with supply
name "reset". The regulator should be modeled such that enabling
the regulator brings the PHY device out of RESET and disabling the
regulator holds the device in RESET.

They PHY will be held in RESET in .shutdown() and brought out of
RESET in .init().

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:14:53 +02:00
Roger Quadros
58f735fe47 usb: phy: nop: Handle power supply regulator for the PHY
We use "vcc" as the supply name for the PHY's power supply.
The power supply will be enabled during .init() and disabled
during .shutdown()

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:14:46 +02:00
Roger Quadros
2319fb88e1 usb: phy: nop: Manage PHY clock
If the PHY has a clock associated to it then manage the clock.
We just enable the clock in .init() and disable it in .shutdown().

Add clk_rate parameter in platform data and configure the
clock rate during probe if supplied.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:14:40 +02:00
Roger Quadros
e4d7dc6674 usb: phy: nop: use devm_kzalloc()
Use resource managed kzalloc.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:14:32 +02:00