Commit graph

264 commits

Author SHA1 Message Date
Greg Kroah-Hartman
d50f14805e phy: for 4.3
*) Add new NXP USB OTG PHY driver
 *) Add vbus/id detection, extcon support and fixes in phy-sun4i-usb
    driver
 *) Add support to use phy-sun4i-usb driver for sun8i-a23 and sun8i-a33
    SoCs
 *) Other trivial code cleanups, dropping .owner assignment and constify
    phy_ops
 
 Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJVyhKbAAoJEA5ceFyATYLZIRcP/ivt04ocgcZ7+kyTC55uUvoA
 I/YAQScDW+LWdCeEE11nWl5oDDecaMDFs/aIVAbuEt38lya6lIzU66gsFlJpJCHj
 LolnyE8DU8WhEkJRdMsDFVLX+oaNPHHfhIGEorm/FwdoJ6oT0TQ1NZbw7qh6o+T9
 +Eb/T8nSTFIHWm24E0MN2pos9mvG4FtDeNp09j05y0F6L/AuLj/eBVJN5vNQ5YgZ
 onA0YuPNzEJOOdgPJp2WiG2U72evCsCXy5X95gBbz/Fk7uj+vvgy+rMNorOZik+H
 jLHGuV5kynHGehjn7+UaiPAU4zFfuqbVSyF07tMVqRdb5nGN9621DcfR9jieb2/g
 3I0BQcHohwTjQvffdifCcDdF6YwzdLtZQwUEqjngafDoi5mfoolLupsTpLO9GOAO
 Dq5ZbvqHKoCdQ1h+LZ6KRrr+de9Lrp3P/Ys/9t22e+DF3Vhq0QW8KNMJtNVutrFx
 RZmiuf5AWPieZBwaVzWVI5AX8Y2KsoVX9BXiOsgkFuFhd3V6lkpI56UlV36IP+rD
 E8MZ1NblCD+zR19DeZByyl2q1jvK3APNsQQrF3YzIGw9/yaJvVsMvpHIlF9gQ3Z1
 A8rvUn3nYW6Gnc9L3b7VQJM15n8K0bym4fPkCIRe5yimC+a5ztxddEajYynmpQGg
 5C9QmBF7MH6HlXwVPF4R
 =97xz
 -----END PGP SIGNATURE-----

Merge tag 'phy-for-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy into usb-next

Kishon writes:

phy: for 4.3

*) Add new NXP USB OTG PHY driver
*) Add vbus/id detection, extcon support and fixes in phy-sun4i-usb
   driver
*) Add support to use phy-sun4i-usb driver for sun8i-a23 and sun8i-a33
   SoCs
*) Other trivial code cleanups, dropping .owner assignment and constify
   phy_ops

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-08-14 16:45:51 -07:00
Joachim Eastwood
cfd093bbb5 phy: lpc18xx-usb-otg: fix clock order in phy init
Changing the frequency of the USB clock must be done before the
PLL is powered on (prepared). This matters when the USB clock
is not setup by either boot ROM or boot loader. Reorder the
function calls to adhere to the order noted in the user manual.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-08-10 20:11:58 +05:30
Axel Lin
4a9e5ca1a5 phy: Constify struct phy_ops variables
The phy_ops variables are never modified after initialized in these
drivers, so make them const.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-08-03 18:35:09 +05:30
Axel Lin
42ad8f6721 phy: ulpi_phy: Add const qualifier to ops
The ops is never changed in ulpi_phy_create(), so make it const.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-08-03 18:35:09 +05:30
Hans de Goede
8083526e05 phy-sun4i-usb: Only check vbus-det on power-on on boards with vbus-det
data->vbus_det is always 1 on boards without a (working) vbus-det, skip
the vbus_det test on such boards.

