summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3/dwc3-omap.c
AgeCommit message (Collapse)Author
2013-07-29usb: dwc3: omap: switch over to devm_ioremap_resource()Felipe Balbi
use the new devm_ioremap_resource on dwc3-omap.c Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-07-29usb: dwc3: switch to GPL v2 onlyFelipe Balbi
This is a Linux-only driver which makes use of GPL-only symbols. It makes no sense to maintain Dual BSD/GPL licensing for this driver. Considering that the amount of work to use this driver in any different operating system would likely be as large as developing the driver from scratch and considering that we depend on GPL-only symbols, we will switch over to a GPL v2-only license. Cc: Anton Tikhomirov <av.tikhomirov@samsung.com> Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-12usb: dwc3: omap: Adds dwc3_omap_readl/writel wrappersGeorge Cherian
This patch adds wrappers to dwc3_omap_readl/writel calls to accomodate both OMAP5 and AM437x reg maps (It uses the cached register offsets). Also renames OMAP5 IRQ1 as IRQMISC and IRQ1 bits as IRQMISC bits. Signed-off-by: George Cherian <george.cherian@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-12usb: dwc3: omap: initialize the register offset values for omap5 and AM437xGeorge Cherian
This patch Initializes the register offset values depending on the X_MAJOR of USBOTGSS_REVISION register. Also adds register offset defines and new debug register defines. X_MAJOR is 2 for both OMAP5 and AM437x. But both have different glue register layout. Differentiate AM437x using dt compatible. Register offsets are cached in dwc3_omap struct for reg reads and writes. Signed-off-by: George Cherian <george.cherian@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-12usb: dwc3: omap: Adding am437x specific register map changesGeorge Cherian
AM437x and OMAP5 dwc3 subsytem have different register map. Major differences are as follows. OMAP5 has one main interrupt and one misc interrupt Aegis has four main interrupts and one misc interrupt. Miscellanous Interrupt offsets are changed. UTMI OTG Control and Status Registers offsets are changed. DEBUG Configuration and Status Registers are changed. The main intend of the patch is to re-use the same wrapper driver for both OMAP5 and AM437x, by using the x_major in revision register and adjusting the offsets. This patch adds the register map offsets and adds offset variables in struct dwc3_omap to cache the offsets Signed-off-by: George Cherian <george.cherian@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-06-12usb: dwc3: omap: improve error handling of dwc3_omap_probeKishon Vijay Abraham I
Improved the error handling of dwc3_omap_probe so that on error conditions dwc3_omap is left in the original state. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-04-02usb: dwc3: add CONFIG_PM_SLEEP to suspend/resume functionsJingoo Han
Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following build warning when CONFIG_PM_SLEEP is not selected. This is because sleep PM callbacks defined by SET_SYSTEM_SLEEP_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled. Unnecessary CONFIG_PM ifdefs are removed. drivers/usb/dwc3/core.c:682:12: warning: 'dwc3_suspend' defined but not used [-Wunused-function] drivers/usb/dwc3/core.c:709:12: warning: 'dwc3_resume' defined but not used [-Wunused-function] drivers/usb/dwc3/dwc3-omap.c:430:12: warning: 'dwc3_omap_suspend' defined but not used [-Wunused-function] drivers/usb/dwc3/dwc3-omap.c:440:12: warning: 'dwc3_omap_resume' defined but not used [-Wunused-function] drivers/usb/dwc3/dwc3-exynos.c:185:12: warning: 'dwc3_exynos_suspend' defined but not used [-Wunused-function] drivers/usb/dwc3/dwc3-exynos.c:194:12: warning: 'dwc3_exynos_resume' defined but not used [-Wunused-function] Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: omap: fix sparse warningFelipe Balbi
our global '_omap' pointer wasn't marked static. This patch solves the following sparse warning: warning: symbol '_omap' was not declared. \ Should it be static? Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: dwc3-omap: return -EPROBE_DEFER if probe has not yet executedKishon Vijay Abraham I
return -EPROBE_DEFER from dwc3_omap_mailbox in dwc3-omap.c, if the probe of dwc3-omap has not yet been executed or failed. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: set dma_mask for dwc3_omap deviceKishon Vijay Abraham I
*dma_mask* is not set for devices created from dt data. So filled dma_mask for dwc3_omap device here. And dwc3 core will copy the dma_mask from its parent. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: omap: add basic suspend/resume supportFelipe Balbi
this patch implements basic suspend/resume functionality for the OMAP glue layer. Tested-by: Vivek Gautam <gautam.vivek@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: omap: remove unused fields from private structureFelipe Balbi
we're not using those fields of the structure, might as well remove them. Tested-by: Vivek Gautam <gautam.vivek@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: omap: introduce enable/disable IRQ methodsFelipe Balbi
they will be re-used on suspend/resume implementation. Tested-by: Vivek Gautam <gautam.vivek@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: omap: stop using nop-usb-xceivKishon Vijay Abraham I
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-18usb: dwc3: omap: remove platform data associated with dwc3-omapKishon Vijay Abraham I
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-18usb: dwc3: omap: minor fixes to get dt workingKishon Vijay Abraham I
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-04usb: dwc3: glue layers shouldn't know about the core IPFelipe Balbi
remove inclusion of "core.h" from all glue layers as they don't need to know details about the core IP. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-04usb: dwc3: omap: fix a typo on of_device_idFelipe Balbi
s/matach/match No functional changes Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-01-25usb: dwc3: exynos/omap: Change platform device IDs for no_op_xceive to AUTOVivek Gautam
Multiple dwc3 probe calls try to allocate no_op_xceive platform device. Having static IDs for these will throw sysfs error -EEXIST. Changing these static platform device IDs to AUTO to enable multiple dwc3 controller support on a SoC. Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-01-25usb: dwc3: omap: Add an API to write to dwc mailboxKishon Vijay Abraham I
Add an API in the omap glue layer to write to the mailbox register which can be used by comparator driver(twl). To pass the detection of the attached device (signified by VBUS, ID) to the dwc3 core, dwc3 core has to write to the mailbox regiter. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-01-25usb: dwc3: omap: Remove explicit writes to SYSCONFIG registerKishon Vijay Abraham I
The runtime API's takes care of setting the SYSCONFIG register with appropriate values. Hence explicit writes to SYSCONFIG register is removed. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-01-25usb: dwc3: omap: use runtime API's to enable clocksKishon Vijay Abraham I
Before accessing any register, runtime API's should be invoked to enable the clocks. runtime API's are added here to prevent abort during register access. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-01-25usb: dwc3: omap: use of_platform API to create dwc3 core pdevKishon Vijay Abraham I
Used of_platform_populate() to create dwc3 core platform_device from device tree data. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-01-25usb: dwc3: omap: use device_for_each_child to handle child removalKishon Vijay Abraham I
Used device_for_each_child() to handle child device (dwc3 core) removal during devexit of dwc3 omap. This is in preparation for creating the child devices from subnode of dwc3 omap glue using of_platform_populate. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-21usb: remove use of __devexitBill Pemberton
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>
2012-11-21usb: remove use of __devinitBill Pemberton
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>
2012-11-21usb: remove use of __devexit_pBill Pemberton
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>
2012-10-31usb: dwc3: remove custom unique id handlingSebastian Andrzej Siewior
The lockless implementation of the unique id is quite impressive (:P) but dirver's core can handle it, we can remove it and make our code a little smaller. Cc: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-09-10usb: dwc3: omap: add nop transceiver supportFelipe Balbi
We will be adding support for transceivers on dwc3 driver but not all boards have controllable transceivers. For those which don't provide controllable transceivers we will register nop transceivers. Note that once OMAP's transceiver drivers reach mainline, this glue layer will change accordingly. Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-04-24usb: dwc3: omap: add dwc3_omap_readl/writel functionsIdo Shayevitz
We separate between dwc3-omap helper functions to dwc3-core helper functions. This will allow us to change the helper functions implementation according to each module need. Signed-off-by: Ido Shayevitz <idos@codeaurora.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-03-02usb: dwc3: linux/module.h included twiceDanny Kukawka
drivers/usb/dwc3/core.c and drivers/usb/dwc3/dwc3-omap.c included 'linux/module.h' twice, remove the duplicates. Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-03-02usb: dwc3: use devm_xxx functionsChanho Park
This patch enables to use devm_xxx functions during probing driver. The devm_xxx series functions are able to release resource when the driver is detatched. We can remove several codes to release resources in the probe function. Signed-off-by: Chanho Park <chanho61.park@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-02-06usb: dwc3: omap: convert pdata to of propertyFelipe Balbi
Convert our platform_data usage to OF property, keep the legacy pdata for a while until the complete conversion is done. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-12-12Merge branch 'for-next/dwc3' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next * 'for-next/dwc3' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb: (392 commits) usb: dwc3: ep0: fix for possible early delayed_status usb: dwc3: gadget: fix stream enable bit usb: dwc3: ep0: fix GetStatus handling (again) usb: dwc3: ep0: use dwc3_request for ep0 requsts instead of usb_request usb: dwc3: use correct hwparam register for power mgm check usb: dwc3: omap: move to module_platform_driver usb: dwc3: workaround: missing disconnect event usb: dwc3: workaround: missing USB3 Reset event usb: dwc3: workaround: U1/U2 -> U0 transiton usb: dwc3: gadget: return early in dwc3_cleanup_done_reqs() usb: dwc3: ep0: handle delayed_status again usb: dwc3: ep0: push ep0state into xfernotready processing usb: dwc3: fix sparse errors usb: dwc3: fix few coding style problems usb: dwc3: move generic dwc3 code from gadget into core usb: dwc3: use a helper function for operation mode setting usb: dwc3: ep0: don't use ep0in for transfers usb: dwc3: ep0: use proper endianess in SetFeature for wIndex usb: dwc3: core: drop DWC3_EVENT_BUFFERS_MAX usb: dwc3: omap: add multiple instances support to OMAP ...
2011-12-12usb: dwc3: omap: move to module_platform_driverFelipe Balbi
the new module_platform_driver macro is a helper for modules which just register and unregister the platform_driver. It allows us to delete a few duplicated lines. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-12-12usb: dwc3: omap: add multiple instances support to OMAPFelipe Balbi
if we ever have an omap with multiple instances of the DWC3 IP, we need unique names for them. In order to achieve that, let's use the dwc3_get/put_device_id() calls to give us an unique device identifier. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-12-12usb: dwc3: add a platform device aliasSebastian Andrzej Siewior
We can have three modules here: dwc3.ko, dwc3-omap.ko and dwc3-pci.ko. The later have already ids-aliases for probing and is fine. The omap module has alias for DT but lacks alias for the "native" platform_device. Maybe we should get rid of it and stick to the DT name? Both glue modules create a new device for which the dwc3.ko module is responsible and that one lacks the platform alias. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-12-12usb: dwc3: fetch mode of operation from HWFelipe Balbi
There's no need to add driver_data for something we can fetch from HW. This also makes our id_table unnecessary - at least for now -, so we also remove it on the same patch. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-11-28usb: convert drivers/usb/* to use module_platform_driver()Axel Lin
This patch converts the drivers in drivers/usb/* to use the module_platform_driver() macro which makes the code smaller and a bit simpler. Cc: Felipe Balbi <balbi@ti.com> Cc: Li Yang <leoli@freescale.com> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: Jiri Kosina <jkosina@suse.cz> Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-04usb: Add module.h to various dwc3 driversPaul Gortmaker
These files uses the full set of MODULE_ macros and so need to include module.h directly. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-04usb: dwc: remove "All rights reserved" statement.Sebastian Andrzej Siewior
Some people think that this line is not compatible with the GPL. The statement was required due to the Buenos Aires Convention and is now deprecated. I remove it because it is said that it is pointless nowdays. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-09usb: dwc3: omap: set idle and standby modesFelipe Balbi
For now, let's disable IDLE and STANDBY transitions until we have a real HW to validate against. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: omap: fix IRQ handlingFelipe Balbi
In order to ACK the IRQ we must write back to the same register the bits we read. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: omap: change IRQ name to dwc3-omapFelipe Balbi
dwc3-wrapper can be used by any other wrapper, using dwc3-omap makes it clear that we're running on OMAP SoC. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: add module.h to dwc3-omap.c and core.cFelipe Balbi
We need that header because of THIS_MODULE. Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: omap: distinguish between SW and HW modesFelipe Balbi
The OMAP wrapper allows us to either control internal OTG signals via SW or HW. Different boards might wish to use one or the other mode of operation. Let's have have that information passed via platform_data for now. After DT conversion is finished for OMAP, we can easily convert this to a DT attribute. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: omap: drop DEV_PM_OPS for nowFelipe Balbi
We need to have actual HW in order to implement and test that part of the code anyway. Until then it's best to remove it. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: omap: use the macro we already haveFelipe Balbi
trivial patch, no functional changes. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: omap: do not enable DMA Disable Clear IRQFelipe Balbi
Otherwise that IRQ will trigger forever. It's quite unnecessary. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: omap: fix dev_dbg() callsFelipe Balbi
dev_dbg() macro expects a device pointer as argument, not a memory base address. Signed-off-by: Felipe Balbi <balbi@ti.com>