summaryrefslogtreecommitdiffstats
path: root/drivers/usb/chipidea/ci.h
Commit message (Collapse)AuthorAgeFilesLines
* usb: chipidea: add wait vbus lower than OTGSC_BSV before role startsPeter Chen2013-08-141-0/+3
| | | | | | | | | | | | | | | When the gadget role starts, we need to make sure the vbus is lower than OTGSC_BSV, or there will be an vbus interrupt since we use B_SESSION_VALID as vbus interrupt to indicate connect and disconnect. When the host role starts, it may not be useful to wait vbus to lower than OTGSC_BSV, but it can indicate some hardware problems like the vbus is still higher than OTGSC_BSV after we disconnect to host some time later (5000 milliseconds currently), which is obvious not correct. Tested-by: Marek Vasut <marex@denx.de> Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: chipidea: add vbus interrupt handlerPeter Chen2013-08-141-0/+5
| | | | | | | | | | | | We add vbus interrupt handler at ci_otg_work, it uses OTGSC_BSV(at otgsc) to know it is connect or disconnet event. Meanwhile, we introduce two flags id_event and b_sess_valid_event to indicate it is an id interrupt or a vbus interrupt. Tested-by: Marek Vasut <marex@denx.de> Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: chipidea: drop "13xxx" infixAlexander Shishkin2013-06-241-25/+25
| | | | | | | | | | | | | | "ci13xxx" is bad for at least the following reasons: * people often mistype it * it doesn't add any informational value to the names it's used in * it needlessly attracts mail filters This patch replaces it with "ci_hdrc", "ci_udc" or "ci_hw", depending on the situation. Modules with ci13xxx prefix are also renamed accordingly and aliases are added for compatibility. Otherwise, no functional changes. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: chipidea: udc: add multiple td support to hardware_{en,de}queueMichael Grzeschik2013-06-171-0/+1
| | | | | | | | | | | | | | | This patch removes the restriction of having a limited amount of only four active tds on one endpoint. We use the linked list implementation to manage all tds which get added and removed by hardware_{en,de}queue. The removal of this restriction adds the driver to run into a hardware errata. It's possible that the hardware will still address an transfer descriptor that already got cleaned up. To solve this the patch also postpone the cleanup of processed tds by one. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: chipidea: udc: add the define TD_PAGE_COUNT and fix all usersMichael Grzeschik2013-03-301-0/+1
| | | | | | | | | | | | A static count of transfer descriptors was used everywhere in the driver with the fixed number 5. This patch adds a define, named TD_PAGE_COUNT, and replaces all users of this value. This way its possible to have only one parameter to change and limit the amount of buffer pointers per TD. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Reviewed-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: chipidea: don't redefine __ffs()Felipe Balbi2013-03-301-14/+1
| | | | | | | | | | | chipidea's ffs_nr() is pretty much what __ffs() does. Use that one instead. Signed-off-by: Felipe Balbi <balbi@ti.com> [rebased on top of debug infrastructure rework] Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: chipidea: convert debug entries in sysfs to debugfsAlexander Shishkin2013-03-301-0/+2
| | | | | | | | | | | Currently, we have a bunch of files in sysfs that display all sorts of debugging information for the device controller, so they have to move to debugfs where they belong. The "registers" interface have been removed, since it doesn't fit into the current driver design as is and it's hardly a good idea to touch the registers from userspace anyway. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Revert "USB: chipidea: add vbus detect for udc"Peter Chen2013-03-291-1/+0
| | | | | | | | | | | | | | There are several problems with this patch: + in introduces a sparse warning for a condition that's always negative, + and because of that, it actually doesn't do anything useful, + and vbus detection belongs to otg, not device function anyway. This reverts commit 8c4fc031954b4eb72daf13d3c907a985a3eee208. Signed-off-by: Peter Chen <peter.chen@freescale.com> [Alex: amended the above text] Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: chipidea: add vbus detect for udcRichard Zhao2012-09-121-0/+1
| | | | | | | | | | Using vbus valid interrupt to detect vbus. Tested-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Tested-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Richard Zhao <richard.zhao@freescale.com> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: chipidea: permit driver bindings pass phy pointerRichard Zhao2012-07-091-0/+2
| | | | | | | | | | | | 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 <richard.zhao@freescale.com> Reviewed-by: Marek Vasut <marex@denx.de> Acked-by: Felipe Balbi <balbi@ti.com> Tested-by: Subodh Nijsure <snijsure@grid-net.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: Chipidea: rename struct ci13xxx variables from udc to ciRichard Zhao2012-07-091-13/+13
| | | | | | | | | | | struct ci13xxx represent the controller, which may be device or host, so name its variables as ci. Signed-off-by: Richard Zhao <richard.zhao@freescale.com> Reviewed-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: Chipidea: rename struct ci13xxx_udc_driver to struct ci13xxx_platform_dataRichard Zhao2012-07-061-2/+2
| | | | | | | | | | | 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 <richard.zhao@freescale.com> Reviewed-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: chipidea: drop unused field "device" from ci13xxx_epAlexander Shishkin2012-05-111-2/+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 <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: chipidea: use generic map/unmap routinesAlexander Shishkin2012-05-111-1/+0
| | | | | | | | 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 <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: chipidea: add host roleAlexander Shishkin2012-05-111-1/+6
| | | | | | | | | | | | | | | | | | | | 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 <alexander.shishkin@linux.intel.com> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: chipidea: brush up structure definitionsAlexander Shishkin2012-05-111-53/+103
| | | | | | | | Get rid of trailing comments in the structure definitions in favor of kernel-doc. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: chipidea: remove unused field "regs" from ci13xxxAlexander Shishkin2012-05-111-1/+0
| | | | | | | | | 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 <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: chipidea: add support for rolesAlexander Shishkin2012-05-111-3/+61
| | | | | | | | | | | | | | 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 <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: chipidea: split the driver code into unitsAlexander Shishkin2012-05-111-0/+204
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 <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
OpenPOWER on IntegriCloud