This fixes the sun4i usb phy code never turning on Vbus on such boards.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-08-03 18:35:08 +05:30
Hans de Goede
3d772c4adb phy-sun4i-sub: Move vbus-detect helper functions up in the file
Move vbus-detect helper functions up in the file, just moving some code
around, no functional changes what so ever.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-08-03 18:35:08 +05:30
Roger Quadros
c934b36127 phy: ti-pipe3: i783 workaround for SATA lockup after dpll unlock/relock
SATA_PLL_SOFT_RESET bit of CTRL_CORE_SMA_SW_0 must be toggled
between a SATA DPLL unlock and re-lock to prevent SATA lockup.

Introduce a new DT parameter 'syscon-pllreset' to provide the syscon
regmap access to this register which sits in the control module.

If the register is not provided we fallback to the old behaviour
i.e. SATA DPLL refclk will not be disabled and we prevent SoC low
power states.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-08-01 15:52:58 +05:30
Hans de Goede
7167bf8b7f phy-sun4i-usb: Add missing EXPORT_SYMBOL_GPL for sun4i_usb_phy_set_squelch_detect
sun4i_usb_phy_set_squelch_detect is used by other code, which may be built
as a module, so it should be exported.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-08-01 15:52:58 +05:30
Krzysztof Kozlowski
219bf1599e phy: Drop owner assignment from platform_driver
platform_driver does not need to set an owner because
platform_driver_register() will set it.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-07-25 15:45:48 +05:30
Krzysztof Kozlowski
511fdecc9b phy: Drop owner assignment from i2c_driver
i2c_driver does not need to set an owner because i2c_register_driver()
will set it.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-07-25 15:45:48 +05:30
Michal Simek
2508aaed39 phy: berlin: Trivial coding style cleanup
Remove unneeded space after tab.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-07-25 15:45:48 +05:30
Michal Simek
456dedc9e7 phy: berlin: Do not use sata name in usb phy driver
copy and paste error from berlin sata phy driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-07-25 15:45:48 +05:30
Michal Simek
2c89e41f03 phy: berlin: .owner field is setup by core
There was big cleanup in past to remove this unneeded setting.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-07-25 15:45:48 +05:30
Hans de Goede
8665c18bec phy-sun4i-usb: Add support for monitoring vbus via a power-supply
On some boards there is no vbus_det gpio pin, instead vbus-detection for
otg can be done via the pmic.

This commit adds support for monitoring vbus_det via the power_supply
exported by the pmic, enabling support for otg on these boards.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-07-25 15:45:47 +05:30
Hans de Goede
1aedf3a7a4 phy-sun4i-usb: Add support for boards with broken Vusb-detection
On some boards we cannot detect the presence of an external Vusb, because
e.g. the 5V of the otg connector is directly connected to the 5V of the board,
and thus is always high.

This commit adds support for using such boards by only looking at the
id-detection pin.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-07-25 15:45:47 +05:30
Hans de Goede
fc1f45ed30 phy-sun4i-usb: Add support for the usb-phys on the sun8i-a33 SoC
The usb-phys on the sun8i-a33 SoC are mostly the same as sun8i-a23 but for
some reason (hw bug?) the phyctl register was moved to a different address
and is not initialized to 0 on reset.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-07-25 15:45:47 +05:30
Hans de Goede
123dfdbcfa phy-sun4i-usb: Add support for the usb-phys on the sun8i-a23 SoC
The usb-phys on the sun8i-a23 SoC have the same setup wrt clocks as on the
sun6i-a31 SoC, but there are only 2 instead of 3 like on the sun5i-a13 SoC.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-07-25 15:45:47 +05:30
Hans de Goede
2846469631 phy-sun4i-usb: Swap check for disconnect threshold
Before this commit the code for determining the disconnect threshold was
checking for "allwinner,sun4i-a10-usb-phy" or "allwinner,sun6i-a31-usb-phy"
assuming that those where the exception and then newer SoCs would use a
disconnect threshold of 2 like sun7i does. But it turns out that newer
SoCs use a disconnect threshold of 3 and sun5i and sun7i are the
exceptions, so check for those instead.

