aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy
Commit message (Collapse)AuthorAge
* ENGR00320439-10 usb: phy: mxs: refine phy shutdownLi Jun2014-06-30
| | | | | | | Complete mxs phy shutdown sequence including disable wakeup and auto bits, power down phy and clock gate. Signed-off-by: Li Jun <b47624@freescale.com>
* ENGR00320439-9 usb: phy: mxs: refine mxs_phy_disconnect_lineLi Jun2014-06-30
| | | | | | | | | For non-otg mode, we keep the usage of disconnect line between phy analog and digital unchanging; for otg mode, at peripheral role, we keep the usage unchanging too, at host role, the digital part needs to know dp/dm change to respond device's data pulse when it is at low power mode. Signed-off-by: Peter Chen <peter.chen@freescale.com>
* usb: common: rename phy-fsm-usb.c to usb-otg-fsm.cPeter Chen2014-06-26
| | | | | | | | | | | Since usb otg fsm implementation is not related to usb phy. We move it from usb/phy/ to usb/common/, and rename it to reflect its real meaning. Cc: Felipe Balbi <balbi@ti.com> Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 8dc0fda6e5246450c688e2d3e09f9834a4323e01)
* ENGR00309701 usb: phy: otg-fsm: export symbol of otg_statemachineLi Jun2014-04-21
| | | | | | | This patch exports symbol of otg_statemachine for kernel module to use it. Signed-off-by: Li Jun <b47624@freescale.com>
* ENGR00307558-13 usb: chipidea: otg-fsm: enable low power mode for otg fsm mode.Li Jun2014-04-16
| | | | | | This patch enables runtime pm support for otg fsm mode. Signed-off-by: Li Jun <b47624@freescale.com>
* usb: phy: fsm: update OTG HNP state transition conditions according to OTG ↵Li Jun2014-04-16
| | | | | | | | | | | | | | and EH 2.0 spec. According to:"On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification July 27, 2012 Revision 2.0 version 1.1a" - From a_host to a_wait_bcon if !b_conn - Add transition from a_host to a_wait_vfall if id state is high or a_bus_drop - From a_wait_vfall to a_idle if a_wait_vfall_tmout Signed-off-by: Li Jun <b47624@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com> (cherry-picked from commit 8bebbe8dc6145303db05964fb09657aac2a7e909)
* usb: phy: Fix double lock in OTG FSMAnton Tikhomirov2014-04-16
| | | | | | | | | Mutex obtained at the beginning of the function should be released at the end to avoid double locking. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com> (cherry-picked from commit 16da4b174b08c42076cd3384c420f352c909d467)
* usb: phy: Add OTG FSM configuration optionAnton Tikhomirov2014-04-16
| | | | | | | | | This patch removes dependency on Freescale USB UTG Transceiver driver and makes OTG FSM implementation selectable. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com> (cherry-picked from commit e1d2e31975e1e3a31ac592d5b1c5cb5d655b3f4e)
* usb: phy: make PHY driver selection possible by controller driversRoger Quadros2014-04-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert PHY Drivers from menuconfig to menu so that the PHY drivers can be explicitely selected by the controller drivers. USB_PHY is no longer a user visible option. It is upto to the PHY drivers to select it if needed. This patch does so for the existing PHY drivers that use the USB_PHY library. Doing so moves the USB_PHY and PHY driver selection problem from the end user to the PHY and controller driver developer. e.g. Earlier, a controller driver (e.g. EHCI_OMAP) that needs to select a PHY driver (e.g. NOP_PHY) couldn't do so because the PHY driver depended on USB_PHY. Making the controller driver depend on USB_PHY has a negative effect i.e. it becomes invisible to the user till USB_PHY is enabled. Most end users will not familiar with this. With this patch, the end user just needs to select the controller driver needed for his/her platform without worrying about which PHY driver to select. Also update USB_EHCI_MSM, USB_LPC32XX and USB_OMAP to not depend on USB_PHY any more. They can safely select the necessary PHY drivers. [ balbi@ti.com : refreshed on top of my next branch. Changed bool followed by default n into def_bool n ] CC: Pavankumar Kondeti <pkondeti@codeaurora.org> Acked-by: Roland Stigge <stigge@antcom.de> Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com> (cherry-picked from commit 052a11d13bdecb77ee4cdbdccfce5434a12209af)
* usb: phy: move OTG FSM headerAnton Tikhomirov2014-04-16
| | | | | | | | | Other USB drivers may want to use OTG final state machine implementation, so make this header available for them. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com> (cherry-picked from commit 5653668c9585441926dd2575791f6b5bb84bb254)
* usb: phy: replace spinlock with mutex in OTG FSMAnton Tikhomirov2014-04-16
| | | | | | | | | | | | | OTG Final State Machine calls functions which may sleep. For example, start_gadget callback implementation can use usb_gadget_vbus_connect(), whose context: can sleep. If so, mutex should be used instead of spinlock. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com> (cherry-picked from commit 16e569e9661ea2b964b8abb607a51e5285254021)
* usb: phy: fsm: protect against multiple inclusionsAnton Tikhomirov2014-04-16
| | | | | | | | | if this header is included twice, we would have redefinition build errors. Fix this. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com> (cherry-picked from commit d49dd788840ff802421ed7412e967b659fe9ca58)
* usb: phy: fsm: don't depend on indirect includesFelipe Balbi2014-04-16
| | | | | | | | | this header uses spinlocks and errno values, so we must include <linux/spinlock.h> and <linux/errno.h> to avoid build errors. Signed-off-by: Felipe Balbi <balbi@ti.com> (cherry-picked from commit cc9d9ccf2a1e8c9f36a436805317180003ba9719)
* usb: phy: Reordering of OTG FSM variablesAnton Tikhomirov2014-04-16
| | | | | | | | | Reorder variables in struct otg_fsm as they appear in OTG and EH supplement to USB2.0. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com> (cherry-picked from commit 4662e5ef54f01ff5333474a825f90ab74f95bc3d)
* usb: phy: Add and use missed OTG FSM inputs/outputsAnton Tikhomirov2014-04-16
| | | | | | | | | | 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 <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com> (cherry-picked from commit ec04996a080d825f8acdf0f8fbb2f3ebd5963cf3)
* usb: phy: Rename "B-device session end SRP" OTG FSM inputAnton Tikhomirov2014-04-16
| | | | | | | | | In accordance with OTG and EH supplement, the correct name of the FSM input is b_ssend_srp. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com> (cherry-picked from commit 68041785d0c69884c4adb3bcab48f92ac3e75629)
* usb: phy: Rename OTG FSM informative variablesAnton Tikhomirov2014-04-16
| | | | | | | | | | 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 <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com> (cherry-picked from commit cff4dab4cb95d394e9fd73f668326dac06e57b10)
* usb: phy: Add and use missed OTG FSM timersAnton Tikhomirov2014-04-16
| | | | | | | | | | 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 <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com> (cherry-picked from commit 3294908bc0f178bfd67971fdb4432f3d4e50921e)
* usb: phy: Fix OTG FSM timer handlingAnton Tikhomirov2014-04-16
| | | | | | | | | Get rid of using OTG driver specific timers by passing timer type to corresponding callbacks. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com> (cherry-picked from commit f6de27eed372f41646b7bd95d6903923f5308517)
* usb: phy: Add and use missed helper functionsAnton Tikhomirov2014-04-16
| | | | | | | | | This patch implements missed helper functions for start_gadget() and start_host() OTG FSM callbacks. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com> (cherry-picked from commit 425d710172cee47ed5e18eefd3308d88643de76d)
* usb: phy: Check OTG FSM callback existance in helper functionsAnton Tikhomirov2014-04-16
| | | | | | | | | Existence of callback must be checked to avoid NULL pointer dereferncing. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com> (cherry-picked from commit 737cc66eac350d674c72a3f903541644098ec47e)
* usb: phy: Pass OTG FSM pointer to callback functionsAnton Tikhomirov2014-04-16
| | | | | | | | | | | 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 <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com> (cherry-picked from commit da8cc16724da2965c94ca15e1377cb9939776dda)
* USB: phy: remove custom DBG macroGreg Kroah-Hartman2014-04-16
| | | | | | | | | | Use the in-kernel pr_debug() calls instead of trying to roll your own DBG macro. This means the dynamic debugging calls now work here, and there is no dependency on CONFIG_USB_DEBUG for the phy code anymore. Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry-picked from commit 523e531ea694eadf2957ee207bb4e0681e837057)
* ENGR00301290-4 usb: phy-mxs: enable imx6sxPeter Chen2014-04-16
| | | | | | Add compatible string, etc. Signed-off-by: Peter Chen <peter.chen@freescale.com>
* ENGR00291282-6 usb: phy-nop: add the implementation of .set_suspendPeter Chen2014-04-16
| | | | | | | | Add clock enable/disable at .set_suspend if the PHY has suspend requirement, it can be benefit of power saving for phy and the whole system (parent clock may also be disabled). Signed-off-by: Peter Chen <peter.chen@freescale.com>
* ENGR00291282-5 usb: phy-nop: defer clock prepare until PHY initPeter Chen2014-04-16
| | | | | | | | | | | It can avoid the problem that the prepare count is non-zero even nop PHY is un-used. In fact, the same operation is already at the lastest mainline code: https://git.kernel.org/cgit/linux/kernel/git/gregkh/usb.git/commit/drivers /usb/phy/phy-generic.c?h=usb-next&id=4d175f340c9c055482688d2205038413dc7b6f1e Signed-off-by: Peter Chen <peter.chen@freescale.com>
* ENGR00291876 usb: phy-mxs: add delay before set phyctrl.clkgatePeter Chen2014-04-16
| | | | | | | | | | There is a request from IC engineer that if we doesn't set phypwd as 0xffffffff, we need to delay about five 32Khz cycles before set phypwd, otherwise, the wakeup signal may can't wake up controller. Signed-off-by: Peter Chen <peter.chen@freescale.com> (cherry picked from commit a7a99b979db9d0bf7277533a3a39ba09755768f0)
* ENGR00288578-8 usb: phy-mxs: do not set PWD.RXPWD1PT1 for low speed connectionPeter Chen2014-04-16
| | | | | | | | At very rare cases, the SoF will not send out after resume with low speed connection. The workaround is do not power down PWD.RXPWD1PT1 bit during the suspend. Signed-off-by: Peter Chen <peter.chen@freescale.com>
* ENGR00288578-7 usb: phy-mxs: add controller idPeter Chen2014-04-16
| | | | | | | Meanwhile, we fix the problem that we only use controller-1's related registers at mxs_phy_disconnect_line. Signed-off-by: Peter Chen <peter.chen@freescale.com>
* ENGR00288578-2 usb: phy-mxs: Add sync time after controller clear phcdPeter Chen2014-04-16
| | | | | | | After clear portsc.phcd, PHY needs 200us time from switch 32K clock to AHB clock. Signed-off-by: Peter Chen <peter.chen@freescale.com>
* usb: phy: phy-mxs-usb: set the correct platform drvdataJisheng Zhang2014-04-16
| | | | | | | | | We need to set mxs_phy rather as the platform drvdata so that we can get the correct mxs_phy in mxs_phy_remove(). Acked-by: Peter Chen <peter.chen@freescale.com> Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
* ENGR00286426-12 usb: phy-mxs: Add system suspend/resume APIPeter Chen2014-04-16
| | | | | | | | | We need this to keep PHY's power on or off during the system suspend mode. If we need to enable USB wakeup, then we must keep PHY's power being on during the system suspend mode. Otherwise, we need to keep PHY's power being off to save power. Signed-off-by: Peter Chen <peter.chen@freescale.com>
* ENGR00286426-11 usb: phy-mxs: Add implementation of set_wakeupPeter Chen2014-04-16
| | | | | | | | | | | When we need the PHY can be waken up by external signals, we can call this API. Besides, we call mxs_phy_disconnect_line at this API to close the connection between USB PHY and controller, after that, the line state from controller is SE0. Once the PHY is out of power, without calling mxs_phy_disconnect_line, there are unknown wakeups due to dp/dm floating at device mode. Signed-off-by: Peter Chen <peter.chen@freescale.com>
* ENGR00286426-9 usb: phy-mxs: Enable IC fixes for related SoCsPeter Chen2014-04-16
| | | | | | | Some PHY bugs are fixed by IC logic, but these bits are not enabled by default, so we enable them at driver. Signed-off-by: Peter Chen <peter.chen@freescale.com>
* ENGR00286426-8 usb: phy-mxs: Add implementation of nofity_suspend{resume}Peter Chen2014-04-16
| | | | | | | Implementation of notify_suspend and notify_resume will be different according to mxs_phy_data->flags. Signed-off-by: Peter Chen <peter.chen@freescale.com>
* ENGR00286426-6 usb: phy-mxs: Add anatop regmapPeter Chen2014-04-16
| | | | | | It is needed by imx6 SoC series, but not for imx23 and imx28. Signed-off-by: Peter Chen <peter.chen@freescale.com>
* ENGR00286426-3 usb: phy-mxs: Add auto clock and power settingPeter Chen2014-04-16
| | | | | | | With the auto setting, the PHY's clock and power can be recovered correctly from low power mode, it is ganranteed by IC logic. Signed-off-by: Peter Chen <peter.chen@freescale.com>
* ENGR00286426-2 usb: phy-mxs: Add platform judgement codePeter Chen2014-04-16
| | | | | | | The mxs-phy has several bugs and features at different versions, the driver code can get it through of_device_id.data. Signed-off-by: Peter Chen <peter.chen@freescale.com>
* usb: phy: phy-mxs-usb: Check the return value from stmp_reset_block()Fabio Estevam2014-04-16
| | | | | | | | | stmp_reset_block() may fail, so let's check its return value and propagate it in the case of error. Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* ENGR00286159-3 Revert "ENGR00278097-1"Peter Chen2014-04-16
| | | | | | | This reverts commit 5748c4f997399584691559332997cfc5177ad232. Signed-off-by: Peter Chen <peter.chen@freescale.com> Acked-by: Shawn Guo <shawn.guo@linaro.org>
* ENGR00278097-1 usb: phy-mxs: Add auto clock and power settingPeter Chen2014-04-16
| | | | | | | | | With the auto setting, the PHY's clock and power can be recovered correctly from low power mode, it is ganranteed by IC logic. Besides, we enable the IC fixes for this PHY at mx6 platform. Signed-off-by: Peter Chen <peter.chen@freescale.com>
* usb: add devicetree helpers for determining dr_mode and phy_typeMichael Grzeschik2014-04-16
| | | | | | | | | | | | | This adds two little devicetree helper functions for determining the dr_mode (host, peripheral, otg) and phy_type (utmi, ulpi,...) from the devicetree. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: phy: fix build breakageAnatolij Gustschin2013-08-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 52d5b9aba1f5790ca3231c262979c2c3e26dd99b upstream. 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 <agust@denx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: phy: Improve Kconfig help for CONFIG_USB_PHYGeorge Spelvin2013-06-18
| | | | | | | | The previous text confused users by not describing the very common (e.g. x86 PC) sitations where no PHY driver is necessary. Signed-off-by: George Spelvin <linux@horizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: remove remaining instances of USB_SUSPENDAlan Stern2013-05-15
| | | | | | | | | | Commit 84ebc10294a3d7be4c66f51070b7aedbaa24de9b (USB: remove CONFIG_USB_SUSPEND option) failed to remove all of the usages of USB_SUSPEND throughout the kernel. This patch (as1677) removes the remaining instances of that symbol. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: otg: mxs-phy: add missing type to usb_phyMichael Grzeschik2013-05-15
| | | | | | | | The mxs-phy is missing the phy.type property, why the usb_get_phy helper function won't be able to find it. This patch adds this missing property. Signed-off-by: Michael Grzeschik <mgr@pengutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: phy: remove CONFIG_USB_OTG_UTILS once morePaul Bolle2013-05-15
| | | | | | | | | | The Kconfig symbol USB_OTG_UTILS was removed in the v3.10 merge window, in commit fd89149875 ("usb: phy: remove CONFIG_USB_OTG_UTILS"). But that symbol popped up again in a few places. Remove it there too. Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: phy: Fix NULL pointer exception during usb_get_phyRobert Jarzmik2013-05-15
| | | | | | | | | | | | | Upon initialisation (driver probe) a NULL pointer exception is triggered. This is due to lack of initialisation of device field in phy structure, which is used by phy framework in usb_get_phy(). Fix it by initialising the device field. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: phy: don't check resource with devm_ioremap_resourceWolfram Sang2013-05-15
| | | | | | | | | devm_ioremap_resource does sanity checks on the given resource. No need to duplicate this in the driver. Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: phy: nop: Remove redundant platform_set_drvdata()Sachin Kamat2013-05-15
| | | | | | | | | Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Felipe Balbi <balbi@ti.com>