summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/ci13xxx_udc.h
AgeCommit message (Collapse)Author
2012-05-11usb: move ci13xxx and related code to drivers/usb/chipideaAlexander Shishkin
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 <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-11usb: gadget: ci13xxx: don't use "advance" feature when setting addressAlexander Shishkin
Newer versions of the chipidea controller support the "advance" setting of usb address, which means instead of setting it immediately, deferring it till the status completion. Unfortunately, older versions of the controller don't have this feature, so in order to support those too, we simply don't use it. It's about 4 lines of extra code, and isn't in any way critical to performance. While at it, change the return value of the hw_usb_set_address() to void, since it can't fail in any measurable way. With this patch, ci13xxx_udc driver works with the chipidea controller in kirkwood (feroceon SoC), as found in, for example, sheevaplug. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-11usb: gadget: ci13xxx: fix the context of register mapAlexander Shishkin
The regmap field is an array of register pointers, not the other way around. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-11usb: gadget: ci13xxx: get rid of local tracing for goodAlexander Shishkin
There is no point in having tracing output in the kernel these days. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-09usb: gadget: ci13xxx: replace home-brewed logging with dev_{err,warn,info}Alexander Shishkin
Logging output in the driver is mostly done using custom err/warn/info macros which rely on the existence of the global variable _udc, which is a global reference to the udc controller structure. This reference will have to go in order to allow us to have more than one chipidea udc in the system. Thus, replace custom macros with dev_{err,warn,info} using the platform device where possible. The trace() macro, which is a nop by default is left for tracing purposes. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-09usb: gadget: ci13xxx: convert to platform deviceAlexander Shishkin
Let's break ci13xxx driver into a separate udc driver and platform drivers _pci and _msm, which will create a platform device for each pci (or msm) device found. The approach was introduced by Felipe in dwc3 driver and there seems to be no reason not to use it. msm related code is only compile-tested. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-09usb: gadget: ci13xxx: redo register accessAlexander Shishkin
Use lookup table instead of conditional macrodefinitions of register addresses. With two different possible register layouts and different register offsets, it's easiest to build a table with register addresses at probe time, based on the information supplied from the platform and device capabilities. This way we get rid of branch-per-register-access. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-09usb: gadget: ci13xxx: move global variables inside struct ci13xxxAlexander Shishkin
Make global variables that are specific for each UDC instance part of struct ci13xxx. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-09usb: gadget: ci13xxx: drop needless parensAlexander Shishkin
Small and self-evident cleanup. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-08usb: gadget: ci13xxx: rename register layoutsAlexander Shishkin
Currently, the register prefixes in the driver seem to be mixed: the capability registers are the ones that contain capability information, such as number of hardware endpoints, while the registers that are used to program the controller are called operational registers. Normally, capability registers start at 0x100 offset of the register window and are followed by operational registers. In some versions, however, capability registers start at 0x0 offset. This patch renames the register and adjusts their offsets appropriately, leaving the possibility of having a non-standard capability offset. I couldn't find any mentions of the TESTMODE register anywhere, so I suspect it might only be enabled in chipidea internal versions of the controller and I'm really inclined to remove it from the driver or at least hiding it behind a config option. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-08usb: gadget: ci13xxx: initialize ep0{out,in} dynamicallyAlexander Shishkin
Change ep0{out,in} macros into dynamically assigned pointers in gadget initialization time. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-07Merge tag 'gadget-for-v3.5' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next usb: gadget: patches for v3.5 This pull request is quite big, but mainly because there's a giant rework of the s3c_hsotg.c driver to make it friendlier for other users. Samsung Exynos platforms use the DesignWare Core USB2 IP from Synopsys so it's a bit unfair to have the driver work for Samsung platforms only. In short, the big rework is in preparation to make the driver more reusable. Another big rework in this pull request came from Ido, where he's removing the redundant pointer for the endpoint descriptor from the controller driver's own endpoint representation. The same pointer is available through the generic struct usb_ep structure. Also on this pull request is the conversion of a few extra controller drivers to the new style registration, which allows multiple controllers to be available on the same platform and helps remove global pointers from those drivers. Together with those big changes, there's the usual fixes and cleanups to gadget drivers. Nothing major.
2012-05-04USB: gadget: ci13xx_udc: remove unused err() macroGreg Kroah-Hartman
I previously cleaned up the err() call usage in this driver, but it really was calling this macro instead. To remove future confusion, just delete this unused macro now. Ideally, the warn() and info() macros should also be removed, and the "real" dev_warn() and dev_info() calls should be used instead. Reported-by: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-04usb: gadget: Update ci13xxx_udc to use usb_endpoint_descriptor inside the ↵Ido Shayevitz
struct usb_ep Remove redundant pointer to struct usb_endpoint_descriptor. Signed-off-by: Ido Shayevitz <idos@codeaurora.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-02-13usb: otg: Rename otg_transceiver to usb_phyHeikki Krogerus
This is the first step in separating USB transceivers from USB OTG utilities. Includes fixes to IMX code from Sascha Hauer. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Acked-by: Li Yang <leoli@freescale.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Igor Grinberg <grinberg@compulab.co.il> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-12-12USB: ci13xxx_udc: handle controllers with less than 16 EPsMarc Kleine-Budde
The ci13xxx_udc driver checks the number of endpoints in the udc controller, however some routines expect that the hardware has 16 bidirectional endpoints. This patch improves the driver to work on controllers with less than 16 endpoints like the udc controller found on freescale's mx23 and mx28. Tested-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-02-25USB: gadget: Add test mode support for ci13xxx_udcPavankumar Kondeti
Implement the test modes mentioned in 7.1.20 section of USB 2.0 specification. High-speed capable devices must support these test modes to facilitate compliance testing. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-25USB: gadget: Implement remote wakeup in ci13xxx_udcPavankumar Kondeti
This patch adds support for remote wakeup. The following things are handled: - Process SET_FEATURE/CLEAR_FEATURE control requests sent by host for enabling/disabling remote wakeup feature. - Report remote wakeup enable status in response to GET_STATUS control request. - Implement wakeup method defined in usb_gadget_ops for initiating remote wakeup. - Notify gadget driver about suspend and resume. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-25USB: gadget: Implement hardware queuing in ci13xxx_udcPavankumar Kondeti
Chipidea USB controller provides a means (Add dTD TripWire semaphore) for safely adding a new dTD to an active endpoint's linked list. Make use of this feature to improve performance. Dynamically allocate and free dTD for supporting zero length packet termination. Honor no_interrupt flag set by gadget drivers. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-23USB: gadget: Fix endpoint representation in ci13xxx_udcPavankumar Kondeti
Fix a bug where only half the number of endpoints supported by the hardware are exposed to gadget. If DEN filed in the DCCPARAMS register has 'N' then 'N' IN endpoints and 'N" OUT endpoints can be supported. But only 'N' bidirectional endpoints are added to the gadget ep_list. This patch also ensures that the data and handshake transactions of previous setup packet are flushed upon a new setup packet arrival on ep0. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-16USB: gadget: ci13xxx: don't assume that PAGE_SIZE is 4096Artem Leonenko
Page size for transaction descriptors for CI13XXX has nothing common with page size from MM. Using platform and configuration specific PAGE_SIZE is wrong. Signed-off-by: Artem Leonenko <tikkeri@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-10USB: gadget: Introduce ci13xxx_udc_driver structPavankumar Kondeti
Introduces ci13xxx_udc_driver struct for bus glue drivers to hint ci13xxx_udc core about their special requirements. The flags include avoiding hardware register access when controller is not in peripheral mode, enabling pull-up upon VBUS, disabling streaming mode and dependency on transceiver driver. Initialize gadget_ops in udc_probe so that transceiver can notify VBUS presence even when no gadget driver is bounded. A notify_event callback is embedded in the same struct. This patch implements two events called CONTROLLER_RESET_EVENT and CONTROLLER_STOPPED_EVENT to notify the bus glue driver after resetting and stopping the controller for performing SoC specific quirks. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07USB: gadget: MIPS ci13xxx_udcDavid Lopo
MIPS USB IP core family device controller Currently it only supports IP part number CI13412. [dbrownell@users.sourceforge.net: minor comment tweaks] Signed-off-by: David Lopo <dlopo@chipidea.mips.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>