Here are the settings from the various Allwinner SDK sources:
 sun4i-a10: USBC_Phy_Write(usbc_no, 0x2a, 3, 2);
 sun5i-a13: USBC_Phy_Write(usbc_no, 0x2a, 2, 2);
 sun6i-a31: USBC_Phy_Write(usbc_no, 0x2a, 3, 2);
 sun7i-a20: USBC_Phy_Write(usbc_no, 0x2a, 2, 2);
 sun8i-a23: USBC_Phy_Write(usbc_no, 0x2a, 3, 2);
 sun8i-h3:  USBC_Phy_Write(usbc_no, 0x2a, 3, 2);
 sun9i-a80: USBC_Phy_Write(usbc_no, 0x2a, 3, 2);

Note this commit makes no functional changes as currently we only support
sun4i - sun7i.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-07-25 15:45:47 +05:30
Hans de Goede
1a52abe682 phy-sun4i-usb: Add extcon support for the otg phy (phy0)
The sunxi musb glue needs to know if a host or normal usb cable is plugged
in, add extcon support so that the musb glue can monitor the host status.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-07-25 15:45:47 +05:30
Hans de Goede
d2332303ef phy-sun4i-usb: Add id and vbus detection support for the otg phy (phy0)
The usb0 phy is connected to an OTG controller, and as such needs some special
handling:

1) It allows explicit control over the pullups, enable these on phy_init and
disable them on phy_exit.

2) It has bits to signal id and vbus detect to the musb-core, add support for
for monitoring id and vbus detect gpio-s for use in dual role mode, and set
these bits to the correct values for operating in host only mode when no
gpios are specified in the devicetree.

While updating the devicetree binding documentation also add documentation
for the sofar undocumented usage of regulators for vbus for all 3 phys.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-07-25 15:45:47 +05:30
Joachim Eastwood
cbf919bd32 phy: add lpc18xx usb otg phy driver
Add PHY driver for the internal USB OTG PHY found on NXP
LPC18xx and LPC43xx devices. This driver takes care of
enabling the PHY in CREG (syscon) and setting the required
clock frequency.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-07-25 15:45:46 +05:30
Thomas Hebb
dcb54fcb34 phy: berlin-usb: fix divider for BG2
The USB PLL divider set by the marvell,berlin2-usb-phy compatible is not
correct for BG2. We couldn't change it before because BG2Q incorrectly
used the same compatible string. Now that BG2Q's compatible is fixed,
change BG2's divider to the correct value.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
Tested-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-07-15 20:02:09 +05:30
Thomas Hebb
96696a9df9 phy: berlin-usb: fix divider for BG2CD
The marvell,berlin2cd-usb-phy compatible incorrectly sets the PLL
divider to BG2's value instead of BG2CD/BG2Q's. Change it to the right
value.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-07-15 20:02:09 +05:30
Sebastian Ott
1c4b1d1da3 phy/pxa: add HAS_IOMEM dependency
Fix this compile error:

drivers/built-in.o: In function 'mv_usb2_phy_probe':
phy-pxa-28nm-usb2.c:(.text+0x25ec): undefined reference to
'devm_ioremap_resource'
drivers/built-in.o: In function 'mv_hsic_phy_probe':
phy-pxa-28nm-hsic.c:(.text+0x3084): undefined reference to
'devm_ioremap_resource'

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-07-15 20:02:09 +05:30
Roger Quadros
0a0830feb2 phy: ti-pipe3: fix suspend
Relying on PM-ops for shutting down PHY clocks was a
bad idea since the users (e.g. PCIe/SATA) might not
have been suspended by then.

The main culprit for not shutting down the clocks was
the stray pm_runtime_get() call in probe.

Fix the whole thing in the right way by getting rid
of that pm_runtime_get() call from probe and
removing 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.

