summaryrefslogtreecommitdiffstats
path: root/drivers/phy
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'phy-for-4.10' of ↵Greg Kroah-Hartman2016-11-2821-921/+1024
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy into usb-next Kishon writes: phy: for 4.10 Merge contains: *) Add new usb2 phy driver for Meson8b and GXBB *) Remove phy drivers added for miphy365 and STiH415/6 (as support for these SoCs are removed from the kernel) *) Add a sysfs entry to facilitate usb role swap in rcar SoC *) Add support for otg port in rk3399 *) misc fixes in various phy drivers and cleanups Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
| * phy: rockchip-inno-usb2: select USB_COMMONArnd Bergmann2016-11-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When USB is disabled, we get a link error for this driver because of the added OTG support drivers/phy/phy-rockchip-inno-usb2.o: In function `rockchip_usb2phy_otg_sm_work': phy-rockchip-inno-usb2.c:(.text.rockchip_usb2phy_otg_sm_work+0x1f4): undefined reference to `usb_otg_state_string' drivers/phy/phy-rockchip-inno-usb2.o: In function `rockchip_usb2phy_probe': phy-rockchip-inno-usb2.c:(.text.rockchip_usb2phy_probe+0x2c8): undefined reference to `of_usb_get_dr_mode_by_phy' Other phy drivers select USB_COMMON for this, so let's do the same here. Fixes: 0c42fe48fd23 ("phy: rockchip-inno-usb2: support otg-port for rk3399") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
| * phy: rockchip-inno-usb2: fix uninitialized tmout variableArnd Bergmann2016-11-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The newly added OTG support has an obvious uninitialized variable access that gcc warns about: drivers/phy/phy-rockchip-inno-usb2.c: In function 'rockchip_chg_detect_work': drivers/phy/phy-rockchip-inno-usb2.c:717:7: error: 'tmout' may be used uninitialized in this function [-Werror=maybe-uninitialized] This replaces the use of the uninitialized variable with what the value was in the previous USB_CHG_STATE_WAIT_FOR_DCD state. Fixes: 0c42fe48fd23 ("phy: rockchip-inno-usb2: support otg-port for rk3399") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
| * phy: phy-twl4030-usb: emit VBUS status events to userspaceMatt Ranostay2016-11-181-0/+3
| | | | | | | | | | | | | | | | | | Emit KOBJ_ONLINE/KOBJ_OFFLINE action uevent on VBUS status changes. Cc: Tony Lindgren <tony@atomide.com> Signed-off-by: Matt Ranostay <matt@ranostay.consulting> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
| * phy_sun4i_usb: set_mode: Allow using set_mode to force end the current sessionHans de Goede2016-11-181-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sunxi musb has a bug where sometimes it will generate a babble error on device disconnect instead of a disconnect irq. When this happens the musb-controller switches from host mode to device mode (it clears MUSB_DEVCTL_SESSION and sets MUSB_DEVCTL_BDEVICE) and gets stuck in this state. Clearing this requires reporting Vbus low for 200 or more ms, but on some devices Vbus is simply always high (host-only mode, no Vbus control). This commit modifies sun4i_usb_phy_set_mode so that it will force end the current session when called with the current mode, before this commit calling set_mode with the current mode was a nop since id_det would stay the same resulting in the detect_work not doing anything. This allows the sunxi-musb glue to use sun4i_usb_phy_set_mode to force end the current session without changing the mode, to fixup the stuck state after a babble error. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
| * phy: fix returnvar.cocci warningsVivek Gautam2016-11-182-4/+2
| | | | | | | | | | | | | | | | | | | | Remove unneeded variables when "0" can be returned. Generated by: scripts/coccinelle/misc/returnvar.cocci Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org> Cc: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
| * phy: Fix ptr_ret.cocci warningsVivek Gautam2016-11-182-16/+4
| | | | | | | | | | | | | | | | | | | | Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR. Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org> Cc: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
| * phy: fix semicolon.cocci warningsVivek Gautam2016-11-186-11/+11
| | | | | | | | | | | | | | | | | | | | Remove unneeded semicolon. Generated by: coccinellery/semicolon/semicolon.cocci Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org> Cc: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
| * phy: exynos-mipi-video: simplify check for coupled phy statusMarek Szyprowski2016-11-181-14/+1
| | | | | | | | | | | | | | | | | | | | | | There is no need to access regmap of coupled phy to check its state - such information is already in the phy device itself, so use it directly. This let us to avoid possible access to registers of the device in the disabled power domain if the coupled phy is already disabled. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
| * phy: rcar-gen3-usb2: add sysfs for usb role swapYoshihiro Shimoda2016-11-181-1/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds sysfs "role" for usb role swap. This parameter can be read and write. If you use this file as the following, you can swap the usb role. For example: 1) Connect a usb cable using 2 Salvator-x boards 2) On A-Device (ID pin is low), you input the following command: # echo peripheral > /sys/devices/platform/soc/ee080200.usb-phy/role 3) On B-Device (ID pin is high), you input the following command: # echo host > /sys/devices/platform/soc/ee080200.usb-phy/role Then, the A-device acts as a peripheral and the B-device acts as a host. Please note that A-Device must input the following command if you want the board to act as a host again. (even if you disconnect the usb cable, since id state may be the same, the A-Device keeps to act as peripheral.) # echo host > /sys/devices/platform/soc/ee080200.usb-phy/role Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
| * phy: da8xx-usb: Configure CFGCHIP2 to support OTG workaroundAlexandre Bailon2016-11-181-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If we configure the da8xx OTG phy in OTG mode, neither device or host mode will work. That is because the PHY is not able to detect and notify the driver that value of ID pin changed. To work despite this hardware limitation, the da8xx glue implement a workaround. But to work, the workaround require the VBUS sense and the session end comparator to enabled. Enable them if the phy is configured in OTG mode. Signed-off-by: Alexandre Bailon <abailon@baylibre.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
| * phy: stih41x-usb: Remove usb phy driver and dt bindingPeter Griffin2016-11-183-197/+0
| | | | | | | | | | | | | | | | | | | | | | documentation. This phy is only used on STiH415/6 based silicon, and support for these SoC's is being removed from the kernel. Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
| * phy: phy-miphy365x: Remove miphy365 driver and dt bindingPeter Griffin2016-11-183-636/+0
| | | | | | | | | | | | | | | | | | | | | | documentation. This phy is only used on STiH415/6 based silicon, and support for these SoC's is being removed from the kernel. Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
| * phy: rockchip-inno-usb2: correct 480MHz output clock stable timeWilliam Wu2016-11-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We found that the system crashed due to 480MHz output clock of USB2 PHY was unstable after clock had been enabled by gpu module. Theoretically, 1 millisecond is a critical value for 480MHz output clock stable time, so we try to change the delay time to 1.2 millisecond to avoid this issue. And the commit ed907fb1d7c3 ("phy: rockchip-inno-usb2: correct clk_ops callback") used prepare callbacks instead of enable callbacks to support gate a clk if the operation may sleep. So we can switch from delay to sleep functions. Also fix a spelling error from "waitting" to "waiting". Signed-off-by: William Wu <wulf@rock-chips.com> Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
| * phy: rockchip-inno-usb2: correct clk_ops callbackWilliam Wu2016-11-181-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we needs to delay ~1ms to wait for 480MHz output clock of USB2 PHY to become stable after turn on it, the delay time is pretty long for something that's supposed to be "atomic" like a clk_enable(). Consider that clk_enable() will disable interrupt and that a 1ms interrupt latency is not sensible. The 480MHz output clock should be handled in prepare callbacks which support gate a clk if the operation may sleep. Signed-off-by: William Wu <wulf@rock-chips.com> Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
| * phy: rockchip-inno-usb2: support otg-port for rk3399William Wu2016-11-181-30/+561
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rk3399 SoC USB2 PHY is comprised of one Host port and one OTG port. And OTG port is for USB2.0 part of USB3.0 OTG controller, as a part to construct a fully feature Type-C subsystem. With this patch, we can support OTG port with the following functions: - Support BC1.2 charger detect, and use extcon notifier to send USB charger types to power driver. - Support PHY suspend for power management. - Support OTG Host only mode. Signed-off-by: William Wu <wulf@rock-chips.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
| * phy: meson8b-usb2: request a shared reset lineMartin Blumenstingl2016-11-181-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Both PHYs are sharing one reset line. With recent improvements to the reset framework we can now also use reset_control_reset with shared resets. This allows us to drop some workarounds where the reset was only specified for one PHY but not the other, to make sure that the reset it only executed once (as the reset framework was not able to use reset_control_reset with shared reset lines). Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
| * phy: meson8b-usb2: fix missing clk_disable_unprepare() on errorWei Yongjun2016-11-181-0/+3
| | | | | | | | | | | | | | | | Fix the missing clk_disable_unprepare() before return from phy_meson8b_usb2_power_on() in the error handling case. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
| * phy: meson: add USB2 PHY support for Meson8b and GXBBMartin Blumenstingl2016-11-183-0/+298
| | | | | | | | | | | | | | | | | | This is a new driver for the USB PHY found in Meson8b and GXBB SoCs. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Tested-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* | phy: twl4030-usb: Fix for musb session bit based PMTony Lindgren2016-11-171-2/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | Now with musb driver implementing generic session bit based PM, we need to have the USB PHYs behaving in a sane way for platforms implementing PM. Currently twl4030-usb enables PM in twl4030_phy_power_on() and then disables it in twl4030_phy_power_off(). This will block PM runtime for the SoC when no cable is connected. Fix the issue by moving PM runtime autosuspend call to happen where it gets called in twl4030_phy_power_on(). Note that this patch should not be backported to anything before commit 467d5c980709 ("usb: musb: Implement session bit based runtime PM for musb-core") as before that all the glue layers implemented their own PM. Fixes: 467d5c980709 ("usb: musb: Implement session bit based runtime PM for musb-core") Tested-by: Ladislav Michl <ladis@linux-mips.org> Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Acked-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Bin Liu <b-liu@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* phy: sun4i: check PMU presence when poking unknown bit of pmuIcenowy Zheng2016-11-051-1/+1
| | | | | | | | | | | | | | | Allwinner SoC's PHY 0, when used as OTG controller, have no pmu part. The code that poke some unknown bit of PMU for H3/A64 didn't check the PHY, and will cause kernel oops when PHY 0 is used. This patch will check whether the pmu is not NULL before poking. Fixes: b3e0d141ca9f (phy: sun4i: add support for A64 usb phy) Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy-rockchip-pcie: remove deassert of phy_rst from exit callbackShawn Lin2016-11-051-12/+1
| | | | | | | | | | | | The deassert of phy_rst from exit callback is incorrect as when doing phy_exit, we expect the phy_rst is on asserted state which was done by power_off callback, but not deasserted state. Meanwhile when disabling clk_pciephy_ref, the assert/deassert signal can't actually take effect on the phy. So let's fix it anyway. Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Reviewed-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: da8xx-usb: rename the ohci device to ohci-da8xxAxel Haslam2016-11-051-2/+3
| | | | | | | | The ohci device name has changed in the board configuraion files, hence, change the phy lookup table to match the new name. Signed-off-by: Axel Haslam <ahaslam@baylibre.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy-twl4030-usb: initialize charging-related stuff via pm_runtimeAndreas Kemnade2016-09-141-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | twl4030_phy_power_on() initializes some bits which are required for charging. As they are not set in twl4030_usb_runtime_resume() a call to pm_runtime_get_sync() is not sufficient to enable charging. This patch moves the initialization to twl4030_usb_runtime_resume() so everything needed for charging is initialized upon pm_runtime_get_sync(). That also gives improved possibilities to debug problems in that area because the relevant parts can be checked separately. Charging can be enabled without having the musb subsystem active. As a side effect this hides some bugs in musb which causes unbalanced calls to phy_power_off()/phy_power_on() so that phy->power_count becomes -1. The result is that e.g. the GTA04 phone (dm3730 + twl4030) works finally as a usb gadget again and charging is working. Signed-off-by: Andreas Kemnade <andreas@kemnade.info> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy-twl4030-usb: better handle musb_mailbox() failureAndreas Kemnade2016-09-141-2/+7
| | | | | | | | | | | | | | | | | | | setting twl->linkstat = MUSB_UNKNOWN upon error in musb_mailbox as introduced in commit 12b7db2bf8b8 ("usb: musb: Return error value from musb_mailbox") causes twl4030_usb_irq() to not detect a state change form cable connected to cable disconnected after such an error so that pm_runtime_put_autosuspend() will not be called and the usage counter gets unbalanced. Such errors happen e.g. if the omap2430 module is not (yet) loaded during plug/unplug events. This patch introduces a flag instead that indicates whether there is information for the musb_mailbox pending and calls musb_mailbox() if that flag is set. Signed-off-by: Andreas Kemnade <andreas@kemnade.info> Tested-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: sun4i-usb: Use spinlock to guard phyctl register accessChen-Yu Tsai2016-09-101-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The musb driver calls into this phy driver to disable/enable squelch detection. This function was introduced in 24fe86a617c5 ("phy: sun4i-usb: Add a sunxi specific function for setting squelch-detect"). This function in turn calls sun4i_usb_phy_write, which uses a mutex to guard the common access register. Unfortunately musb does this in atomic context, which results in the following warning with lock debugging enabled: BUG: sleeping function called from invalid context at kernel/locking/mutex.c:97 in_atomic(): 1, irqs_disabled(): 128, pid: 96, name: kworker/0:2 CPU: 0 PID: 96 Comm: kworker/0:2 Not tainted 4.8.0-rc4-00181-gd502f8ad1c3e #13 Hardware name: Allwinner sun8i Family Workqueue: events musb_deassert_reset [<c010bc01>] (unwind_backtrace) from [<c0109237>] (show_stack+0xb/0xc) [<c0109237>] (show_stack) from [<c02a669b>] (dump_stack+0x67/0x74) [<c02a669b>] (dump_stack) from [<c05d68c9>] (mutex_lock+0x15/0x2c) [<c05d68c9>] (mutex_lock) from [<c02c3589>] (sun4i_usb_phy_write+0x39/0xec) [<c02c3589>] (sun4i_usb_phy_write) from [<c03e6327>] (musb_port_reset+0xfb/0x184) [<c03e6327>] (musb_port_reset) from [<c03e4917>] (musb_deassert_reset+0x1f/0x2c) [<c03e4917>] (musb_deassert_reset) from [<c012ecb5>] (process_one_work+0x129/0x2b8) [<c012ecb5>] (process_one_work) from [<c012f5e3>] (worker_thread+0xf3/0x424) [<c012f5e3>] (worker_thread) from [<c0132dbd>] (kthread+0xa1/0xb8) [<c0132dbd>] (kthread) from [<c0105f31>] (ret_from_fork+0x11/0x20) Since the register access is mmio, we can use a spinlock to guard this specific access, rather than the mutex that guards the entire phy. Fixes: ba4bdc9e1dc0 ("PHY: sunxi: Add driver for sunxi usb phy") Cc: Hans de Goede <hdegoede@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Chen-Yu Tsai <wens@csie.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: rockchip-usb: use rockchip_usb_phy_reset to reset phy during wakeupRandy Li2016-09-101-0/+20
| | | | | | | | It is a hardware bug in RK3288, the only way to solve it is to reset the phy. Signed-off-by: Randy Li <ayaka@soulik.info> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: Add reset callbackRandy Li2016-09-101-0/+15
| | | | | | | | | The only use for this is for solving a hardware design problem in usb of Rockchip RK3288. Signed-off-by: Randy Li <ayaka@soulik.info> Reviewed-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy-sun4i-usb: Warn when external vbus is detectedHans de Goede2016-09-101-1/+3
| | | | | | | | Warn when external vbus is detected when we're trying to enable our own vbus. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy-sun4i-usb: Add support for phy_set_modeHans de Goede2016-09-101-0/+30
| | | | | | | | Together with some musb sunxi glue changes this allows run-time dr_mode switching support via the "mode" musb sysfs attribute. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy-sun4i-usb: Simplify missing dr_mode handlingHans de Goede2016-09-101-28/+14
| | | | | | | | If we cannot get dr_mode or no id gpio is specified simply assume peripheral mode, as this is always safe. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy-sun4i-usb: Refactor forced session endingHans de Goede2016-09-101-14/+13
| | | | | | | | | | | | | The phy-sun4i-usb code supports forced ending a session on systems which lack Vbus detection, to allow switching between host and peripheral mode on such systems. Role switching via the musb driver "mode" sysfs attribute requires force ending the session too. This commit refactors the code to allow other parts of the phy-sun4i-usb code to request a forced session end. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy-sun4i-usb: Use bool where appropriateHans de Goede2016-09-101-3/+4
| | | | | | | | | We're using bool as true/false type in most places in phy-sun4i-usb.c for consistency fixup the remaining uses of ints which are ever only 0 or 1 to be bools too. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: rockchip-typec: add pm runtime supportChris Zhong2016-09-101-0/+10
| | | | | | | | Adds pm_runtime support for rockchip Type-C, so that power domain is enabled only when there is a transaction going on to help save power. Signed-off-by: Chris Zhong <zyw@rock-chips.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* usb: phy: add USB_SUPPORT dependencyArnd Bergmann2016-09-101-0/+2
| | | | | | | | | | | | | | | | | | | The driver now calls of_usb_get_dr_mode_by_phy, which is part of the USB core layer, and it fails to build when that is not provided: drivers/phy/phy-sun4i-usb.o: In function `sun4i_usb_phy_probe': phy-sun4i-usb.c:(.text.sun4i_usb_phy_probe+0x140): undefined reference to `of_usb_get_dr_mode_by_phy' We already have a couple of other PHY drivers with a dependency on USB_SUPPORT, so that seems to be the easiest fix here. An alternative would be to adjust the #ifdef in include/linux/usb/of.h to also check for CONFIG_USB_SUPPORT. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Fixes: b33ecca87df9 ("phy-sun4i-usb: Add support for peripheral-only mode") Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: Add USB Type-C PHY driver for rk3399Chris Zhong2016-09-103-0/+1023
| | | | | | | | | | | | | | Add a PHY provider driver for the rk3399 SoC Type-c PHY. The USB Type-C PHY is designed to support the USB3 and DP applications. The USB3 operates in SuperSpeed mode and the DP can operate at RBR, HBR and HBR2 data rates. This driver create 2 PHY devices separately for USB3 and DisplyPort, and registers them under the child node. Signed-off-by: Chris Zhong <zyw@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Guenter Roeck <groeck@chromium.org> Tested-by: Guenter Roeck <groeck@chromium.org> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: da8xx-usb: Fix syscon device nameDavid Lechner2016-09-101-1/+1
| | | | | | | The syscon device in board config/device tree has been renamed. Signed-off-by: David Lechner <david@lechnology.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: rockchip-inno-usb2: add COMMON_CLK dependencyFrank Wang2016-09-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | On kernel builds without COMMON_CLK, the newly added rockchip-inno-usb2 driver fails to build: drivers/phy/phy-rockchip-inno-usb2.c:124:16: error: field 'clk480m_hw' has incomplete type struct clk_hw clk480m_hw; In file included from include/linux/clk.h:16:0 from drivers/phy/phy-rockchip-inno-usb2.c:17: include/linux/kernel.h:831:48: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] const typeof( ((type *)0)->member ) *__mptr = (ptr); \ ... ... Signed-off-by: Frank Wang <frank.wang@rock-chips.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Heiko Stuebner <heiko@sntech.de>
* phy: omap-usb2: support suspend/resumeSekhar Nori2016-09-101-54/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Relying on PM-ops for shutting down PHY clocks was a bad idea since the users (e.g. USB DWC3) might not have been suspended by then. Get rid of all PM-ops. It is the sole responsibility of the PHY user to properly turn OFF and de-initialize the PHY as part of its suspend routine. Enable/disable PHY clock as part of ->init()/->exit() call respectively. With this phy_init() and phy_exit() can be called by PHY user during suspend/resume. This is similar to what is done for ti-pipe3 driver. See 31c8954efb1b ("phy: ti-pipe3: fix suspend") The pm_runtime_enable() call in omap_usb2_probe() is still required because without it, phy_create() will not enable runtime PM on the phy device it creates and phy_init() will not call pm_runtime_get_sync(). Without pm_runtime_get_sync(), ocp2scp hwmod will _not_ enable the IP and, thus, we will have abort exceptions. Signed-off-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: rcar-gen3-usb2: Add a compatible string for r8a7796Yoshihiro Shimoda2016-09-101-0/+1
| | | | | | | | | This driver can support for r8a7796 SoC. So, this patch adds it. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: bcm-ns2-pcie: Set missing .owner field in ns2_pci_phy_opsAxel Lin2016-09-101-1/+2
| | | | | | | | | | Add missing .owner field in ns2_pci_phy_ops, which is used for refcounting. While at it, also makes ns2_pci_phy_ops const as it's never get modified. Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-and-tested-by: Jon Mason <jon.mason@broadcom.com> Reviewed-by: Pramod Kumar <pramodku@broadcom.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: bcm-ns2-pcie: Get rid of struct ns2_pci_phyAxel Lin2016-09-101-20/+5
| | | | | | | | | | By setting phy_set_drvdata(phy, mdiodev), struct ns2_pci_phy can be removed. Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-and-tested-by: Jon Mason <jon.mason@broadcom.com> Reviewed-by: Pramod Kumar <pramodku@broadcom.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: tegra: mark tegra_xusb_lane_lookup_function() staticBaoyou Xie2016-09-101-1/+2
| | | | | | | | | | | | | | We get 1 warning when building kernel with W=1: drivers/phy/tegra/xusb.c:104:5: warning: no previous prototype for 'tegra_xusb_lane_lookup_function' [-Wmissing-prototypes] In fact, this function is only used in the file in which it is declared and don't need a declaration, but can be made static. So this patch marks it 'static'. Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: tegra: add missing header dependenciesBaoyou Xie2016-09-101-0/+1
| | | | | | | | | | | | | | | | | We get 5 warnings when building kernel with W=1: drivers/phy/tegra/xusb.c:948:27: warning: no previous prototype for 'tegra_xusb_padctl_get' [-Wmissing-prototypes] drivers/phy/tegra/xusb.c:981:6: warning: no previous prototype for 'tegra_xusb_padctl_put' [-Wmissing-prototypes] drivers/phy/tegra/xusb.c:988:5: warning: no previous prototype for 'tegra_xusb_padctl_usb3_save_context' [-Wmissing-prototypes] drivers/phy/tegra/xusb.c:998:5: warning: no previous prototype for 'tegra_xusb_padctl_hsic_set_idle' [-Wmissing-prototypes] drivers/phy/tegra/xusb.c:1008:5: warning: no previous prototype for 'tegra_xusb_padctl_usb3_set_lfps_detect' [-Wmissing-prototypes] In fact, these functions are declared in linux/phy/tegra/xusb.h, so this patch adds missing header dependencies. Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: add a driver for the Rockchip SoC internal PCIe PHYShawn Lin2016-09-103-0/+366
| | | | | | | | | This patch to add a generic PHY driver for rockchip PCIe PHY. Access the PHY via registers provided by GRF (general register files) module. Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: rockchip-inno-usb2: add a new driver for Rockchip usb2phyFrank Wang2016-09-103-0/+715
| | | | | | | | | | | | | | The newer SoCs (rk3366, rk3399) take a different usb-phy IP block than rk3288 and before, and most of phy-related registers are also different from the past, so a new phy driver is required necessarily. Signed-off-by: Frank Wang <frank.wang@rock-chips.com> Suggested-by: Heiko Stuebner <heiko@sntech.de> Suggested-by: Guenter Roeck <linux@roeck-us.net> Suggested-by: Doug Anderson <dianders@chromium.org> Reviewed-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: qcom-ufs: use of_property_read_boolJulia Lawall2016-09-101-4/+2
| | | | | | | | | | | | | | | | | | | | | Use of_property_read_bool to check for the existence of a property. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression e1,e2,x; @@ - if (of_get_property(e1,e2,NULL)) - x = true; - else - x = false; + x = of_property_read_bool(e1,e2); // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: bcm-ns-usb3: new driver for USB 3.0 PHY on NorthstarRafał Miłecki2016-09-103-0/+284
| | | | | | | | | | | | | | | | Northstar is a family of SoCs used in home routers. They have USB 2.0 and 3.0 controllers with PHYs that need to be properly initialized. This driver provides PHY init support in a generic way and can be bound with XHCI controller driver. There aren't any public datasheets from Broadcom so we can't have nice defines for all used bits. It means we just follow Broadcom's initialization procedure using their magic values. We were quite lucky actually that Broadcom put some comments in their SDK reference code explaining what given writes are responsible for. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: sun4i: add support for A64 usb phyIcenowy Zheng2016-09-101-6/+29
| | | | | | | | There's something unknown in the pmu part that shared with H3. It's renamed as PMU_UNK1 from PMU_UNK_H3. Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: exynos5-usbdrd: Remove "static" from local variableAxel Lin2016-09-101-2/+2
| | | | | | | | The 'reg' local variable does not need to be static. Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>