summaryrefslogtreecommitdiffstats
path: root/drivers/usb
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* usb: gadget: fsl_udc: convert to streaming DMA opsLucas Stach2015-03-061-4/+4
| | | | | | | | | 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-065-2/+6
| | | | | | | | | | 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-064-11/+17
| | | | | | | | | 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>
* Merge branch 'for-next/misc'Sascha Hauer2015-02-046-13/+14
|\
| * usb: abolish wait_ms() functionMasahiro Yamada2015-02-025-13/+13
| | | | | | | | | | | | | | | | 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>
| * console: allow to specify the device idJean-Christophe PLAGNIOL-VILLARD2015-01-131-0/+1
| | | | | | | | | | | | | | so we can use dynamic number id with specific devname Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | usb: at91_udc: pass the vbus initial valueBo Shen2015-02-041-0/+2
| | | | | | | | | | | | | | | | If without pass the vbus initial value, the vbus status alway present as 0 even if the vbus is connected to 5v. Signed-off-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | usb: musb-dsps: select OFDEVICELucas Stach2015-01-191-0/+1
|/ | | | | | | | Fixes: In function `dsps_probe': undefined reference to `of_usb_get_dr_mode' Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: gadget: fastboot: allow to build without BOOTMLucas Stach2014-12-171-1/+4
| | | | | | | | | | | This will disable the capability to boot an uploaded image directly, but keeps other fastboot functionality. This seems like a valid config. Fixes: In function `do_bootm_on_complete': undefined reference to `bootm_boot' Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* USB: Gadget: fastboot: depends on command supportSascha Hauer2014-11-271-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* USB: Gadget: Select poller from USB_GADGET optionSascha Hauer2014-11-271-3/+1
| | | | | | | The poller has been merged to the gadget core, so now the core needs poller support, not the individual drivers. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: musb: only build musb_barebox if host is enabledLucas Stach2014-11-271-2/+2
| | | | | | | | | | | | musb_barebox.c contains code that is only ever used if CONFIG_MUSB_HOST is set. Building it uncoditionally breaks the build depending on the link order. Fixes: drivers/usb/musb/musb_barebox.c:64: undefined reference to `musb_urb_enqueue' Signed-off-by: Lucas Stach <l.stach@pengutronix.de> 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: gadget: fastboot: select BANNERLucas Stach2014-11-241-0/+1
| | | | | | | | Fastboot gadget needs the 'release_string' which is available only if CONFIG_BANNER is set. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dfu: fix possible usage of uninitialized varLucas Stach2014-10-211-0/+1
| | | | | | | | The error path would in fact use the status variable without it being initialized first. Signed-off-by: Lucas Stach <dev@lynxeye.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>
* Merge branch 'for-next/resource-err-ptr'Sascha Hauer2014-10-025-4/+16
|\
| * resource: Let dev_request_mem_region return an error pointerSascha Hauer2014-09-165-4/+16
| | | | | | | | | | | | For all users fix or add the error check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | USB: MUSB: Add barebox specific changesSascha Hauer2014-09-2619-3831/+898
| | | | | | | | | | | | | | | | | | | | | | This changes the MUSB support from the original Kernel state to be usable with barebox. Tested on a custom board and the Beaglebone Black. The host port on the Beaglebone works, the OTG port works in device mode, but not yet in host mode. Based on the initial MUSB port from Rolf Evers Fischer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | USB: Add MUSB driver from LinuxSascha Hauer2014-09-2614-0/+11146
| | | | | | | | | | | | | | This adds the necessary files from the MUSB driver directly from Linux 3.17-rc5. No changes to the original files have been made so far. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | USB: gadget: allow multiple udc driversSascha Hauer2014-09-261-9/+3
| | | | | | | | | | | | | | | | | | | | Since the MUSB driver will have it's own directory the Kconfig entries won't be in drivers/usb/gadget/Kconfig. This is incompatible with the current 'choice' approach for udc drivers. The udc drivers do not implement the global usb_gadget_poll() anymore, so we can drop the choice and allow multiple gadget drivers. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | USB: gadget: put poller into coreSascha Hauer2014-09-264-74/+54
| | | | | | | | | | | | | | | | Instead of letting each driver implement usb_gadget_poll directly implement this function in the core which then calls into the drivers. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | USB: add usb phy header fileSascha Hauer2014-09-262-0/+2
| | | | | | | | | | | | | | Mostly taken from the Linux Kernel to ease porting phy handling code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | USB: gadget: dfu: Add max_speed to dfu_driverSascha Hauer2014-09-251-0/+1
| | | | | | | | | | | | | | The MUSB driver checks for this field. If it doesn't contain something useful the driver bails out. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | USB: gadget: fastboot: Add missing includeSascha Hauer2014-09-251-0/+1
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/usb-host'Sascha Hauer2014-08-0714-591/+4227
|\ | | | | | | | | 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: improve error paths and tear-downSebastian Hesselbarth2014-07-283-27/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | USB core isn't too strict about allocation/deallocation and add/remove sequences of usb devices. Especially, error paths and device tear-down are kind of broken and cause hangs on failing usb device detect. This patch improves the situation by introducing a usb_free_device() that tears down allocated resources by usb_alloc_new_device(). usb_remove_device() now only deals with resources that have been added by usb_new_device(). Also, error handling is fixed or improved to ensure that no devices are unregistered that have not been previously registered. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB: Count detected USB devices independent of dev_indexSebastian Hesselbarth2014-07-281-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Adding a usb device increases dev_index every time a new device is allocated. Removing a usb device does not decrease again, of course. As we print the number of detected usb devices after each usb bus scan based on dev_index, we cannot trust dev_index here. Keep track of the correct number of (currently) detected usb devices by introducing an independent dev_count that gets increased on detect and decreased on remove. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB: Fix stale usb devices in usb_device_listSebastian Hesselbarth2014-07-281-0/+1
| | | | | | | | | | | | | | | | | | New usb devices are added to a list of usb devices, but when removing the corresponding usb_device it was not removed from that list. Fix it by deleting it properly from the usb_device_list. 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-242-7/+7
| | | | | | | | | | | | | | | | | | 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: fix PowerPowerCtrlMask assignmentSebastian Hesselbarth2014-07-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | usb_hub_configure() gets the hub descriptor and copies its values over to a local descriptor. While copying PortPowerCtrlMask it erroneously overwrites DeviceRemovable due to a copy-and-paste error. Fix it up. 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-182-28/+13
| | | | | | | | | | | | | | | | 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>
| * USB: host: detect port change only once in usb_hub_configure_portSascha Hauer2014-07-181-2/+8
| | | | | | | | | | | | | | Otherwise a device may be registered/unregistered multiple times during scanning the hub ports. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB: host: implement usb_remove_deviceSascha Hauer2014-07-183-0/+21
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB: host: hub: only configure hub onceSascha Hauer2014-07-181-1/+8
| | | | | | | | | | | | | | | | | | | | We had a single function which configures the hub and scans the ports. Split this up and configure the hub only once and scan the ports during detect() time. This allows to plug in additional devices into a hub while continuing to use the already existing devices. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB: host: factor out port configuration to separate functionSascha Hauer2014-07-181-51/+74
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB: host: hub: Use usb_hub_power_on from U-BootSascha Hauer2014-07-181-1/+18
| | | | | | | | | | | | | | | | U-Boots power good delay function is more conservative than ours. Use it to be on the safe side. The U-Boot guys have discussed a lot about it, let's hope they got it right. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB: host: hub: Use dev_dbgSascha Hauer2014-07-181-48/+40
| | | | | | | | | | | | | | Now that a hub is a driver use dev_dbg rather than plain printf. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB: host: fixup USB device hierarchySascha Hauer2014-07-182-2/+2
| | | | | | | | | | | | | | Make all USB devices children to the hub device they are attached to. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB: host: hub: Turn into a driverSascha Hauer2014-07-185-415/+460
| | | | | | | | | | | | | | | | Since we have a driver model we can make the hub driver a real driver model driver. Put it into a new file to separate the hub from the USB core stuff. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>