As PHY core serializes init/exit we don't need
to use a spinlock in this driver. So get rid of it.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-07-15 20:02:09 +05:30
Linus Torvalds
78c10e556e Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS updates from Ralf Baechle:

 - Improvements to the tlb_dump code
 - KVM fixes
 - Add support for appended DTB
 - Minor improvements to the R12000 support
 - Minor improvements to the R12000 support
 - Various platform improvments for BCM47xx
 - The usual pile of minor cleanups
 - A number of BPF fixes and improvments
 - Some improvments to the support for R3000 and DECstations
 - Some improvments to the ATH79 platform support
 - A major patchset for the JZ4740 SOC adding support for the CI20 platform
 - Add support for the Pistachio SOC
 - Minor BMIPS/BCM63xx platform support improvments.
 - Avoid "SYNC 0" as memory barrier when unlocking spinlocks
 - Add support for the XWR-1750 board.
 - Paul's __cpuinit/__cpuinitdata cleanups.
 - New Malta CPU board support large memory so enable ZONE_DMA32.

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (131 commits)
  MIPS: spinlock: Adjust arch_spin_lock back-off time
  MIPS: asmmacro: Ensure 64-bit FP registers are used with MSA
  MIPS: BCM47xx: Simplify handling SPROM revisions
  MIPS: Cobalt Don't use module_init in non-modular MTD registration.
  MIPS: BCM47xx: Move NVRAM driver to the drivers/firmware/
  MIPS: use for_each_sg()
  MIPS: BCM47xx: Don't select BCMA_HOST_PCI
  MIPS: BCM47xx: Add helper variable for storing NVRAM length
  MIPS: IRQ/IP27: Move IRQ allocation API to platform code.
  MIPS: Replace smp_mb with release barrier function in unlocks.
  MIPS: i8259: DT support
  MIPS: Malta: Basic DT plumbing
  MIPS: include errno.h for ENODEV in mips-cm.h
  MIPS: Define GCR_GIC_STATUS register fields
  MIPS: BPF: Introduce BPF ASM helpers
  MIPS: BPF: Use BPF register names to describe the ABI
  MIPS: BPF: Move register definition to the BPF header
  MIPS: net: BPF: Replace RSIZE with SZREG
  MIPS: BPF: Free up some callee-saved registers
  MIPS: Xtalk: Update xwidget.h with known Xtalk device numbers
  ...
2015-06-27 12:44:34 -07:00
Linus Torvalds
2a298679b4 USB patches for 4.2-rc1
Here's the big USB patchset for 4.2-rc1.  As is normal these days, the
 majority of changes are in the gadget drivers, with a bunch of other
 small driver changes.
 
 All of these have been in linux-next with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlWNobIACgkQMUfUDdst+ylXtQCgwTnzFBzly+3h1Npa2CWkr/Lw
 TWAAn31qEP28MLjm8iVJLNPwdVd2kt1w
 =hrdz
 -----END PGP SIGNATURE-----

Merge tag 'usb-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB updates from Greg KH:
 "Here's the big USB patchset for 4.2-rc1.  As is normal these days, the
  majority of changes are in the gadget drivers, with a bunch of other
  small driver changes.

  All of these have been in linux-next with no reported issues"

* tag 'usb-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (175 commits)
  usb: dwc3: Use ASCII space in Kconfig
  usb: chipidea: add work-around for Marvell HSIC PHY startup
  usb: chipidea: allow multiple instances to use default ci_default_pdata
  dt-bindings: Consolidate ChipIdea USB ci13xxx bindings
  phy: add Marvell HSIC 28nm PHY
  phy: Add Marvell USB 2.0 OTG 28nm PHY
  dt-bindings: Add Marvell PXA1928 USB and HSIC PHY bindings
  USB: ssb: use devm_kzalloc
  USB: ssb: fix error handling in ssb_hcd_create_pdev()
  usb: isp1760: check for null return from kzalloc
  cdc-acm: Add support of ATOL FPrint fiscal printers
  usb: chipidea: usbmisc_imx: Remove unneeded semicolon
  USB: usbtmc: add device quirk for Rigol DS6104
  USB: serial: mos7840: Use setup_timer
  phy: twl4030-usb: add ABI documentation
  phy: twl4030-usb: remove incorrect pm_runtime_get_sync() in probe function.
  phy: twl4030-usb: remove pointless 'suspended' test in 'suspend' callback.
  phy: twl4030-usb: make runtime pm more reliable.
  drivers:usb:fsl: Fix compilation error for fsl ehci drv
  usb: renesas_usbhs: Don't disable the pipe if Control write status stage
  ...
