summaryrefslogtreecommitdiffstats
path: root/drivers/usb
Commit message (Collapse)AuthorAgeFilesLines
* usb: imx: Fix setting of dev->privSascha Hauer2017-03-091-1/+3
| | | | | | | | | Since fc10539f7d the usbmisc pointer must be stored in dev->priv, but dev->priv has never been set. Fix this. Fixes: fc10539f7d usb: imx: Make usb-misc multi instance safe Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: imx: role_registered contains roleSascha Hauer2017-03-091-2/+2
| | | | | | | role_registered contains the role, it's not a bool indicating that a role is registered. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2017-02-131-6/+21
|\
| * usb: ehci: pass full speed devices to companion controllerPeter Mamonov2017-01-301-6/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the "Enhanced Host Controller Interface Specification for Universal Serial Bus" after a USB port reset the EHCI Driver checks the PortEnable bit in the PORTSC register. If set to a one, the connected device is a high-speed device [...]. At the time the EHCI Driver receives the port reset and enable request the LineStatus bits might indicate a low-speed device. Additionally, when the port reset process is complete, the PortEnable field may indicate that a full-speed device is attached. In either case the EHCI driver sets the PortOwner bit in the PORTSC register to a one to release port ownership to a companion host controller. Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx'Sascha Hauer2017-02-134-16/+125
|\ \
| * | usb: imx: Add clock supportSascha Hauer2017-01-191-0/+13
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: imx: Add usbmisc support for i.MX7Sascha Hauer2017-01-191-0/+53
| | | | | | | | | | | | | | | | | | Taken directly from Linux-4.10-rc3 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: imx: Make usb-misc multi instance safeSascha Hauer2017-01-192-15/+28
| | | | | | | | | | | | | | | | | | | | | 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>
| * | i.MX: imx-usb-misc: Add Vybrid supportAndrey Smirnov2017-01-121-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | Add code to do usbmisc initialization on VF610 family of SoCs. Based on analogous code from Linux kernel. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | i.MX: Default CONFIG_USB_IMX_PHY to 'y' on VybridAndrey Smirnov2017-01-121-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | i.MX: imx-usb-phy: Add VF610 OF compatiblity stringAndrey Smirnov2017-01-121-0/+2
| |/ | | | | | | | | | | | | | | | | | | From looking at analogous Linux driver code it seems that all of the differences between code "imx23-usbphy" and "vf610-usbphy" pertain to suspend/resume functionality, which shouldn't affetct Barebox. As a result this commit just adds a compatiblity string and no other code. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / usb: gadget: disable AT91 driver on SAMA5D4Lucas Stach2017-01-171-0/+1
|/ | | | | | | | | | | This architecture is missing the right defines for the system peripherals, that are needed for this driver to build successfully. Disable it for now until someone with a clue about this architecture can fill in the gap. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: imx-us-phy: implement notify_(dis)concectSascha Hauer2016-09-291-0/+27
| | | | | | | | | | | The i.MX6 USB phy does not recognize disconnects of high speed devices when the USBPHY_CTRL_ENHOSTDISCONDETECT is not set. The phy does not work properly though when this bit is always set, so implement the notify_(dis)concect() callbacks to set this bit whenever a high speed device is connected and to clear it again when the device is disconnected. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: imx-us-phy: Convert driver to generic phy supportSascha Hauer2016-09-293-4/+66
| | | | | | | The generic phy layer now supports USB phys, so convert the driver over to use it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: imx-usb-phy: Drop unnecessary read/modify/writeSascha Hauer2016-09-291-5/+2
| | | | | | | When writing to the USBPHY_CTRL register read/modify/write is unncessary since we are writing to the associated bit set register anyway. 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/+8
| | | | | | | | 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>
* usb: Use standard debug macroSascha Hauer2016-09-281-27/+25
| | | | | | Use standard pr_debug instead of homebrew USB_PRINTF Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: i.MX drivers: enable i.MX50 where already supportedAlexander Kurz2016-09-121-0/+6
| | | | | | | | The i.MX50 SOC includes one ESDHCv3, three ESDHCv2, one cspi and two ecspi instances which are supported by existing drivers. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: i.MX chipidea: Enable VBUS regulator when neededSascha Hauer2016-09-051-4/+13
| | | | | | | We should enable VBUS only in host mode, not unconditionally during probe(). Fix that. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: chipidea i.MX: Do not return unnecessary errorSascha Hauer2016-08-291-3/+8
| | | | | | | | | We only allow to setup the host/peripheral role once, when it's already set then we return -EBUSY. Return 0 instead when we set the same role again and only return -EBUSY when we actually try to change the role. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* include: Move bulk of boot.h to bootm.hSascha Hauer2016-07-261-1/+1
| | | | | | | | The majority of the stuff currently in include/boot.h is about bootm code implemented common/bootm.c. To be more consistent move it to a new file include/bootm.h. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* USB: gadget: composite: avoid possible NULL ptr dereferenceLucas Stach2016-07-071-1/+3
| | | | | | | Check if g is valid before trying to dereference it. Signed-off-by: Lucas Stach <dev@lynxeye.de> 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>
* usb: fastboot: Fix oem exec supportSascha Hauer2016-05-101-1/+1
| | | | | | | | | Fixes: b1374a6 usb: fastboot: drop CONFIG_COMMAND_SUPPORT dependency The correct config option to depend on is CONFIG_COMMAND_SUPPORT, not CONFIG_COMMAND. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/ubiformat'Sascha Hauer2016-05-092-7/+16
|\
| * usb: fastboot: drop CONFIG_COMMAND_SUPPORT dependencySascha Hauer2016-04-262-1/+5
| | | | | | | | | | | | | | fastboot can run without command support. In this case we cannot execute oem commands. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: fastboot: Use C API for ubiformatSascha Hauer2016-04-261-5/+11
| | | | | | | | | | | | | | | | This makes it possible to compile the fastboot gadget without command support. While at it bail out when ubiformat is not compiled in. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/include-cleanup'Sascha Hauer2016-05-093-5/+7
|\ \ | |/ |/|
| * string: Fix (v)asprintf prototypesSascha Hauer2016-04-153-5/+6
| | | | | | | | | | | | | | | | | | | | Our asprintf and vasprintf have different prototypes than the glibc functions. This causes trouble when we want to share barebox code with userspace code. Change the prototypes for (v)asprintf to match the glibc prototypes. Since the current (v)asprintf are convenient to use change the existing functions to b(v)asprintf. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * include: move run_command prototype to command.hSascha Hauer2016-04-151-0/+1
| | | | | | | | | | | | run_command fits much better into command.h, move it there. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fix erasing/protecting flashes with unspecified sizeSascha Hauer2016-04-192-3/+3
|/ | | | | | | | | | | | | | | | | fixes: 81737c1 mtd: Fix erasing of devices >4GiB Several places erased a complete flash partition passing ~0 as count to erase(). With the above commit count to erase was changed from an unsigned type to a signed type, so the (count > f->size - offset) check in erase() no longer triggers and the ~0 count is no longer adjusted to the whole device size. Among other things this results in saveenv failures on NOR flashes. This patch fixes this by introducing an explicit macro for erasing the whole device which is tested for in erase(). All other negative values are rejected. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reported-by: Giorgio <giorgio.nicole@arcor.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>
* | Merge branch 'for-next/driver'Sascha Hauer2016-03-1112-38/+74
|\ \
| * | driver: replace dev_request_mem_region with dev_request_mem_resourceSascha Hauer2016-03-0712-38/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | driver: Fix return check of dev_request_mem_regionSascha Hauer2016-02-234-8/+8
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_request_mem_region returns an ERR_PTR, fix places which check for a NULL pointer instead. This patch has been generated with this semantic patch, written by me and improved by Andrey Smirnov: // <smpl> @@ expression e; expression e1; @@ e = dev_request_mem_region(...); ... -if (!e) - return e1; +if (IS_ERR(e)) + return PTR_ERR(e); @ rule1 @ expression e; @@ e = dev_request_mem_region(...); @@ expression rule1.e; identifier ret, label; constant errno; @@ if (!e) { ... ( - ret = -errno; + ret = PTR_ERR(e); ... goto label; | - return -errno; + return PTR_ERR(e); ) } @depends on rule1@ expression rule1.e; @@ - if (e == NULL) + if (IS_ERR(e)) { ... } // </smpl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
* | Merge branch 'for-next/bbu'Sascha Hauer2016-03-111-1/+47
|\ \
| * | fastboot: Add a ARM Barebox filetype handlerMarkus Pargmann2016-03-111-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | This will automatically call barebox_update for the transfered file if it is an ARM Barebox image and the destination file is defined by some update handler. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | fastboot: Fix usage of ubiformat for UBI image transfersMarkus Pargmann2016-02-181-1/+16
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Currently all fastboot flash commands with UBI images are handled by a final call to 'ubiformat'. This only makes sense for flash commands where the target file is a mtd device. If we just want to transfer a UBI image we would expect a simple copy to the correct location. This patch checks if the destination file is a MTD device by opening it and calling an ioctl MEMGETINFO. Only for MTD devices, ubiformat is called. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / USB: imx-usb-phy: Fix uninitialized use of variableSascha Hauer2016-03-101-0/+1
|/ | | | | | ret may no be initialized in the error path when clk_get fails. Fix it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Introduce include/linux/spinlock.hYegor Yefremov2016-02-013-0/+3
| | | | | | | 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: chipidea-imx: check return value of regulator_get()David Jander2016-01-081-1/+2
| | | | | | | | | | The VBUS regulator is optional for the chipidea-imx glue, so it must be checked if regulator_get provided a valid regulator handle before trying to enable the regulator. Signed-off-by: David Jander <david@protonic.nl> Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: mx25: fix bit position of "Host power mask"Uwe Kleine-König2015-11-091-1/+1
| | | | | | | | | | | | | | | | | The bit MX25_H1_PM_BIT value is handled for port 1 as MX25_OTG_PM_BIT is for port 0. The latter is called "OPM: OTG power mask" in the i.MX25 reference manual. Its description matches the description of "HPM: Host power mask" for the host port which is bit 16, not 8. The Linux kernel (as of 4.3) also has #define MX25_H1_PM_BIT BIT(16) . Fixes: a4076ddf6577 ("USB i.MX: Add chipidea driver support") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> 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: core: return -EAGAIN on usb_* functions reentrancePeter Mamonov2015-10-141-1/+39
| | | | | 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-075-19/+500
|\