summaryrefslogtreecommitdiffstats
path: root/drivers/usb/imx/chipidea-imx.c
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* usb: imx: Add clock supportSascha Hauer2017-01-191-0/+13
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: imx: Make usb-misc multi instance safeSascha Hauer2017-01-191-2/+7
| | | | | | | 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: imx-us-phy: Convert driver to generic phy supportSascha Hauer2016-09-291-0/+21
| | | | | | | 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: 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>
* driver: replace dev_request_mem_region with dev_request_mem_resourceSascha Hauer2016-03-071-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: 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>
* Merge branch 'for-next/usb'Sascha Hauer2015-10-071-0/+7
|\
| * usb: chipidea: Add udc unregister for device removalMarkus Pargmann2015-09-231-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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/+1
|/ | | | | | | | | 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>
* Merge branch 'for-next/resource-err-ptr'Sascha Hauer2014-10-021-2/+3
|\
| * resource: Let dev_request_mem_region return an error pointerSascha Hauer2014-09-161-2/+3
| | | | | | | | | | | | For all users fix or add the error check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | USB: add usb phy header fileSascha Hauer2014-09-261-0/+1
|/ | | | | | | Mostly taken from the Linux Kernel to ease porting phy handling code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* USB: i.MX chipidea: Implement OTG support for the poorSascha Hauer2014-07-181-9/+92
| | | | | | | | 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: chipidea i.MX: relax phy_type requirementsSascha Hauer2014-05-221-9/+10
| | | | | | | | Some USB ports only have one possiblitly for the phy_type and the type is not specified in the devicetree in this case. Rely on the reset default instead of failing. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: chipidea i.MX: add some delay after ulpi_setupSascha Hauer2014-01-071-0/+1
| | | | | | | | On the pcm038 the ULPI phy is found correctly, but after a power cycle the attached devices are not found. Adding some delay fixes this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: chipidea i.MX: always print an error message when ULPI failsSascha Hauer2014-01-071-0/+3
| | | | | | | | The ULPI code does not print a message when the operation times out. Add one to the caller so that he gets an idea that something is going wrong. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: chipidea i.MX: limit port init to HSIC modeSascha Hauer2014-01-071-1/+2
| | | | | | | | imx_chipidea_port_init() will be called during startup from the ehci driver. Calling it before setting up the PORTSC register is only necessary in HSIC mode. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: chipidea i.MX: remove unused pdata->init hookSascha Hauer2014-01-071-5/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Add missing includesSascha Hauer2013-11-081-0/+2
| | | | | | | | A lot of files rely on include/driver.h including include/of.h (and this including include/errno.h. include the files explicitly so we can eventually get rid of including of.h from driver.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next-manual/oftree-linux-sync'Sascha Hauer2013-07-021-7/+7
|\
| * OF: base: import parse phandle functions from Linux OF APISebastian Hesselbarth2013-06-201-6/+5
| | | | | | | | | | | | | | | | This imports of_parse_phandle_with_args and of_count_phandle_with_args from Linux OF API. The slightly different of_parse_phandles_with_args is removed and all users are converted to reflect the API change. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
| * OF: base: sync of_find_property with linux OF APISebastian Hesselbarth2013-06-201-1/+2
| | | | | | | | | | | | | | | | To start synchronizing OF API of barebox with linux OF API, this adds a length pointer to of_find_property. Also all current users of that function are updated to reflect the API change. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
* | Merge branch 'for-next/imx'Sascha Hauer2013-07-011-13/+16
|\ \ | |/ |/| | | | | Conflicts: drivers/usb/imx/chipidea-imx.c
| * usb: i.MX chipidea: probe ULPI phys laterSascha Hauer2013-06-251-15/+16
| | | | | | | | | | | | | | | | Probe ULPI phys during USB initialization and not during driver probe. This lowers the pressure to have the necessary board specific setup in place early. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Revert "usb: chipidea-imx: Fix usb initialization"Lucas Stach2013-06-171-2/+2
|/ | | | | | | | | | This breaks HSIC and has no good justification why this would be needed for ULPI. This reverts commit 2e7d66f526217f6ff3167e4580aecb9548a0de33. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: i.MX chipidea: Add overcurrent disable flag for i.MX6Sascha Hauer2013-05-311-0/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: i.MX chipidea: Add devicetree supportSascha Hauer2013-05-311-26/+107
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: chipidea-imx: Fix usb initializationAlexander Shiyan2013-03-131-2/+2
| | | | | | | | | | | This patch fix chipidea-imx usb initialization. "imx_chipidea_port_init" was moved before PORTSC setup in the commit "USB i.MX chipidea: implement post init support". This change breaks usb function with ULPI. Patch moves port initialization back after PORTSC setup, so it works again. 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-041-13/+43
|\
| * USB i.MX: Add chipidea gadget supportSascha Hauer2013-02-151-5/+6
| | | | | | | | | | | | | | | | This adds USB gadget support to the i.MX chipidea driver. Basically we have to add a register function to the fsl udc driver and call this from the chipidea driver if device mode is selected. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB i.MX chipidea: implement post init supportSascha Hauer2013-02-141-7/+36
| | | | | | | | | | | | | | Some controllers need an init hook after the USB controller is started, so implement the post init hook for i.MX. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * USB chipidea i.MX: Fix PTS mask for HSICSascha Hauer2013-02-141-1/+1
| | | | | | | | | | | | bit25 is part of the PTS bits, so mask it out before rewriting it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Use new device_platform_driver() macro for driversAlexander Shiyan2013-02-131-6/+1
|/ | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* USB i.MX: Add chipidea driver supportSascha Hauer2012-12-131-0/+91
For proper USB function the usbmisc registers have to be initialized. This patch adds a driver which matches for the usbmisc registers. This driver is called from a new driver which binds to the USB ports to configure the misc registers. After that the driver registers the EHCI driver and an ULPI transceiver if necessary. Currently only host mode is supported, but device support can be added later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>