summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3
AgeCommit message (Collapse)Author
2013-03-18usb: dwc3: workaround: unexpected transtion U3 -> RESUMEFelipe Balbi
In DWC3 versions < 2.50a configured without Hibernation mode enabled, there will be an extra link status change interrupt if device detects host-initiated U3 exit. In that case, core will generate an unnecessary U3 -> RESUME transition which should be ignored by the driver. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: core: define more revisionsFelipe Balbi
Some new revisions of the DWC3 core have been released, let's add our defines to help implementing known erratas. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: gadget: don't assign gadget.dev.release directlyFelipe Balbi
udc-core provides a better way to handle release methods, let's use it. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: gadget: don't touch gadget.dev.driverFelipe Balbi
udc-core now handles that for us, which means we can remove it from our driver. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: gadget: remove unnecessary initializationsFelipe Balbi
udc-core now sets dma-related and parent fields for us, we don't need to do it ourselves. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: core: avoid checkpatch.pl warningFelipe Balbi
trivial patch to avoid "over 80-chars" rule break. No functional changes. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: debugfs: improve debugfs file creationFelipe Balbi
when commit 388e5c5 (usb: dwc3: remove dwc3 dependency on host AND gadget.) changed the way debugfs files are created, it failed to note that 'mode' is necessary in Dual Role mode only while 'testmode' and 'link_state' are valid in Dual Role and Peripheral-only builds. Fix this while also converting pre- processor conditional to C conditionals. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: debugfs: mark our regset structure constFelipe Balbi
nobody should be modifying that structure and debugfs has already being fixed to take const arguments, so we won't cause any new compile warnings. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: debugfs: when unknown, print only the state valueFelipe Balbi
whenever we grab an unknown link_state we were printing the entire register value as a integer but that's hardly useful; instead, let's print only the bogus state value. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: debugfs: add two missing Link StatesFelipe Balbi
for Reset and Resume we were going to print "UNKNOWN" when we actually knew what those were. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: remove our homebrew state mechanismFelipe Balbi
We can reuse the generic implementation via our struct usb_gadget. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: gadget: implement gadget state trackingFelipe Balbi
make use of the previously introduced gadget->state field. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: gadget: move to threaded IRQFelipe Balbi
by moving to threaded IRQs, we allow our IRQ priorities to be configurable when running with realtime patch. Also, since we're running in thread context, we can call functions which might sleep, such as sysfs_notify() without problems. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: add count field to event bufferFelipe Balbi
we can cache the last read value of the event buffer count register on this field, for later handling. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: add a flags field to event bufferFelipe Balbi
that way we know if a particular event buffer has pending events, or not. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: core: remove bogus comment to our structureFelipe Balbi
that irq field has been removed already. This patch just removes its documentation. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: pci: add basic suspend/resume supportFelipe Balbi
this patch adds basic PM support for the PCI glue layer. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: exynos: add basic suspend/resume supportVikas Sajjan
Adds suspend and resume callbacks to exynos dwc3 driver as part of power management support. This change does gating of dwc3 clock during suspend/resume cycles. Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com> Signed-off-by: Vikas C Sajjan <vikas.sajjan@linaro.org> CC: Doug Anderson <dianders@chromium.org> Tested-by: Vivek Gautam <gautam.vivek@samsung.com> [ balbi@ti.com : refreshed to current linus/master ] 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: core: add power management supportFelipe Balbi
Add support for basic power management on the dwc3 driver. While there is still lots to improve for full PM support, this minimal patch will already make sure that we survive suspend-to-ram and suspend-to-disk without major issues. Cc: Vikas C Sajjan <vikas.sajjan@linaro.org> Tested-by: Vivek Gautam <gautam.vivek@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: gadget: save state of pullupsFelipe Balbi
This will be used during resume to verify if we should reconnect our pullups or not. Tested-by: Vivek Gautam <gautam.vivek@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: dwc3: gadget: introduce and use enable/disable irq methodsFelipe Balbi
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-18usb: dwc3: core: explicitly setup and cleanup event buffersFelipe Balbi
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-18usb: gadget: drop now unnecessary flagFelipe Balbi
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-18usb: dwc3: gadget: let udc-core manage gadget->devFelipe Balbi
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-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-08usb: dwc3: ep0: fix sparc64 buildAndrew Morton
drivers/usb/dwc3/ep0.c: In function `__dwc3_ep0_do_control_data': drivers/usb/dwc3/ep0.c:905: error: `typeof' applied to a bit-field Looks like a gcc-3.4.5/sparc64 bug. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-04usb: dwc3: gadget: remove unnecessary codeFelipe Balbi
the params variables on dwc3_gadget_conndone_interrupt() is only memset() to zero but never used in that function, so we can safely drop the variable and memset() call. 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-03-04usb: dwc3: core: don't forget to free coherent memoryFelipe Balbi
commit 3921426 (usb: dwc3: core: move event buffer allocation out of dwc3_core_init()) introduced a memory leak of the coherent memory we use as event buffers on dwc3 driver. If the driver is compiled as a dynamically loadable module and use constantly loads and unloads the driver, we will continue to leak the coherent memory allocated during ->probe() because dwc3_free_event_buffers() is never called during ->remove(). Cc: <stable@vger.kernel.org> # v3.7 v3.8 Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-02-08drivers/usb: add missing GENERIC_HARDIRQS dependenciesHeiko Carstens
Add a couple of missing GENERIC_HARDIRQS dependencies to fix link errors like below on s390: ERROR: "devm_request_threaded_irq" [drivers/usb/gadget/mv_udc.ko] undefined! Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-25Merge 3.8-rc5 into usb-nextGreg Kroah-Hartman
This fixes up a conflict with drivers/usb/serial/io_ti.c that came up in linux-next. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-25Merge tag 'xceiv-for-v3.9' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next Felipe writes: usb: xceiv: patches for v3.9 merge window Two new PHY drivers coming here: one for Samsung, one for OMAP. Both architectures are adding USB3 support to mainline kernel. The PHY layer now allows us to have mulitple PHYs of the same type, which is necessary for platforms which provide more than one USB peripheral port. There's also a few cleanups here: removal of __dev* annotations, conversion of a cast to to_delayed_work(), and mxs-phy learns about ->set_suspend.
2013-01-25usb: dwc3: host: Change platform device ID for xhci-hcd to AUTOVivek Gautam
Multiple dwc3 controllers will try to allocate multiple xhci-hcd interfaces. Changing platform device IDs from NONE to AUTO to support such cases. Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> 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: core: add dt support for dwc3 coreKishon Vijay Abraham I
Added dt support for dwc3 core and update the documentation with device tree binding information. Getting a PHY is now done using devm_usb_get_phy_by_phandle() for dt boot. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-01-25usb: dwc3: core: stray statements are removedKishon Vijay Abraham I
No functional change. Stray statements where removed from dwc3 core. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-01-25usb: dwc3: core: enable the USB2 and USB3 phy in probeKishon Vijay Abraham I
Enabled the USB2 and USB3 PHY in probe by calling usb_phy_set_suspend and disabled the PHYs on driver removal. When PM is implemented this will be optimized to enable the PHYs only when needed. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.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>
2013-01-25usb: dwc3: exynos: fix compatible strings for the deviceVivek Gautam
Using specific chip in compatible strings. Newer SOCs can claim device by using older string in the compatible list. Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Reviewed-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-01-24usb: dwc3: gadget: change HIRD threshold to 12Felipe Balbi
First of all, that 28 value makes no sense as HIRD threshold is a 4-bit value, second of all it's causing issues for OMAP5. Using 12 because commit cbc725b3 (usb: dwc3: keep default hird threshold value as 4b1100) had the intention of setting the maximum allowed value of 0xc. Also, original code has been wrong forever, so this should be backported as far back as possible. Cc: <stable@vger.kernel.org> Signed-off-by: Felipe Balbi <balbi@ti.com>