2015-06-26 15:59:26 -07:00
Pratyush Anand
9c5dcdd0c7 Mohit Kumar has moved
Mohit's email-id doesn't exist anymore as he has left the company.
Replace ST's id with mohit.kumar.dhaka@gmail.com.

Signed-off-by: Pratyush Anand <pratyush.anand@gmail.com>
Cc: Mohit Kumar <mohit.kumar.dhaka@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-06-25 17:00:38 -07:00
Pratyush Anand
e34cadde3b Pratyush Anand has moved
pratyush.anand@st.com email-id doesn't exist anymore as I have left the
company.  Replace ST's id with pratyush.anand@gmail.com.

Signed-off-by: Pratyush Anand <pratyush.anand@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-06-25 17:00:38 -07:00
Andrew Bresticker
57991ebaf9 PHY: Add driver for Pistachio USB2.0 PHY
Add a driver for the USB2.0 PHY found on the IMG Pistachio SoC.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: devicetree@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: James Hartley <james.hartley@imgtec.com>
Cc: Damien Horsley <Damien.Horsley@imgtec.com>
Patchwork: https://patchwork.linux-mips.org/patch/9728/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2015-06-21 21:53:38 +02:00
Rob Herring
10d9029bcb phy: add Marvell HSIC 28nm PHY
Add PHY driver for the Marvell HSIC 28nm PHY. This PHY is found in PXA1928
SOC.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-09 12:20:30 -07:00
Rob Herring
603c5f9d9c phy: Add Marvell USB 2.0 OTG 28nm PHY
Add driver for USB 28nm PHY found in Marvell PXA1928 SOC.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-09 12:20:30 -07:00
Greg Kroah-Hartman
19915e6234 Merge 4.1-rc7 into usb-next
This resolves a merge issue in musb_core.c and we want the fixes that
were in Linus's tree in this branch as well for testing.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 10:57:51 -07:00
Greg Kroah-Hartman
b3d424e3dc phy: for 4.2 merge window
*) new Broadcom SATA3 PHY driver for Broadcom STB SoCs
 *) new phy API to get PHY by index which is used in EHCI and
    OHCI controller drivers
 *) support specifying supply at port level used for multi-port PHYs
 *) sparse warning fixes in miphy PHYs
 *) fix pm_runtime issues in twl4030 driver
 
 Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJVbbvfAAoJEA5ceFyATYLZdAIP/2mFENq9DIRDqU7LV4aQRDlC
 TlL+DLGwElAGKkq7bL3UaWy+10kooTmVaYVB1MACAPXZgKguTkjsSdWXDSxFHDyG
 tq32CqkeMx1uhsZBMhdxsIsTnAPfEo1s2lO7O/HaJTq38aqKixC5+A3IYXttSvET
 jF4XCx7IGNK7YIMylTzAW1FN9rHvsp4RRKIkPjS8EAiAbQIcu7rxKdSbfwJ69Zxt
 EUep3u7jvlQK6SmOig3nkoQFf70G6d7p0VsBPrU6l6Dg9Ciu/5ZvzCkg5ukGotOl
 1GIpowjW3abIaX6yGOD95phU8+JPZbncG/vrQ5Hf/FDZtvCgs6tYqY+Zqmxf7SlK
 4Jj43+sjvDt05Ty9K1sP2FnQqBq9XKEmX5K1pYCrHDbDiH0L9gKeX9/46dJhDrMS
 F3rfrcgBxqBqT96BsqPHmuN0uUvXaF7pGKyFWoGodblBsYee6z4XAl8Up62Lqq3U
 QglegTz9ICKDU1j8xmjLHN9l21BfXANdirFTyjtV3XIGR6mcmzd3R3qk7x2ulaQ8
 lA4gfUhm9X8f55FTqLIw+7Ld+rgEW9NYHSX4fFvtzB/T5SPdOrslgjby4i0a81Pv
 IfQcLaQZ75QIj+22sy27cXrQsmUCe6sNXrms190uknh3hEHDeNOtPupYIMJcXiO+
 n2YJ6QCOnly3tSMFNWfM
 =vPk6
 -----END PGP SIGNATURE-----

