summaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
Commit message (Collapse)AuthorAgeFilesLines
* usb: ehci: forward phy given in registration data to hostSascha Hauer2016-09-291-0/+1
| | | | | | | Allow to pass a phy in the registration data and forward it to the usb_host structure. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: ehci: honour timeout valueSascha Hauer2016-07-061-4/+4
| | | | | | | usb_control_msg() and usb_bulk_msg() have a timeout parameter. Honour this in the ehci driver instead of using a default timeout. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2016-03-111-19/+2
|\
| * ehci-hcd: preserve DTC in QH for interrupt transactionsAleksey Kuleshov2016-03-101-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | In Linux ehci-q Data Toggle Control bit for interrupt transactions is preserved in Queue Head (EHCI 3.6.2). So don't set 14's bit in qh_endpt1 and don't manage toggle bit anywhere in int transactions. This fixes an idle issue for USB keyboards, where keys were physically changed but barebox haven't seen them in polling until the next USB keyboard polling occurs. Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ehci-hcd: remove useless timeoutAleksey Kuleshov2016-03-101-8/+0
| | | | | | | | | | | | | | This is just a regular iteration loop so no timeout needed Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | driver: replace dev_request_mem_region with dev_request_mem_resourceSascha Hauer2016-03-074-10/+26
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_request_mem_region doesn't work properly one some SoCs on which PTR_ERR() values clash with valid return values from dev_request_mem_region. Replace them with dev_request_mem_resource where possible. This patch has been generated with the following semantic patch: // <smpl> @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { ... - return PTR_ERR(io); -} + return PTR_ERR(iores); +} +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) - return PTR_ERR(io); -} + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { - ret = PTR_ERR(io); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { + ret = PTR_ERR(iores); ... } +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ identifier func; @@ func(...) { <+... struct resource *iores; -struct resource *iores; ...+> } // </smpl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: ehci-hcd: Use regular mdelay()Sascha Hauer2015-10-141-1/+3
| | | | | | | The USB core will make sure we do not re-enter the ehci driver, so we can use regular mdelay instead of mdelay_non_interruptible(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Revert "usb: ehci-hcd: detect re-entrance"Sascha Hauer2015-10-141-38/+4
| | | | | | | Now that the USB core makes sure that we do not re-enter USB drivers we no longer have to detect re-entrancy in the ehci driver. This reverts commit 8426cc641dbd9c4e948ae4b5f3f89463e969eb1e.
* Revert "usb: ehci-hcd: use mdelay_non_interruptible()"Sascha Hauer2015-10-141-3/+3
| | | | | | | | Now that the USB core makes sure that we do not re-enter USB drivers we no longer need mdelay_non_interruptible() but can use regular mdelay() again. This reverts commit 4cfd909412e6ecfcef21c1ffabc8d515b39a0f85.
* usb: ehci-hcd: use mdelay_non_interruptible()Peter Mamonov2015-10-021-3/+3
| | | | | Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: ehci-hcd: detect re-entrancePeter Mamonov2015-10-021-4/+38
| | | | | Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: ehci-hcd: port periodic transactions implementation from the u-bootPeter Mamonov2015-10-022-2/+415
| | | | | Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: ehci-hcd: use is_timeout_non_interruptible()Peter Mamonov2015-09-101-2/+2
| | | | | | | | | Use is_timeout_non_interruptible() intead of is_timeout() to avoid re-entering ehci-hcd functions from pollers, registered by usb drivers. Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: ehci-hcd: add OF bindingsPeter Mamonov2015-09-041-4/+18
| | | | | Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: ehci: prevent bad PORTSC register accessKuo-Jung Su2015-08-261-6/+15
| | | | | | | | | | | | | | | | | 1. The 'index' of ehci_submit_root() is not always > 0. e.g. While it gets invoked from usb_get_descriptor(), the 'index' is always a '0'. (See ch.9 of USB2.0) 2. The PORTSC register is not always required, and thus it should only report a port error when necessary. It would cause a port scan failure if the ehci_submit_root() always gets terminated by a port error. Signed-off-by: Kuo-Jung Su <dantesu@faraday-tech.com> Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: ehci: replace multiple use of le16_to_cpu(req->index) with variableKuo-Jung Su2015-08-261-9/+10
| | | | | | | | This is part of U-Boot commit: 7d9aa8f usb: Add new command to set USB 2.0 port test modes Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: ehci-hcd: initialize ehci->qh_list[] with zerosPeter Mamonov2015-08-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Without this initialization ehci->qh_list[0].qh_endpt2 is left uninitialized, which causes problems with some EHCI host controllers. Das u-boot uses the same strategy: static int ehci_common_init(struct ehci_ctrl *ctrl, uint tweaks) { ... qh_list = &ctrl->qh_list; /* Set head of reclaim list */ memset(qh_list, 0, sizeof(*qh_list)); qh_list->qh_link = cpu_to_hc32((unsigned long)qh_list | QH_LINK_TYPE_QH); qh_list->qh_endpt1 = cpu_to_hc32(QH_ENDPT1_H(1) | QH_ENDPT1_EPS(USB_SPEED_HIGH)); qh_list->qh_overlay.qt_next = cpu_to_hc32(QT_NEXT_TERMINATE); qh_list->qh_overlay.qt_altnext = cpu_to_hc32(QT_NEXT_TERMINATE); qh_list->qh_overlay.qt_token = cpu_to_hc32(QT_TOKEN_STATUS(QT_TOKEN_STATUS_HALTED)); ... } Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* USB: xHCI: Sync non-coherent DMA buffersSebastian Hesselbarth2015-04-151-1/+22
| | | | | | | | | | When working with non-coherent transfer buffers, we have to sync device and cpu for outgoing and incoming buffers. Fix the driver where non-coherent buffers are used in device context. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: host: xhci: depend on HAS_DMALucas Stach2015-03-261-0/+2
| | | | | | | | The driver needs the dma coherent function and thus can only work on architectures implementing them. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: host: ohci: convert to streaming DMA opsLucas Stach2015-03-061-4/+6
| | | | | | | | | Move to the common streaming DMA ops in order to get rid of the direct usage of the ARM MMU functions for the cache maintenance. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: host: ehci: convert to streaming DMA opsLucas Stach2015-03-061-3/+5
| | | | | | | | | Move to the common streaming DMA ops in order to get rid of the direct usage of the ARM MMU functions for the cache maintenance. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: move DMA alloc functions to dma.hLucas Stach2015-03-064-2/+3
| | | | | | | | | | This better separates the DMA from the MMU functionality. Also move all drivers that only depends on asm/mmu.h for the alloc functions over to the common header. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: change dma_alloc/free_coherent to match other architecturesLucas Stach2015-03-063-8/+13
| | | | | | | | | As a lot drivers currently rely on the 1:1 virt->phys mapping on ARM we define DMA_ADDRESS_BROKEN to mark them. In order to use them on other architectures with a different mapping they need proper fixing. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: abolish wait_ms() functionMasahiro Yamada2015-02-021-3/+3
| | | | | | | | This function is only used in drivers/usb/*. It is equivalent to mdelay(). Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: host: only activate Efika MX ULPI workaround if ULPI is selectedLucas Stach2014-11-261-1/+1
| | | | | | | Fixes a build failure with disabled ULPI support. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: ehci-hcd: Correct CLEAR_FEATURE codeDmitry Voytik2014-10-211-4/+6
| | | | | | | | | | | | | | | This commit broke USB on olinuxino board: 87b9bea USB: host: hub: Use usb_hub_power_on from U-Boot This patch was ported from U-Boot with small changes. See discussion: http://lists.denx.de/pipermail/u-boot/2013-May/153920.html The root cause seems to be a missing mask and missing 'break' in ehci-hcd.c. Fix both. Signed-off-by: Dmitry Voytik <voytikd@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* resource: Let dev_request_mem_region return an error pointerSascha Hauer2014-09-162-0/+7
| | | | | | For all users fix or add the error check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/usb-host'Sascha Hauer2014-08-078-117/+3569
|\ | | | | | | | | Conflicts: drivers/usb/core/Makefile
| * usb: ehci: use linux-way ehci_readl and ehci_writelAntony Pavlov2014-07-281-8/+11
| | | | | | | | | | | | | | Also drop nowhere defined CONFIG_EHCI_DESC_BIG_ENDIAN. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB: host: add xHCI PCI driverSebastian Hesselbarth2014-07-283-0/+53
| | | | | | | | | | | | | | This adds a driver for PCI-attached xHCI controllers. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB: host: add xHCI HCD, Hub, and platform driverSebastian Hesselbarth2014-07-285-0/+3447
| | | | | | | | | | | | | | | | | | | | This adds support for xHCI USB 3.0 host controllers found on various SoCs and PCI devices. Currently, the driver only supports the virtual USB 2.0 ports of the host controller, so if you plan to use USB 3.0 devices, put a USB 2.0 cable in between. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB: EHCI: use min3 from LinuxSebastian Hesselbarth2014-07-281-11/+1
| | | | | | | | | | | | | | | | | | EHCI HCD has a private version of min3() determining the smallest number out of 3. We already have min()/max() imported from Linux, also get min3()/max3() and use it instead of EHCI's private one. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB: Use descriptors from ch11.hSebastian Hesselbarth2014-07-241-2/+2
| | | | | | | | | | | | | | | | | | Use the descriptors from ch11.h instead of duplicating them in usb.h. usb_hub_descriptor now contains a union .u to differentiate HS hub descriptor from SS hub descriptor. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB: EHCI: use descriptor length fieldsSebastian Hesselbarth2014-07-241-3/+3
| | | | | | | | | | | | | | | | Instead of hard-coding descriptor length, pick it from the corresponding descriptor. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB: EHCI: make use of defines for descriptorsSebastian Hesselbarth2014-07-241-52/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have a full set of defines for each descriptor field, make use of it for the EHCI HCD descriptors. This fixes endianess issues for .device.bcdUSB, .device.bcdDevice, .config.wTotalLength, and .endpoint.wMaxPacketSize. Also, .endpoint.bInterval was set to 0 instead of 255 due to a copy-and-paste error while assigning u8[] to usb_endpoint_descriptor. This also is a preparation for including ch11.h later, which has a modified usb_hub_descriptor for USB 3.0. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB: EHCI: reuse ch9.h config and interface descriptorsSebastian Hesselbarth2014-07-242-27/+2
| | | | | | | | | | | | | | | | | | Now that usb_config_descriptor and usb_interface_descriptor are clean of any additional fields, drop the duplication in EHCI code and use the default ones. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB: Move FooRequest defines and add class requestsSebastian Hesselbarth2014-07-241-16/+0
| | | | | | | | | | | | | | | | | | {Device,Interface,Endpoint}Requests are currently defined in private ehci.h but are also useful for other drivers than ehci-hcd. Move them to usb/usb_defs.h and also add some more class requests. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB: host: drop force rescanSascha Hauer2014-07-181-1/+1
| | | | | | | | | | | | | | | | We can now detect changes in the USB device hierarchy properly, so the 'force' option to the usb command is no longer necessary. We just scan the busses each time the usb command is called. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/usb'Sascha Hauer2014-08-072-3/+16
|\|
| * USB: Remove conflicting USB_SPEED_* definitionsSascha Hauer2014-07-182-3/+16
| | | | | | | | | | | | | | | | | | We have USB_SPEED_* definitions as macros in usb_defs.h and as an enum in ch9.h. The defines in usb.h correspond to hardware bits in the ehci controller. Get rid of them and keep the hardware independent enums. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | sandbox: allow "make ARCH=sandbox allyesconfig"Holger Schurig2014-07-221-0/+1
|/ | | | | | | | | | | | | Compiling the tree with allyesconfig is helpful because different compilers (gcc, clang) or static checkers (e.g. clang's scan-build) can then process and check more code. This patch introduces two new configuration symbols that Kconfig files can depend on. That way, code that is only working where a cache or DMA implementation exists can be opted out. Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* USB: Check init/post_init errorsAlexander Shiyan2013-10-221-4/+8
| | | | | | | | | Host with inoperable ULPI able to bring the system into an infinite loop. The patch adds error checking during initialization to avoid this. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: make usb devices children of the corresponding hostSascha Hauer2013-09-242-0/+2
| | | | | | To be able to find usb devices in the hardware tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/usb'Sascha Hauer2013-07-011-0/+9
|\
| * usb: ehci: implement detect callbackSascha Hauer2013-06-211-0/+9
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: i.MX51 efikasb: Switch to devicetree probingSascha Hauer2013-06-251-1/+5
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | usb: ehci: Fixup efika hack for devicetreeSascha Hauer2013-06-251-3/+2
|/ | | | | | | | | We used to distinguish which USB port to fixup by pdev->id. This is < 0 for devicetree probed devices all the time, so this won't work anymore once we switch to devicetree. Do the fixup on every port instead, it doesn't hurt. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: ehci: initialize ehci_dataSascha Hauer2013-03-081-1/+1
| | | | | | | Without it fields of ehci_data may be unitialized and the driver crashes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/usb'Sascha Hauer2013-03-041-0/+14
|\
| * USB ehci: Add platform specific init callsSascha Hauer2013-02-141-0/+14
| | | | | | | | | | | | | | Some USB cores need a platform specific init hook, add it to the ehci driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>