aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/phy
AgeCommit message (Collapse)AuthorFilesLines
2013-10-29USB: phy: samsung: Support multiple PHYs of same typeAnton Tikhomirov2-2/+4
This patch removes limitation when only one PHY of specific type could be used. Signed-off-by: Anton Tikhomirov <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-24Merge tag 'usb-for-v3.13' of ↵Greg Kroah-Hartman14-155/+666
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next Felipe writes: usb: patches for v3.13 Final conversions to configfs for mass storage, acm_ms, and multi gadgets. MUSB should now work out of the box on AM335x-based boards (beagle bone white and black) with DMA thanks to Sebastian's work. We can now enable VERBOSE_DEBUG on builds of drivers/usb/gadget/ by selecting CONFIG_USB_GADGET_VERBOSE. s3c-hsotg got quite a few non-critical fixes but also learned a few new tricks (isochronous transfers, multi count support). The Marvel USB3 Controller driver got a memory leak fix. devm_usb_get_phy() learned not to return NULL, ever. Other than these patches, we have the usual set of cleanups ranging from removal of unnecessary *_set_drvdata() to using SIMPLE_DEV_PM_OPS. Signed-of-by: Felipe Balbi <[email protected]>
2013-10-17usb: phy: twl6030-usb: Include linux/of.h headerSachin Kamat1-0/+1
'of_match_ptr' is defined in linux/of.h. Include it explicitly to avoid build breakage in the future. Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-11usb: Remove unnecessary semicolonsJoe Perches1-1/+1
These aren't necessary after switch and if blocks. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-11usb: phy: don't return with NULL from devm_usb_get_phy()Gabor Juhos1-1/+1
The callers are expecting an ERR_PTR value in case of an error. Change he code to return with an encoded -ENOMEM value in the case of a failed devres_alloc call. Signed-off-by: Gabor Juhos <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-10usb: phy: Add RCAR Gen2 USB phyValentine Barshak3-0/+262
This adds RCAR Gen2 USB phy support. The driver configures USB channels 0/2 which are shared between PCI USB hosts and USBHS/USBSS devices. It also controls internal USBHS phy. Signed-off-by: Valentine Barshak <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-06Merge 3.12-rc4 into usb-nextGreg Kroah-Hartman1-6/+5
We want the USB fixes in this branch as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-04usb: phy: Reordering of OTG FSM variablesAnton Tikhomirov1-22/+24
Reorder variables in struct otg_fsm as they appear in OTG and EH supplement to USB2.0. Signed-off-by: Anton Tikhomirov <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-04usb: phy: Add and use missed OTG FSM inputs/outputsAnton Tikhomirov2-4/+50
Several input/output variables missed in current FSM implementation. This patch adds and makes use of them as specified in OTG and EH supplement to USB2.0. Signed-off-by: Anton Tikhomirov <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-04usb: phy: Rename "B-device session end SRP" OTG FSM inputAnton Tikhomirov3-4/+4
In accordance with OTG and EH supplement, the correct name of the FSM input is b_ssend_srp. Signed-off-by: Anton Tikhomirov <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-04usb: phy: Rename OTG FSM informative variablesAnton Tikhomirov3-9/+13
Mark informative variables with suffix '_inf' to distinguish them from other non-informative variables with the same name. If such non-informative varialbes were missed, they are created. Signed-off-by: Anton Tikhomirov <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-04usb: phy: Add and use missed OTG FSM timersAnton Tikhomirov2-3/+17
a_bidl_adis_tmr and a_wait_vfall_tmr OTG timers missed in current FSM implementation. This patch adds and makes use of the timers as speicfied in OTG and EH supplement to USB2.0. Signed-off-by: Anton Tikhomirov <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-04usb: phy: Fix OTG FSM timer handlingAnton Tikhomirov3-25/+87
Get rid of using OTG driver specific timers by passing timer type to corresponding callbacks. Signed-off-by: Anton Tikhomirov <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-04usb: phy: Add and use missed helper functionsAnton Tikhomirov2-4/+18
This patch implements missed helper functions for start_gadget() and start_host() OTG FSM callbacks. Signed-off-by: Anton Tikhomirov <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-04usb: phy: Check OTG FSM callback existance in helper functionsAnton Tikhomirov1-7/+28
Existence of callback must be checked to avoid NULL pointer dereferncing. Signed-off-by: Anton Tikhomirov <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-04usb: phy: Pass OTG FSM pointer to callback functionsAnton Tikhomirov3-31/+31
struct otg_fsm may be embedded to device's context structure. The callbacks may require pointer to struct otg_fsm to obtain necessary data for its operation (example: regulator reference for drv_vbus()). Signed-off-by: Anton Tikhomirov <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-04usb: phy: generic: Don't use regulator framework for RESET lineRoger Quadros3-32/+60
Modelling the RESET line as a regulator supply wasn't a good idea as it kind of abuses the regulator framework and also makes adaptation code more complex. Instead, manage the RESET gpio line directly in the driver. Update the device tree binding information. This also makes us easy to migrate to a dedicated GPIO RESET controller whenever it becomes available. Signed-off-by: Roger Quadros <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-03usb: phy: omap: get rid of omap_get_control_dev()Roger Quadros1-21/+10
This function was preventing us from supporting multiple instances. Get rid of it. Since we support DT boots only, users can get the control device phandle from the DT node. Signed-off-by: Roger Quadros <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-03usb: phy: omap-usb3: Don't use omap_get_control_dev()Roger Quadros1-6/+20
omap_get_control_dev() is being deprecated as it doesn't support multiple instances. As control device is present only from OMAP4 onwards which supports DT only, we use phandles to get the reference to the control device. As we don't support non-DT boot, we just bail out on probe if device node is not present. Signed-off-by: Roger Quadros <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-03usb: phy: omap: Add new device types and remove omap_control_usb3_phy_power()Roger Quadros2-76/+103
Add support for new device types and in the process rid of "ti,type" device tree property. The correct type of device will be determined from the compatible string instead. Introduce a compatible string for each device type. At the moment we support 4 types OTGHS, USB2, PIPE3 (e.g. USB3) and DRA7USB2. Update DT binding information to reflect these changes. Also get rid of omap_control_usb3_phy_power(). Just one function i.e. omap_control_usb_phy_power() will now take care of all PHY types. Signed-off-by: Roger Quadros <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-03usb: phy: omap-control: Get rid of platform dataRoger Quadros1-9/+3
omap-control device is present from OMAP4 onwards which support device tree boots only. So get rid of platform data. Signed-off-by: Roger Quadros <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-01usb: phy: tegra-usb: Remove redundant of_match_ptrSachin Kamat1-1/+1
The data structure of_match_ptr() protects is always compiled in. Hence of_match_ptr() is not needed. Signed-off-by: Sachin Kamat <[email protected]> Cc: Stephen Warren <[email protected]> Cc: [email protected] Signed-off-by: Felipe Balbi <[email protected]>
2013-10-01usb: phy: am335x: Remove redundant of_match_ptrSachin Kamat1-1/+1
The data structure of_match_ptr() protects is always compiled in. Hence of_match_ptr() is not needed. Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-01usb: phy: am335x-control: Remove redundant of_match_ptrSachin Kamat1-1/+1
The data structure of_match_ptr() protects is always compiled in. Hence of_match_ptr() is not needed. Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-01usb: musb: Add missing ATOMIC_INIT_NOTIFIER_HEADPali Rohár1-0/+2
&twl->phy.notifier is not initalized Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-01usb: phy: am335x: add wakeup supportSebastian Andrzej Siewior2-0/+77
This is based on George Cherian's patch which added power & wakeup support to am335x and does no longer apply since I took some if the code apart in favor of the multi instance support. This compiles and I boots and later it detects a device after I plug it in :) Could somebody please test it so it does what it should? Cc: George Cherian <[email protected]> Reviewed-by: Roger Quadros <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-01usb: phy: nop: Defer clock prepare until PHY initMark Brown3-25/+5
Since we only enable the PHY clock on init and the PHY init and shutdown does not occur in atomitc context there is no need to prepare the clock before it is enabled. Move the clk_prepare() operations to go along with the enables, allowing the clock to be fully idle when not in use. Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-09-27usb: phy: twl4030: use the new generic PHY frameworkKishon Vijay Abraham I3-805/+0
Used the generic PHY framework API to create the PHY. For powering on and powering off the PHY, power_on and power_off ops are used. Once the MUSB OMAP glue is adapted to the new framework, the suspend and resume ops of usb phy library will be removed. Also twl4030-usb driver is moved to drivers/phy/. However using the old usb phy library cannot be completely removed because otg is intertwined with phy and moving to the new framework completely will break otg. Once we have a separate otg state machine, we can get rid of the usb phy library. Signed-off-by: Kishon Vijay Abraham I <[email protected]> Acked-by: Felipe Balbi <[email protected]> Reviewed-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-27usb: phy: omap-usb2: use the new generic PHY frameworkKishon Vijay Abraham I3-284/+0
Used the generic PHY framework API to create the PHY. Now the power off and power on are done in omap_usb_power_off and omap_usb_power_on respectively. The omap-usb2 driver is also moved to driver/phy. However using the old USB PHY library cannot be completely removed because OTG is intertwined with PHY and moving to the new framework will break OTG. Once we have a separate OTG state machine, we can get rid of the USB PHY library. Signed-off-by: Kishon Vijay Abraham I <[email protected]> Reviewed-by: Sylwester Nawrocki <[email protected]> Acked-by: Felipe Balbi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-26USB: phy: Restrict AM335x PHY driver to only be built on !ARM when ↵Dave Jones1-0/+1
COMPILE_TEST is set. Signed-off-by: Dave Jones <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-23usb: phy: gpio-vbus: fix deferred probe from __initJohan Hovold1-6/+5
Move probe out of __init section and don't use platform_driver_probe which cannot be used with deferred probing. Since commit e9354576 ("gpiolib: Defer failed gpio requests by default") and 04bf3011 ("regulator: Support driver probe deferral") this driver might return -EPROBE_DEFER if a gpio_request or regulator_get fails. Cc: Felipe Balbi <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-09-17usb: phy: omap-usb3: Fix return valueSachin Kamat1-1/+1
The function returns a pointer. Hence return NULL instead of 0. Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-30usb: phy-tegra-usb: use platform_{get,set}_drvdata()Libo Chen1-1/+1
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with &of->dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-27usb: phy: signedness bugs in suspend/resume functionsDan Carpenter1-4/+3
"ret" needs to be signed for the error handling to work. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-27usb: phy: fix build breakageAnatolij Gustschin2-2/+2
Commit 94ae9843 (usb: phy: rename all phy drivers to phy-$name-usb.c) renamed drivers/usb/phy/otg_fsm.h to drivers/usb/phy/phy-fsm-usb.h but changed drivers/usb/phy/phy-fsm-usb.c to include not existing "phy-otg-fsm.h" instead of new "phy-fsm-usb.h". This breaks building: ... drivers/usb/phy/phy-fsm-usb.c:32:25: fatal error: phy-otg-fsm.h: No such file or directory compilation terminated. make[3]: *** [drivers/usb/phy/phy-fsm-usb.o] Error 1 This commit also missed to modify drivers/usb/phy/phy-fsl-usb.h to include new "phy-fsm-usb.h" instead of "otg_fsm.h" resulting in another build breakage: ... In file included from drivers/usb/phy/phy-fsl-usb.c:46:0: drivers/usb/phy/phy-fsl-usb.h:18:21: fatal error: otg_fsm.h: No such file or directory compilation terminated. make[3]: *** [drivers/usb/phy/phy-fsl-usb.o] Error 1 Fix both issues. Signed-off-by: Anatolij Gustschin <[email protected]> Cc: [email protected] Signed-off-by: Felipe Balbi <[email protected]>
2013-08-27usb: phy: am335x-control: make it compile withSebastian Andrzej Siewior1-2/+2
Randy reported this |drivers/usb/phy/phy-am335x-control.c:45:3: error: implicit declaration |of function '__WARN' [-Werror=implicit-function-declaration] and left it as an excercice to figure out that this happens only with CONFIG_BUG=n. As a fix I replace it with WARN_ON(). And there is a space before return so fix this, too. Reported-by: Randy Dunlap <[email protected]> Acked-by: Randy Dunlap <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-13Merge tag 'usb-for-v3.12' of ↵Greg Kroah-Hartman21-307/+799
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next Felipe writes: usb: patches for v3.12 merge window All patches here have been pending on linux-usb and sitting in linux-next for a while now. The biggest things in this tag are: DWC3 learned proper usage of threaded IRQ handlers and now we spend very little time in hardirq context. MUSB now has proper support for BeagleBone and Beaglebone Black. Tegra's USB support also got quite a bit of love and is learning to use PHY layer and generic DT attributes. Other than that, the usual pack of cleanups and non-critical fixes follow. Signed-of-by: Felipe Balbi <[email protected]> Conflicts: drivers/usb/gadget/udc-core.c drivers/usb/host/ehci-tegra.c drivers/usb/musb/omap2430.c drivers/usb/musb/tusb6010.c
2013-08-13usb: phy: am335x: include linux/err.hSebastian Andrzej Siewior1-0/+1
Stephen Rothwell reported that this driver does not compile on PowerPC due to this missing include. One could argue why this driver is enabled on PowerPC in the first place but it sure isn't wrong to include headers for used function instead of to rely that they sneak in. Reported-by: Stephen Rothwell <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-12usb: phy: tegra: Program new PHY parametersTuomas Tynkkynen1-18/+63
The Tegra30 TRM recommends configuration of certain PHY parameters for optimal quality. Program the following registers based on device tree parameters: - UTMIP_XCVR_HSSLEW: HS slew rate control. - UTMIP_HSSQUELCH_LEVEL: HS squelch detector level - UTMIP_HSDISCON_LEVEL: HS disconnect detector level. These registers exist in Tegra20, but programming them hasn't been necessary, so these parameters won't be set on Tegra20 to keep the device trees backward compatible. Additionally, the UTMIP_XCVR_SETUP parameter can be set from fuses instead of a software-programmed value, as the optimal value can vary between invidual boards. The boolean property nvidia,xcvr-setup-use-fuses can be used to enable this behaviour. Signed-off-by: Tuomas Tynkkynen <[email protected]> Tested-by: Stephen Warren <[email protected]> Reviewed-by: Stephen Warren <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-12usb: phy: tegra: Tegra30 supportTuomas Tynkkynen1-28/+93
The Tegra30 USB PHY is a bit different than the Tegra20 PHY: - The EHCI controller supports the HOSTPC register extension, and some of the fields that the PHY needs to modify (PHCD and PTS) have moved to the new HOSTPC register. - Some of the UTMI PLL configuration registers have moved from the USB register space to the Clock-And-Reset controller space. In Tegra30 the clock driver is responsible for configuring the UTMI PLL. - The USBMODE register must be explicitly written to enter host mode. - Certain PHY parameters need to be programmed for optimal signal quality. Support for this will be added in the next patch. The new tegra_phy_soc_config structure is added to describe the differences between the SoCs. Signed-off-by: Tuomas Tynkkynen <[email protected]> Tested-by: Stephen Warren <[email protected]> Reviewed-by: Stephen Warren <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-12usb: phy: tegra: Fix wrong PHY parametersTuomas Tynkkynen1-6/+14
Some of the PHY parameters are not set according to the TRMs: - UTMIP_FS_PREABMLE_J should be set, not cleared - UTMIP_XCVR_LSBIAS_SEL should be cleared, not set - UTMIP_PD_CHRG should be set in host mode and cleared in device mode - UTMIP_XCVR_SETUP is a two-part field; the upper bits were not set properly Signed-off-by: Tuomas Tynkkynen <[email protected]> Tested-by: Stephen Warren <[email protected]> Reviewed-by: Stephen Warren <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-09usb: phy: Add AM335x PHY driverSebastian Andrzej Siewior5-0/+270
This driver is a redo of my earlier attempt. It uses parts of the generic PHY driver and uses the new control driver for the register the phy needs to power on/off the phy. It also enables easy access for the wakeup register which is not yet implemented. The difference between the omap attempt is: - no static holding variable - one global visible function which exports a struct with callbacks to access the "control" registers. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-09usb: phy: phy-generic: export init functionsSebastian Andrzej Siewior2-58/+94
This patch exports the mostly generic functions so they can be used from other phy driver instead of duplicating the code. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-09Merge branch 'nop-phy-rename' into nextFelipe Balbi2-23/+23
Signed-off-by: Felipe Balbi <[email protected]> Conflicts: drivers/usb/phy/phy-generic.c
2013-08-09usb: phy: rename nop_usb_xceiv => usb_phy_gen_xceivSebastian Andrzej Siewior2-23/+23
The "nop" driver isn't a do-nothing-stub but supports a couple functions like clock on/off or is able to use a voltage regulator. This patch simply renames the driver to "generic" since it is easy possible to extend it by a simple function istead of writing a complete driver. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-09usb: phy: mv-usb: remove incorrect __exit_p annotationJingoo Han1-2/+2
When platform_driver_probe() is not used, bind/unbind via sysfs is enabled. Thus, __exit_p annotation should be removed from remove(). Also, mv_otg_remove() is staticized, because this function is used only in this file. Fix the following sparse warning: drivers/usb/phy/phy-mv-usb.c:656:5: warning: symbol 'mv_otg_remove' was not declared. Should it be static? Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-09usb: phy: mv-u3d: Staticize mv_u3d_phy_shutdown()Jingoo Han1-1/+1
mv_u3d_phy_shutdown() is used only in this file. Fix the following sparse warning: drivers/usb/phy/phy-mv-u3d-usb.c:85:6: warning: symbol 'mv_u3d_phy_shutdown' was not declared. Should it be static? Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-07-30usb: phy: use dev_get_platdata()Jingoo Han12-20/+22
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-07-29Merge 3.11-rc3 into usb-nextGreg Kroah-Hartman2-2/+2
2013-07-29usb: phy: tegra: Use switch instead of if-elseTuomas Tynkkynen1-3/+8
Use switch() instead of if-else when checking for the PHY type. Signed-off-by: Tuomas Tynkkynen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>