Merge tag 'phy-for-v4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy into usb-next

Kishon writes:

phy: for 4.2 merge window

*) new Broadcom SATA3 PHY driver for Broadcom STB SoCs
*) new phy API to get PHY by index which is used in EHCI and
   OHCI controller drivers
*) support specifying supply at port level used for multi-port PHYs
*) sparse warning fixes in miphy PHYs
*) fix pm_runtime issues in twl4030 driver

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-06-03 14:13:41 +09:00
NeilBrown
4724e27114 phy: twl4030-usb: remove incorrect pm_runtime_get_sync() in probe function.
The USB phy should initialize with power-off, and will be powered on
by the USB system when a cable connection is detected.

Having this pm_runtime_get_sync() during probe causes the phy to
*always* be powered on.
Removing it returns to sensible power management.

Fixes: 96be39ab34
Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-06-01 16:08:24 +05:30
NeilBrown
186ecebeb6 phy: twl4030-usb: remove pointless 'suspended' test in 'suspend' callback.
When the runtime_suspend callback is running, 'runtime_status'
is always RPM_SUSPENDING, so pm_runtime_suspended() will always
fail.
Similarly while the runtime_resume callback is running
'runtime_status' is RPM_RESUMING, so pm_runtime_active() will
always fail.

So remove these two pointless tests.

Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-06-01 16:08:24 +05:30
NeilBrown
56301df6bc phy: twl4030-usb: make runtime pm more reliable.
A construct like:

        if (pm_runtime_suspended(twl->dev))
               pm_runtime_get_sync(twl->dev);

is against the spirit of the runtime_pm interface as it
makes the internal refcounting useless.

In this case it is also racy, particularly as 'put_autosuspend'
is used to drop a reference.
When that happens a timer is started and the device is
runtime-suspended after the timeout.
If the above code runs in this window, the device will not be
found to be suspended so no pm_runtime reference is taken.
When the timer expires the device will be suspended, which is
against the intention of the code.

So be more direct is taking and dropping references.
If twl->linkstat is VBUS_VALID or ID_GROUND, then hold a
pm_runtime reference, otherwise don't.
Define "cable_present()" to test for this condition.

Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-06-01 16:08:24 +05:30
Hans de Goede
24fe86a617 phy: sun4i-usb: Add a sunxi specific function for setting squelch-detect
The sunxi otg phy has a bug where it wrongly detects a high speed squelch
when reset on the root port gets de-asserted with a lo-speed device.

