| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
| |
This patch exports symbol of otg_statemachine for kernel module
to use it.
Signed-off-by: Li Jun <b47624@freescale.com>
|
|
|
|
|
|
| |
This patch enables runtime pm support for otg fsm mode.
Signed-off-by: Li Jun <b47624@freescale.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
| |
Add compatible string, etc.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
After clear portsc.phcd, PHY needs 200us time from switch
32K clock to AHB clock.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
It is needed by imx6 SoC series, but not for imx23 and imx28.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
This reverts commit 5748c4f997399584691559332997cfc5177ad232.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|