summaryrefslogtreecommitdiffstats
path: root/include/usb
Commit message (Collapse)AuthorAgeFilesLines
* usb: imx: Make usb-misc multi instance safeSascha Hauer2017-01-191-2/+2
| | | | | | | i.MX7 has two usbmisc devices, so we cannot use global instance variables anymore. Create a driver private data struct for it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 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: Add usb phy to usb hostSascha Hauer2016-09-291-0/+1
| | | | | | | | Add a struct usb_phy * member to struct usb_host. Also, call usb_phy_notify_connect() / usb_phy_notify_disconnect() when there are connection changes on the root hub. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Introduce include/linux/spinlock.hYegor Yefremov2016-02-011-0/+1
| | | | | | | Move spinlock related definitions to its original place. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: core: return -EAGAIN on usb_* functions reentrancePeter Mamonov2015-10-141-0/+1
| | | | | Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/usb'Sascha Hauer2015-10-071-0/+1
|\
| * usb: chipidea: Add udc unregister for device removalMarkus Pargmann2015-09-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The host may assume that the usb device is still up and running after booting if we do not deregister the udc here. I observed issues when the linux kernel was using a usb gadget directly where the complete USB Hub got disconnected through this. This patch adds a proper USB disconnect for gadget devices. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | chipidea-imx: allow phymode configuration in pdataEric Bénard2015-09-291-0/+3
|/ | | | | | | | | it's currently only handled through DT and for i.MX25 OTG port (at least), we need to configure portsc to get host mode working but it actually fails as ci->phymode is 0 which is USBPHY_INTERFACE_MODE_UNKNOWN Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: increase USB_CNTL_TIMEOUT to match linuxSteffen Trumtrar2015-05-041-1/+1
| | | | | | | | | | | | | | | | | | | | | USB requests should be processed within a timeframe of 5s. The linux kernel also uses this timeout value for the control packets. For the musb the increase in timeout helps successfully probing USB devices (at least on one test hardware), but on the other hand doesn't slow down the system, if there are no devices, i.e. the timeout never hits. That means, that the USB core correctly aborts instead of timing out. Why and how the 100ms was chosen in the first place, can not be deduced from the git history, just that it seems to work fine for most boards. Change USB_CNTL_TIMEOUT to 5000ms and replace all occurences of `USB_CNTL_TIMEOUT * x` with just `USB_CNTL_TIMEOUT`, as the timeout is now large enough without it. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: gadget: include common.h in headerLucas Stach2015-03-061-0/+1
| | | | | | | | It is needed for container_of() and this header falls over if we change the include order. 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-4/+0
| | | | | | | | 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: Add MUSB driver from LinuxSascha Hauer2014-09-261-0/+152
| | | | | | | 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: put poller into coreSascha Hauer2014-09-261-0/+1
| | | | | | | | 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-9/+220
| | | | | | | Mostly taken from the Linux Kernel to ease porting phy handling code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/usb-host'Sascha Hauer2014-08-075-142/+342
|\ | | | | | | | | Conflicts: drivers/usb/core/Makefile
| * USB: host: add xHCI HCD, Hub, and platform driverSebastian Hesselbarth2014-07-281-0/+33
| | | | | | | | | | | | | | | | | | | | 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: remove redundant defines from usb_defs.hSebastian Hesselbarth2014-07-241-117/+0
| | | | | | | | | | | | | | | | | | We imported a bunch of defines with ch9.h and ch11.h that are now duplicated in usb_defs.h. Get rid of each duplicate in usb_defs.h and prefer the ones from ch9.h and ch11.h. 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-26/+1
| | | | | | | | | | | | | | | | | | 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: Move FooRequest defines and add class requestsSebastian Hesselbarth2014-07-241-0/+26
| | | | | | | | | | | | | | | | | | {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: fixup usb_hub_descriptor length nameSebastian Hesselbarth2014-07-241-1/+1
| | | | | | | | | | | | | | | | | | All other descriptors have their length field named bLength, except imported usb_hub_descriptor from Linux uses bDescLength. Adjust the name to match the others. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB: reduce USB_MAXCHILDREN on imported ch11.hSebastian Hesselbarth2014-07-241-1/+3
| | | | | | | | | | | | | | | | | | Barebox supports up to 8 USB devices attached on a Hub, Linux does 31. Reduce the USB_MAXCHILDREN define in ch11.h to the Barebox one and put a comment above. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB: import ch11.h from LinuxSebastian Hesselbarth2014-07-241-0/+277
| | | | | | | | | | | | | | | | | | | | Linux has an extra include for chapter 11 (Hub Specification) of USB 2.0 spec. We already have a ch9.h, so import the one from Linux. Barebox specific changes will be patched up later. 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-3/+3
| | | | | | | | | | | | | | | | 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>
| * commands: usb: add tree view capabilityAntony Pavlov2014-07-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds U-Boot 'usb tree' command functionality to barebox. Here is an example output: 1 ID 0000:0000 | u-boot EHCI Host Controller | +-2 ID 05e3:0606 | USB2.0 Hub | +-3 ID 10c4:ea60 | Silicon Labs CP2102 USB to UART Bridge Contr P-00-00669 | +-4 ID 05e3:0606 | | USB2.0 Hub | | | +-5 ID 05e3:0608 | | | USB2.0 Hub | | | | | +-6 ID 0d8c:000c | | C-Media USB Headphone Set | | | +-7 ID 0d8c:000c | C-Media USB Headphone Set | +-8 ID 0846:1040 NETGEAR NETGEAR FA120 Adapter The tree view is enabled with 'usb -t' Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB: i.MX chipidea: Implement OTG support for the poorSascha Hauer2014-07-181-0/+1
| | | | | | | | | | | | | | | | For situations when we don't know the desired mode for the OTG port we register a otg device which has a mode parameter to specifiy the desired mode on the command line. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | USB: gadget: Add a multi function gadgetSascha Hauer2014-07-241-0/+17
| | | | | | | | | | | | | | | | | | | | Similar to the Kernel multi function this gadget driver is used for creating a USB device with multiple functions. This is created and removed with the newly created 'usbgadget' command. Based on the options it creates combinations of DFU, fastboot and serial USB functions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | USB: gadget: Add Android fastboot supportSascha Hauer2014-07-241-0/+13
| | | | | | | | | | | | | | | | The Android fastboot protocol Can be used to update firmware and to issue other lowlevel commands to the bootloader. This adds a fastboot implementation based on the U-Boot fatboot code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | USB: gadget: DFU: register as USB functionSascha Hauer2014-07-221-3/+5
| | | | | | | | | | | | | | | | Register DFU as usb_function_instance to make it work with composite gadgets. Also use this internally for registering as DFU device (with the 'dfu' command). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Add function to parse a string in dfu formatSascha Hauer2014-07-221-12/+2
| | | | | | | | | | | | | | | | | | The dfu command parses a string which contains a list of devices and flags. This format is useful for other users aswell, so add common helper functions to parse it and let the dfu command use this format. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | USB: gadget: DFU: Move locally used defines/structs to dfu driverSascha Hauer2014-07-221-67/+0
| | | | | | | | | | | | There's no reason to have them under include/ Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | USB: gadget: specify vendor/product id with device parametersSascha Hauer2014-07-223-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces the device parameters: usbgadget.product usbgadget.vendor usbgadget.manufacturer usbgadget.productname These variables are used to configure the USB vendor id, product id, manufacturer name and product name. Previously these were configured with arguments to the usbserial and dfu command. The parameters are device static, so it's nice to configure it somewhere in the environment instead of when calling dfu/usbserial. Also when other gadget drivers are added we do not have to duplicate the option parsing further. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | USB: gadget: composite: Break out of potential endless loopSascha Hauer2014-07-221-0/+2
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | USB: gadget: Update to 3.15Sascha Hauer2014-07-224-115/+598
|/ | | | | | | | | This updates the USB Gadget stack to Linux-3.15. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Conflicts: drivers/usb/core/Makefile
* USB: Remove conflicting USB_SPEED_* definitionsSascha Hauer2014-07-182-8/+0
| | | | | | | | | 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>
* USB: Use descriptors from ch9.hSascha Hauer2014-07-181-62/+1
| | | | | | | Use the descriptors from ch9.h instead of duplicating them in usb.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* USB: introduce usb_interface/usb_configuration structsSascha Hauer2014-07-181-17/+18
| | | | | | | | | | | Currently we have two conflicting definitions of struct usb_config_descriptor and struct usb_interface_descriptor in the tree. This is because the USB code uses additional fields in the structs for internal housekeeping. Add struct usb_interface and struct struct usb_configuration with the housekeeping data and embed the corresponding hardware structs into them. This frees the way to use the definitions from ch9.h in the next step. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Documentation: remove doxygen documentationSascha Hauer2014-06-264-16/+0
| | | | | | | The doxygen documentation is long outdated. Remove it. It will be replaced with sphinx based documentation later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: drop unused USB_UHCI_*_ID macrosAntony Pavlov2014-05-221-4/+0
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: remove unimplemented usb_get_dev_index() declarationAntony Pavlov2014-05-221-1/+0
| | | | | | | We do not have usb_get_dev_index() function, so remove this declaration. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: dfu: Add create flagSascha Hauer2014-02-281-0/+1
| | | | | | | With the create flag DFU can upload to regular, previously non existing files. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: dfu: Fix spelling of flag nameSascha Hauer2014-02-281-1/+1
| | | | | | DFU_FLAG_SAVE should really be named DFU_FLAG_SAFE. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: chipidea i.MX: remove unused pdata->init hookSascha Hauer2014-01-071-1/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: make usb devices children of the corresponding hostSascha Hauer2013-09-241-0/+1
| | | | | | To be able to find usb devices in the hardware tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove remaining references of CONFIG_BOARDINFOSascha Hauer2013-08-162-2/+2
| | | | | | | | | | | With this all code uses barebox_get_model() and no longer a compile time generated string. Also this renames barebox_boardinfo() to barebox_get_model() since we are going to add the corresponding _set_ function and 'model' corresponds to the devicetree notion. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: implement a usb_host_detect to scan individual USB hostsSascha Hauer2013-06-211-0/+3
| | | | | | | | Currently we can only (re)scan all USB hosts. Add a function to scan individual hosts. This is useful for implementing the detect callback in the next patch. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: move scanned status into coreSascha Hauer2013-06-211-1/+1
| | | | | | | A command should not be interested in the internal USB core state, so move the state handling into the core. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: i.MX chipidea: Add overcurrent disable flag for i.MX6Sascha Hauer2013-05-311-0/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: Add devicetree helpersSascha Hauer2013-05-301-0/+21
| | | | | | Add helpers to get the dr_mode and the phy_mode. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Remove unimplemented usb_driver_unregister declarationAlexander Shiyan2013-04-181-1/+0
| | | | | | | We do not have usb_driver_unregister function, so remove this declaration. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/usb'Sascha Hauer2013-03-043-0/+14
|\