The workaround for this is to disable squelch detect before de-asserting
reset, and re-enabling it after the reset de-assert is done. Add a sunxi
specific phy function to allow the sunxi-musb glue to do this.

Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-05-27 12:20:36 -05:00
Brian Norris
0d486806ff phy: add Broadcom SATA3 PHY driver for Broadcom STB SoCs
Supports up to two ports which can each be powered on/off and configured
independently.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-05-22 16:53:09 +05:30
Yoshihiro Shimoda
9d699bf4db phy: rcar-gen2: Add support for R-Car E2
This patch adds a compatible string to support for R-Car E2.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-05-21 18:35:08 +05:30
Heikki Krogerus
1c14905ef9 phy: add driver for TI TUSB1210 ULPI PHY
TUSB1210 ULPI PHY has vendor specific register for eye
diagram tuning. On some platforms the system firmware has
set optimized value to it. In order to not loose the
optimized value, the driver stores it during probe and
restores it every time the PHY is powered back on.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: David Cohen <david.a.cohen@linux.intel.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-05-13 12:07:01 -05:00
Heikki Krogerus
723487a6ff phy: helpers for USB ULPI PHY registering
ULPI PHYs need to be bound to their controllers with a
lookup. This adds helpers that the ULPI drivers can use to
do both, the registration of the PHY and the lookup, at the
same time.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: David Cohen <david.a.cohen@linux.intel.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-05-13 12:06:56 -05:00
Yoshihiro Shimoda
a3ac3d4a29 phy: phy-rcar-gen2: Fix USBHS_UGSTS_LOCK value
According to the technical update (No. TN-RCS-B011A/E), the UGSTS LOCK
bit location is bit 8, not bits 1 and 0. It also says that the register
address offset of UGSTS is 0x88, not 0x90.
So, this patch fixes the USBHS_UGSTS_LOCK value and some comments.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-05-12 20:57:19 +05:30
Kishon Vijay Abraham I
4581f798ec phy: omap-usb2: invoke pm_runtime_disable on error path
if devm_clk_get for wkupclk fails, there will be an unbalanced
pm_runtime_enable. Fix it here.

Reported-by: Benoit Parrot <bparrot@ti.com>
Cc: Roger Quadros <rogerq@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-05-12 20:57:19 +05:30
Felipe Balbi
7f7a4d306f phy: fix Kconfig dependencies
DM816x PHY uses usb_phy_* methods and because
of that, it must select USB_PHY, however, because
the drivers in question (DM816x, TWL4030 and
OMAP_USB2) sit outside of drivers/usb/ directory,
meaning they can be built even if USB_SUPPORT=n.

This patches fixes the dependencies by adding
USB_SUPPORT as a dependency and making all drivers
select USB_PHY (which cannot be selected through
menuconfig).

Note that this fixes some linking breakages when
building with randconfig.

Cc: Tony Lindgren <tony@atomide.com>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-05-12 20:57:18 +05:30
Stephen Boyd
4d051f74cb phy: qcom-ufs: Switch dependency to ARCH_QCOM
This phy only exists on platforms under ARCH_QCOM, not ARCH_MSM.

Cc: Yaniv Gardi <ygardi@codeaurora.org>
Cc: Dov Levenglick <dovl@codeaurora.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: David Brown <davidb@codeaurora.org>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Reviewed-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-05-12 20:52:13 +05:30
Axel Lin
33f434d283 phy: core: Check requested PHY status in _of_phy_get()
This is a common checking in various drivers, so move the checking to
_of_phy_get().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-05-11 21:42:27 +05:30
Felipe Balbi
5bea496820 phy: miphy365x: fix sparse warnings
Add missing 'static' modifier so sparse
won't complain anymore.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-05-11 21:42:26 +05:30
Felipe Balbi
99db11c6e8 phy: miphy28lp: fix sparse warnings
Add missing __iomem annotation to the base address
so Sparse doesn't complain.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-05-11 21:42:26 +05:30
Dmitry Torokhov
87006dd600 phy: phy-core: allow specifying supply at port level
Multi-port phys may have per port power supplies. Let's change phy
core to look for supply at the port level when multiple ports are
specified. To keep compatibility with the existing device tree board
descriptions for single-port phys we will continue looking up the
power supply at the parent node level

Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Arun Ramamurthy <arun.ramamurthy@broadcom.com>
Reviewed-by: Ray Jui <rjui@broadcom.com>
Reviewed-by: Scott Branden <sbranden@broadcom.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2015-05-11 21:42:25 +05:30