aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/chipidea
AgeCommit message (Collapse)AuthorFilesLines
2012-08-31usb: gadget: get rid of USB_GADGET_{DUAL,SUPER}SPEEDMichal Nazarewicz1-1/+0
This commit removes USB_GADGET_DUALSPEED and USB_GADGET_SUPERSPEED Kconfig options. Since now kernel allows many UDC drivers to be compiled, those options may turn to no longer be valid. For instance, if someone decides to build UDC that supports super speed and UDC that supports high speed only, the latter will be "assumed" to support super speed since USB_GADGET_SUPERSPEED will be selected by the former. The test of whether CONFIG_USB_GADGET_*SPEED was defined was just an optimisation which removed otherwise dead code (ie. if UDC is not dual speed, there is no need to handle cases that can happen if speed is high). This commit removes those checks. Signed-off-by: Michal Nazarewicz <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2012-08-10usb: chipidea: fix and improve dependencies if usb host or gadget support is ↵Marc Kleine-Budde1-4/+5
built as module Since commit "5e0aa49 usb: chipidea: use generic map/unmap routines", the udc part of the chipidea driver needs the generic usb gadget helper functions. If the chipidea driver with udc support is built into the kernel and usb gadget is built a module, the linking of the kernel fails with: drivers/built-in.o: In function `_hardware_dequeue': drivers/usb/chipidea/udc.c:527: undefined reference to `usb_gadget_unmap_request' drivers/usb/chipidea/udc.c:1269: undefined reference to `usb_gadget_unmap_request' drivers/usb/chipidea/udc.c:1821: undefined reference to `usb_del_gadget_udc' drivers/usb/chipidea/udc.c:443: undefined reference to `usb_gadget_map_request' drivers/usb/chipidea/udc.c:1774: undefined reference to `usb_add_gadget_udc' This patch changes the dependencies, so that udc support can only be activated if the linux gadget support (USB_GADGET) is builtin or both chipidea driver and USB_GADGET are modular. Same dependencies for the chipidea host support and the linux host side USB support (USB). While there, fix the indention of chipidea the help text. Cc: Alexander Shishkin <[email protected]> Reviewed-by: Felipe Balbi <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-07-09usb: chipidea: add imx platform driverRichard Zhao2-0/+201
This patch supports only the host-mode functionality so far. Signed-off-by: Richard Zhao <[email protected]> Signed-off-by: Marek Vasut <[email protected]> Cc: Peter Chen <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Felipe Balbi <[email protected]> Tested-by: Subodh Nijsure <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-07-09usb: chipidea: permit driver bindings pass phy pointerRichard Zhao4-4/+14
Sometimes, the driver bindings may know what phy they use. For example, when using device tree, the usb controller may have a phandler pointing to usb phy. Signed-off-by: Richard Zhao <[email protected]> Reviewed-by: Marek Vasut <[email protected]> Acked-by: Felipe Balbi <[email protected]> Tested-by: Subodh Nijsure <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-07-09usb: chipidea: select USB_EHCI_ROOT_HUB_TT in USB_CHIPIDEA_HOST of KconfigRichard Zhao1-0/+1
ci13xxx host needs Root Hub Transaction Translators. Reported-by: Shawn Guo <[email protected]> Signed-off-by: Richard Zhao <[email protected]> Acked-by: Felipe Balbi <[email protected]> Signed-off-by: Alexander Shishkin <[email protected]> Acked-by: Marek Vasut <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-07-09USB: Chipidea: add ci13xxx device id managementRichard Zhao1-5/+16
We use ida_simple_get and ida_simple_remove to manage the ids. Signed-off-by: Richard Zhao <[email protected]> Reviewed-by: Felipe Balbi <[email protected]> Signed-off-by: Alexander Shishkin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-07-09USB: Chipidea: add unified ci13xxx_{add,remove}_device for platform driversRichard Zhao3-55/+56
Platform drivers do the similar things to add/remove ci13xxx device, so create a unified one. Signed-off-by: Richard Zhao <[email protected]> Reviewed-by: Felipe Balbi <[email protected]> Signed-off-by: Alexander Shishkin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-07-09USB: Chipidea: rename struct ci13xxx variables from udc to ciRichard Zhao4-406/+406
struct ci13xxx represent the controller, which may be device or host, so name its variables as ci. Signed-off-by: Richard Zhao <[email protected]> Reviewed-by: Felipe Balbi <[email protected]> Signed-off-by: Alexander Shishkin <[email protected]> Reviewed-by: Marek Vasut <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-07-06USB: Chipidea: rename struct ci13xxx_udc_driver to struct ci13xxx_platform_dataRichard Zhao6-34/+34
This patch rename struct ci13xxx_udc_driver and var with the type. ci13xxx_platform_data reflect it's passed from platfrom driver. Signed-off-by: Richard Zhao <[email protected]> Reviewed-by: Felipe Balbi <[email protected]> Signed-off-by: Alexander Shishkin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-07-06usb: chipidea: msm: add remove methodFelipe Balbi1-6/+15
allow this driver to be removed too. Signed-off-by: Felipe Balbi <[email protected]> Signed-off-by: Alexander Shishkin <[email protected]> Signed-off-by: Richard Zhao <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-07-06usb: chipidea: msm: add missing section annotationFelipe Balbi1-1/+1
No functional changes, it will just free up some code if we don't have hotplug. Signed-off-by: Felipe Balbi <[email protected]> Signed-off-by: Alexander Shishkin <[email protected]> Signed-off-by: Richard Zhao <[email protected]> Acked-by: Marek Vasut <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-07-06usb: chipidea: drop useless arch-checkFelipe Balbi1-3/+5
msm glue layer compiles on all arches just fine. Let's drop the unnecessary ARCH check so we have easier compile tests. Signed-off-by: Felipe Balbi <[email protected]> Signed-off-by: Alexander Shishkin <[email protected]> Signed-off-by: Richard Zhao <[email protected]> Acked-by: Marek Vasut <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-07-06usb: chipidea: remove unneeded NULL checkAlexander Shishkin1-3/+0
As reported by Dan Carpenter, there is a NULL check in udc_start() that follows a dereference of the pointer that's being checked. However, at that point udc pointer shouldn't ever be NULL and if it is, the dereference should cause an oops. Signed-off-by: Alexander Shishkin <[email protected]> Reported-by: Dan Carpenter <[email protected]> Acked-by: Felipe Balbi <[email protected]> Signed-off-by: Richard Zhao <[email protected]> Acked-by: Marek Vasut <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-07-02usb: phy: fix return value check of usb_get_phyKishon Vijay Abraham I1-4/+5
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 <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2012-06-25usb: otg: support for multiple transceivers by a single controllerKishon Vijay Abraham I1-1/+1
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 <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2012-06-25usb: otg: utils: rename function name in OTG utilsKishon Vijay Abraham I1-4/+4
_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 <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2012-05-15usb: chipidea: remove zero check of hw_ep_maxRichard Zhao1-1/+1
It's 0 for host only device. Signed-off-by: Richard Zhao <[email protected]> Cc: Marek Vasut <[email protected]> Cc: Alan Stern <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Felipe Balbi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-05-15USB: CI13xxx: Use usb_put_hcd() on failure to drop HCDMarek Vasut1-1/+1
Use usb_put_hcd() call instead of usb_remove_hcd() as that's the appropriate call to drop hcd which failed registration. Signed-off-by: Marek Vasut <[email protected]> Cc: Alan Stern <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Felipe Balbi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-05-11usb: chipidea: drop unused field "device" from ci13xxx_epAlexander Shishkin2-3/+0
It was used as a shorthand for gadget's device in request mapping/unmapping code, but now it's not used any more. Signed-off-by: Alexander Shishkin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-05-11usb: chipidea: use generic map/unmap routinesAlexander Shishkin3-35/+10
We're one of the remaining drivers to map/unmap requests by hand. Switch to using generic gadget routines for that instead. Signed-off-by: Alexander Shishkin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-05-11usb: chipidea: add power_budget limit for ehci to platform dataAlexander Shishkin2-1/+9
Some implementations need this limitation to work correctly. Signed-off-by: Alexander Shishkin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-05-11usb: chipidea: add host roleAlexander Shishkin8-9/+204
This adds EHCI host support to the chipidea driver. We want it to be part of the hdrc driver and not a standalone (sub-)driver module, as the structure of ehci-hcd.c suggests, so for chipidea controller we hack it to not provide platform-related code, but only the ehci hcd. The ehci-platform driver won't work for us here too, because the controller uses the same registers for both device and host mode and also otg-related bits, so it's not really possible to put ehci registers into a separate resource. This is not a pretty solution, but the alternative is exporting symbols from the chipidea driver to a ehci-chipidea driver and doing all the module refcounting. Signed-off-by: Alexander Shishkin <[email protected]> Cc: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-05-11usb: chipidea: use common definition for USBMODE bitsAlexander Shishkin3-8/+8
Some of the bits of USBMODE register are defined in <usb/ehci_def.h>, use them instead of having our own definitions. Signed-off-by: Alexander Shishkin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-05-11usb: chipidea: drop unused msm register definitionsAlexander Shishkin1-3/+0
These definitions are unused, and the same registers are also defined in <linux/usb/msm_hsusb_hw.h>. Signed-off-by: Alexander Shishkin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-05-11usb: chipidea: drop redundant NULL checkAlexander Shishkin1-3/+0
Currently, gadget can't be NULL in _gadget_stop_activity(). Signed-off-by: Alexander Shishkin <[email protected]> Reported-by: Michael Grzeschik <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-05-11usb: chipidea: isr_reset_handler fix missing lockingMichael Grzeschik1-1/+1
Move spin_lock under the done label, so the lock will also be pulled in the error paths. Signed-off-by: Michael Grzeschik <[email protected]> [rebased on top of the patchset] Signed-off-by: Alexander Shishkin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-05-11usb: chipidea: brush up structure definitionsAlexander Shishkin2-61/+120
Get rid of trailing comments in the structure definitions in favor of kernel-doc. Signed-off-by: Alexander Shishkin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-05-11usb: chipidea: remove unused field "regs" from ci13xxxAlexander Shishkin2-2/+1
The old implementation used global hw_bank, the new implementation uses udc-local hw_bank. This field seems to be a leftover from previous coding experiments. Signed-off-by: Alexander Shishkin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-05-11usb: chipidea: add support for rolesAlexander Shishkin7-115/+325
Add some generic code for roles and implement simple role switching based on ID pin state and/or a sysfs file. At this, we also rename the device to ci_hdrc, which is what it is. The "manual" switch is made into a sysfs file and not debugfs, because it might be useful even in non-debug context. For some boards, like sheevaplug, it seems to be the only way to switch roles without modifying the hardware, since the ID pin is always grounded. Signed-off-by: Alexander Shishkin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-05-11usb: chipidea: split the driver code into unitsAlexander Shishkin12-1418/+1597
Split the driver into the following parts: * core -- resources, register access, capabilities, etc; * udc -- device controller functionality; * debug -- logging events. Signed-off-by: Alexander Shishkin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-05-11usb: move ci13xxx and related code to drivers/usb/chipideaAlexander Shishkin6-0/+3536
Since chipidea is a dual role controller, it makes sense to move it to its own directory, where we can also have host, otg and platform code related to this controller. It also makes sense to break out the driver into several compilation units like udc, host, debugging code, etc. Firstly, let's move the udc and platform code to drivers/usb/chipidea. Signed-off-by: Alexander Shishkin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>