aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/dwc2/platform.c
AgeCommit message (Collapse)AuthorFilesLines
2015-04-29usb: dwc2: add hibernation core parameterGregory Herrero1-0/+2
dwc2 may not be able to exit from hibernation if the hardware does not provide a way to detect resume signalling in this state. Thus, add the possibility to disable hibernation feature. Acked-by: John Youn <[email protected]> Signed-off-by: Gregory Herrero <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2015-04-29usb: dwc2: set parameter values in probe functionMian Yousaf Kaukab1-1/+16
So the parameters can be used in both host and gadget modes. Also consolidate param functions in the core.h Acked-by: John Youn <[email protected]> Signed-off-by: Mian Yousaf Kaukab <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2015-04-29usb: dwc2: add external_id_pin_ctl core parameterGregory Herrero1-0/+2
This is required due to an Intel specific hardware issue. Where id- pin setup causes glitches on the interrupt line when CONIDSTSCHG interrupt is enabled. Specify external_id_pin_ctl when an external driver (for example phy) can handle id change, so that CONIDSTSCHG interrupt can be disabled from the controller. Acked-by: John Youn <[email protected]> Signed-off-by: Gregory Herrero <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2015-04-29usb: dwc2: move debugfs code to a separate fileMian Yousaf Kaukab1-0/+4
Prepare to add more debug code. Moreover, don't save dentry * for each file in struct dwc2_hsotg as clean up is done with debugfs_remove_recursive(). s3c_hsotg_delete_debug() is removed altogether for the same reason. Acked-by: John Youn <[email protected]> Signed-off-by: Mian Yousaf Kaukab <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2015-03-12usb: dwc2: rework initialization of host and gadget in dual-role modeMarek Szyprowski1-8/+21
If device is configured to work only in HOST or DEVICE mode, there is no point in initializing both subdrivers. This patch also fixes resource leakage if host subdriver fails to initialize. Acked-by: John Youn <[email protected]> Signed-off-by: Marek Szyprowski <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2015-01-12usb: dwc2: platform: add generic PHY framework supportYunzhi Li1-2/+34
Get PHY parameters from devicetree and power off usb PHY during system suspend. Acked-by: Paul Zimmerman <[email protected]> Signed-off-by: Yunzhi Li <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2014-11-25usb: dwc2: Fix build warning when CONFIG_PM_SLEEP=nFabio Estevam1-2/+2
Building with bcm2835_defconfig, which has CONFIG_PM_SLEEP=n causes the following build warning: drivers/usb/dwc2/platform.c:227:12: warning: 'dwc2_suspend' defined but not used [-Wunused-function] drivers/usb/dwc2/platform.c:237:12: warning: 'dwc2_resume' defined but not used [-Wunused-function] Annotate these functions with '__maybe_unused' to prevent the warnings. Reported-by: Olof's autobuilder <[email protected]> Signed-off-by: Fabio Estevam <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2014-11-21usb: dwc2: gadget: add mutex to serialize init/deinit callsMarek Szyprowski1-0/+2
This patch adds mutex, which protects initialization and deinitialization procedures against suspend/resume methods. This mutex will be needed by the updated suspend/resume calls, which tracks gadget state. Signed-off-by: Marek Szyprowski <[email protected]> Acked-by: Paul Zimmerman <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2014-11-14usb: dwc2: move usb_disabled() call to host driver onlyDinh Nguyen1-3/+0
Since platform.c will get built for both Host and Gadget, if we leave the usb_disabled() call in platform.c, it results in the following build error when (!USB && USB_GADGET) condition is met. ERROR: "usb_disabled" [drivers/usb/dwc2/dwc2_platform.ko] undefined! Since usb_disabled() is mostly used to disable USB host functionality, move the call the host portion for the DWC2 driver. Acked-by: Paul Zimmerman <[email protected]> Signed-off-by: Dinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2014-11-14usb: dwc2: Update common interrupt handler to call gadget interrupt handlerDinh Nguyen1-0/+8
Make dwc2_handle_common_intr call the gadget interrupt function when operating in peripheral mode. Remove the spinlock functions in s3c_hsotg_irq as dwc2_handle_common_intr() already has the spinlocks. Move the registeration of the IRQ to common code for platform and PCI. Remove duplicate interrupt conditions that was in gadget, as those are handled by dwc2 common interrupt handler. Acked-by: Paul Zimmerman <[email protected]> Signed-off-by: Dinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2014-11-14usb: dwc2: convert to use dev_pm_ops APIDinh Nguyen1-6/+9
Update suspend/resume to use dev_pm_ops API. Acked-by: Paul Zimmerman <[email protected]> Signed-off-by: Dinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2014-11-14usb: dwc2: Move gadget probe function into platform codeDinh Nguyen1-0/+28
This patch will aggregate the probing of gadget/hcd driver into platform.c. The gadget probe funtion is converted into gadget_init that is now only responsible for gadget only initialization. All the gadget resources are now handled by platform.c Since the host workqueue will not get initialized if the driver is configured for peripheral mode only. Thus we need to check for wq_otg before calling queue_work(). Also, we move spin_lock_init to common location for both host and gadget that is either in platform.c or pci.c. We also move suspend/resume code to common platform code. Lastly, move the "samsung,s3c6400-hsotg" binding into dwc2_of_match_table. Signed-off-by: Dinh Nguyen <[email protected]> Acked-by: Paul Zimmerman <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2014-09-11Revert "usb: dwc2: move "samsung,s3c6400-hsotg" into common platform"Robert Baldyga1-1/+0
This reverts commit 8df438571cdbd5c4fcd1b25b19eea1ad5c3cf777. This patch breaks building dwc2 driver in gadget mode at samsung platforms. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-09-08usb: dwc2: move "samsung,s3c6400-hsotg" into common platformDinh Nguyen1-0/+1
Move the "samsung,s3c6400-hsotg" binding as the probe function in the gadget driver will get removed when the dual-role driver is implemented. Signed-off-by: Dinh Nguyen <[email protected]> Acked-by: Paul Zimmerman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-09-08usb: dwc2: add 'mode' which based on Kconfig select or dts settingKever Yang1-0/+4
According to the "dr_mode", the otg controller can work as device role and host role. Some boards always want to use host mode and some other boards want to use gadget mode. We use the dts setting to set dwc2's mode, rather than fixing it to whatever hardware says. Signed-off-by: Kever Yang <[email protected]> Acked-by: Paul Zimmerman <[email protected]> Tested-by: Doug Anderson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-09-08usb: dwc2: add compatible data for rockchip socKever Yang1-0/+29
This patch add compatible data for dwc2 controller found on rk3066, rk3188 and rk3288 processors from rockchip. Signed-off-by: Kever Yang <[email protected]> Acked-by: Paul Zimmerman <[email protected]> Reviewed-by: Doug Anderson <[email protected]> Tested-by: Doug Anderson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-05-27usb: dwc2: Disable descriptor dma mode by defaultDinh Nguyen1-0/+6
Even though the IP supports Descriptor DMA mode, it does not support SPLIT transactions in this mode. So the driver, in its currently form, will not support LS/FS devices when connected to a HS Hub if Descriptor DMA mode is enabled. So we should just default to disable descriptor dma mode. Signed-off-by: Dinh Nguyen <[email protected]> Acked-by: Paul Zimmerman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-02-04usb: dwc2: bail out early when booting with "nousb"Andre Heider1-0/+3
Add usb_disabled() check to prevent kernel oops when booting with "nousb" in the cmdline: Unable to handle kernel NULL pointer dereference at virtual address 00000030 ... PC is at bus_add_device+0xe0/0x18c LR is at device_add_groups+0x1c/0x20 ... [<c02191c0>] (bus_add_device) from [<c0217130>] (device_add+0x41c/0x538) [<c0217130>] (device_add) from [<c023b1d4>] (usb_new_device+0x270/0x35c) [<c023b1d4>] (usb_new_device) from [<c0241174>] (usb_add_hcd+0x4fc/0x760) [<c0241174>] (usb_add_hcd) from [<c0254ce0>] (dwc2_hcd_init+0x434/0x510) [<c0254ce0>] (dwc2_hcd_init) from [<c02594f4>] (dwc2_driver_probe+0x130/0x170) [<c02594f4>] (dwc2_driver_probe) from [<c021bbd0>] (platform_drv_probe+0x28/0x58) Signed-off-by: Andre Heider <[email protected]> Acked-by: Paul Zimmerman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-01-13Move DWC2 driver out of stagingPaul Zimmerman1-0/+187
The DWC2 driver should now be in good enough shape to move out of staging. I have stress tested it overnight on RPI running mass storage and Ethernet transfers in parallel, and for several days on our proprietary PCI-based platform. Signed-off-by: Paul Zimmerman <[email protected]> Cc: Felipe Balbi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>