09 Mar, 2017

3 commits

  • We get the following compile errors if EXTCON is enabled as a
    module but this driver is builtin:

    drivers/built-in.o: In function `qcom_usb_hs_phy_power_off':
    phy-qcom-usb-hs.c:(.text+0x1089): undefined reference to `extcon_unregister_notifier'
    drivers/built-in.o: In function `qcom_usb_hs_phy_probe':
    phy-qcom-usb-hs.c:(.text+0x11b5): undefined reference to `extcon_get_edev_by_phandle'
    drivers/built-in.o: In function `qcom_usb_hs_phy_power_on':
    phy-qcom-usb-hs.c:(.text+0x128e): undefined reference to `extcon_get_state'
    phy-qcom-usb-hs.c:(.text+0x12a9): undefined reference to `extcon_register_notifier'

    so let's mark this as needing to follow the modular status of
    the extcon framework.

    Fixes: 9994a33865f4 e2427b09ba929c2b9 (phy: Add support for Qualcomm's USB HS phy")
    Signed-off-by: Stephen Boyd
    Signed-off-by: Kishon Vijay Abraham I

    Stephen Boyd
     
  • When it doesn't get the blk_base's resource, it was returned
    the error about phy_base, not blk_base.
    This patch is for fixing the wrong error return about blk_base.

    Fixes: cf0adb8e281b ("phy: phy-exynos-pcie: Add support for Exynos PCIe PHY")

    Signed-off-by: Jaehoon Chung
    Signed-off-by: Kishon Vijay Abraham I

    Jaehoon Chung
     
  • This reverts commit d7bc1a7d41bf ("phy: Add USB3 PHY support for
    Broadcom NSP SoC") as we already have driver for this PHY (shared by NS
    and NSP). It was added in commit e5666281d9ea ("phy: bcm-ns-usb3: new
    driver for USB 3.0 PHY on Northstar").

    Instead of adding separated driver & duplicating code we should work on
    improving existing (old) one. Thanks to work done by Broadcom we know
    there is MDIO bus we weren't aware of & we know register names which
    makes initialization more clear. This is very valuable info and we
    should work on using it in existing driver afterwards.

    Acked-by: Jon Mason
    Signed-off-by: Rafał Miłecki

    Rafał Miłecki
     

24 Feb, 2017

1 commit

  • Pull PCI updates from Bjorn Helgaas:

    - add ASPM L1 substate support

    - enable PCIe Extended Tags when supported

    - configure PCIe MPS settings on iProc, Versatile, X-Gene, and Xilinx

    - increase VPD access timeout

    - add ACS quirks for Intel Union Point, Qualcomm QDF2400 and QDF2432

    - use new pci_irq_alloc_vectors() in more drivers

    - fix MSI affinity memory leak

    - remove unused MSI interfaces and update documentation

    - remove unused AER .link_reset() callback

    - avoid pci_lock / p->pi_lock deadlock seen with perf

    - serialize sysfs enable/disable num_vfs operations

    - move DesignWare IP from drivers/pci/host/ to drivers/pci/dwc/ and
    refactor so we can support both hosts and endpoints

    - add DT ECAM-like support for HiSilicon Hip06/Hip07 controllers

    - add Rockchip system power management support

    - add Thunder-X cn81xx and cn83xx support

    - add Exynos 5440 PCIe PHY support

    * tag 'pci-v4.11-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (93 commits)
    PCI: dwc: Remove dependency of designware on CONFIG_PCI
    PCI: dwc: Add CONFIG_PCIE_DW_HOST to enable PCI dwc host
    PCI: dwc: Split pcie-designware.c into host and core files
    PCI: dwc: designware: Fix style errors in pcie-designware.c
    PCI: dwc: designware: Parse "num-lanes" property in dw_pcie_setup_rc()
    PCI: dwc: all: Split struct pcie_port into host-only and core structures
    PCI: dwc: designware: Get device pointer at the start of dw_pcie_host_init()
    PCI: dwc: all: Rename cfg_read/cfg_write to read/write
    PCI: dwc: all: Use platform_set_drvdata() to save private data
    PCI: dwc: designware: Move register defines to designware header file
    PCI: dwc: Use PTR_ERR_OR_ZERO to simplify code
    PCI: dra7xx: Group PHY API invocations
    PCI: dra7xx: Enable MSI and legacy interrupts simultaneously
    PCI: dra7xx: Add support to force RC to work in GEN1 mode
    PCI: dra7xx: Simplify probe code with devm_gpiod_get_optional()
    PCI: Move DesignWare IP support to new drivers/pci/dwc/ directory
    PCI: exynos: Support the PHY generic framework
    Documentation: binding: Modify the exynos5440 PCIe binding
    phy: phy-exynos-pcie: Add support for Exynos PCIe PHY
    Documentation: samsung-phy: Add exynos-pcie-phy binding
    ...

    Linus Torvalds
     

21 Feb, 2017

1 commit

  • Add support for Generic PHY framework about Exynos SoCs. Current Exynos
    PCIe driver doesn't use the PHY framework, which makes it difficult to
    upstream the other Exynos variants because of different PHY registers.

    Move the codes relevant to PHY from Exnyos PCIe driver to PHY Exynos PCIe
    driver.

    [bhelgaas: depend on "OF && (ARCH_EXYNOS || COMPILE_TEST)", update
    copyright year, both per Vivek]
    Signed-off-by: Jaehoon Chung
    Acked-by: Krzysztof Kozlowski
    Reviewed-by: Jingoo Han
    Reviewed-by: Pankaj Dubey
    Reviewed-by: Vivek Gautam
    Signed-off-by: Bjorn Helgaas

    Jaehoon Chung
     

27 Jan, 2017

9 commits

  • We want to skip only tx/rx_iface clocks and not ref_clk_src
    as well. Fix the jump label accordingly.

    Fixes: 300f96771d78 ("phy: qcom-ufs: Skip obtaining rx/tx_iface_clk for msm8996 based phy")

    Cc: Subhash Jadavani
    Cc: Martin K. Petersen
    Cc: Kishon Vijay Abraham I
    Cc: stable@vger.kernel.org
    Signed-off-by: Vivek Gautam
    Signed-off-by: Kishon Vijay Abraham I

    Vivek Gautam
     
  • Fix build errors in phy-rockchip-inno-usb2.c. The driver uses
    extcon interfaces so it should depend on EXTCON.

    Fixes these build errors:

    drivers/built-in.o: In function `rockchip_usb2phy_otg_sm_work':
    phy-rockchip-inno-usb2.c:(.text+0x2bcb): undefined reference to `extcon_get_state'
    phy-rockchip-inno-usb2.c:(.text+0x2cd4): undefined reference to `extcon_set_state_sync'
    phy-rockchip-inno-usb2.c:(.text+0x2cec): undefined reference to `extcon_set_state_sync'
    phy-rockchip-inno-usb2.c:(.text+0x2d2d): undefined reference to `extcon_get_state'
    drivers/built-in.o: In function `rockchip_usb2phy_probe':
    phy-rockchip-inno-usb2.c:(.text+0x31d7): undefined reference to `extcon_get_edev_by_phandle'
    phy-rockchip-inno-usb2.c:(.text+0x321a): undefined reference to `devm_extcon_dev_allocate'
    phy-rockchip-inno-usb2.c:(.text+0x3230): undefined reference to `devm_extcon_dev_register'
    phy-rockchip-inno-usb2.c:(.text+0x375a): undefined reference to `extcon_register_notifier'

    Found in linux-next but is also needed in mainline.

    Signed-off-by: Randy Dunlap
    Cc: MyungJoo Ham
    Cc: Chanwoo Choi
    Cc: Heiko Stuebner
    Reviewed-by: Chanwoo Choi
    Signed-off-by: Kishon Vijay Abraham I

    Randy Dunlap
     
  • This patch adds support for Broadcom NSP USB3 PHY

    Signed-off-by: Yendapally Reddy Dhananjaya Reddy
    Reviewed-by: Florian Fainelli
    Signed-off-by: Kishon Vijay Abraham I

    Yendapally Reddy Dhananjaya Reddy
     
  • The error paths of the common qcom-ufs functions for registering the
    phy, acquiring clocks and acquiring regulators all print specific error
    messages before returning an error, so there is no value in printing yet
    another - more generic - message when this occur.

    Reviewed-by: Vivek Gautam
    Reviewed-by: Subhash Jadavani
    Signed-off-by: Bjorn Andersson
    Signed-off-by: Kishon Vijay Abraham I

    Bjorn Andersson
     
  • The fact that a regulator is always-on is a property of the regulator,
    not a specific consumer. Implementing this in the driver leads to a
    system behaviour that is dependent on if the Qualcomm UFS PHY was ever
    (partially) probed.

    If the specific regulator should be always on in a particular device,
    mark it so by specifying "regulator-always-on" in the regulator node.

    Reviewed-by: Vivek Gautam
    Reviewed-by: Subhash Jadavani
    Acked-by: Rob Herring
    Signed-off-by: Bjorn Andersson
    Signed-off-by: Kishon Vijay Abraham I

    Bjorn Andersson
     
  • When regulator_get() tries to resolve a regulator supply but fail to
    find a matching property in DeviceTree it returns a dummy regulator, if
    a matching supply is specified but unavailable the regulator core will
    return an error.

    Based on this we should not ignore errors upon failing to acquire the
    optional "vddp-ref-clk" supply.

    Reviewed-by: Vivek Gautam
    Reviewed-by: Subhash Jadavani
    Signed-off-by: Bjorn Andersson
    Signed-off-by: Kishon Vijay Abraham I

    Bjorn Andersson
     
  • Upon failing to acquire regulator supplies the qcom-ufs driver calls
    kfree() on the devm allocated memory used to store the name of the
    regulator, leading to devres corruption.

    Rather than switching to using the appropriate free function the patch
    acknowledge the fact that "name" is always a constant string and we
    don't actually need to create a local copy of it, but rather just
    reference the constant string.

    Fixes: add78fc05702 ("phy: qcom-ufs: Use devm sibling of kstrdup for regulator names")
    Cc: stable@vger.kernel.org
    Reviewed-by: Subhash Jadavani
    Signed-off-by: Bjorn Andersson
    Signed-off-by: Kishon Vijay Abraham I

    Bjorn Andersson
     
  • The high-speed phy on qcom SoCs is controlled via the ULPI
    viewport.

    Cc: Kishon Vijay Abraham I
    Cc:
    Acked-by: Rob Herring
    Signed-off-by: Stephen Boyd
    Signed-off-by: Kishon Vijay Abraham I

    Stephen Boyd
     
  • The HSIC USB controller on qcom SoCs has an integrated all
    digital phy controlled via the ULPI viewport.

    Cc: Kishon Vijay Abraham I
    Acked-by: Rob Herring
    Cc:
    Signed-off-by: Stephen Boyd
    Signed-off-by: Kishon Vijay Abraham I

    Stephen Boyd
     

16 Jan, 2017

5 commits


15 Dec, 2016

1 commit

  • Pull SCSI updates from James Bottomley:
    "This update includes the usual round of major driver updates (ncr5380,
    lpfc, hisi_sas, megaraid_sas, ufs, ibmvscsis, mpt3sas).

    There's also an assortment of minor fixes, mostly in error legs or
    other not very user visible stuff. The major change is the
    pci_alloc_irq_vectors replacement for the old pci_msix_.. calls; this
    effectively makes IRQ mapping generic for the drivers and allows
    blk_mq to use the information"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (256 commits)
    scsi: qla4xxx: switch to pci_alloc_irq_vectors
    scsi: hisi_sas: support deferred probe for v2 hw
    scsi: megaraid_sas: switch to pci_alloc_irq_vectors
    scsi: scsi_devinfo: remove synchronous ALUA for NETAPP devices
    scsi: be2iscsi: set errno on error path
    scsi: be2iscsi: set errno on error path
    scsi: hpsa: fallback to use legacy REPORT PHYS command
    scsi: scsi_dh_alua: Fix RCU annotations
    scsi: hpsa: use %phN for short hex dumps
    scsi: hisi_sas: fix free'ing in probe and remove
    scsi: isci: switch to pci_alloc_irq_vectors
    scsi: ipr: Fix runaway IRQs when falling back from MSI to LSI
    scsi: dpt_i2o: double free on error path
    scsi: cxlflash: Migrate scsi command pointer to AFU command
    scsi: cxlflash: Migrate IOARRIN specific routines to function pointers
    scsi: cxlflash: Cleanup queuecommand()
    scsi: cxlflash: Cleanup send_tmf()
    scsi: cxlflash: Remove AFU command lock
    scsi: cxlflash: Wait for active AFU commands to timeout upon tear down
    scsi: cxlflash: Remove private command pool
    ...

    Linus Torvalds
     

28 Nov, 2016

1 commit


18 Nov, 2016

18 commits

  • 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
    Signed-off-by: Kishon Vijay Abraham I

    Arnd Bergmann
     
  • 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
    Signed-off-by: Kishon Vijay Abraham I

    Arnd Bergmann
     
  • Emit KOBJ_ONLINE/KOBJ_OFFLINE action uevent on VBUS status changes.

    Cc: Tony Lindgren
    Signed-off-by: Matt Ranostay
    Acked-by: Tony Lindgren
    Signed-off-by: Kishon Vijay Abraham I

    Matt Ranostay
     
  • 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
    Signed-off-by: Kishon Vijay Abraham I

    Hans de Goede
     
  • Remove unneeded variables when "0" can be returned.

    Generated by: scripts/coccinelle/misc/returnvar.cocci

    Signed-off-by: Vivek Gautam
    Cc: Kishon Vijay Abraham I
    Signed-off-by: Kishon Vijay Abraham I

    Vivek Gautam
     
  • 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
    Cc: Kishon Vijay Abraham I
    Signed-off-by: Kishon Vijay Abraham I

    Vivek Gautam
     
  • Remove unneeded semicolon.

    Generated by: coccinellery/semicolon/semicolon.cocci

    Signed-off-by: Vivek Gautam
    Cc: Kishon Vijay Abraham I
    Signed-off-by: Kishon Vijay Abraham I

    Vivek Gautam
     
  • 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
    Acked-by: Sylwester Nawrocki
    Signed-off-by: Kishon Vijay Abraham I

    Marek Szyprowski
     
  • 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
    Reviewed-by: Peter Chen
    Signed-off-by: Kishon Vijay Abraham I

    Yoshihiro Shimoda
     
  • 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
    Signed-off-by: Kishon Vijay Abraham I

    Alexandre Bailon
     
  • 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
    Acked-by: Rob Herring
    Signed-off-by: Kishon Vijay Abraham I

    Peter Griffin
     
  • 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
    Acked-by: Rob Herring
    Signed-off-by: Kishon Vijay Abraham I

    Peter Griffin
     
  • 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
    Reviewed-by: Douglas Anderson
    Signed-off-by: Kishon Vijay Abraham I

    William Wu
     
  • 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
    Reviewed-by: Douglas Anderson
    Signed-off-by: Kishon Vijay Abraham I

    William Wu
     
  • 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
    Signed-off-by: Kishon Vijay Abraham I

    William Wu
     
  • 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
    Signed-off-by: Kishon Vijay Abraham I

    Martin Blumenstingl
     
  • Fix the missing clk_disable_unprepare() before return from
    phy_meson8b_usb2_power_on() in the error handling case.

    Signed-off-by: Wei Yongjun
    Signed-off-by: Kishon Vijay Abraham I

    Wei Yongjun
     
  • This is a new driver for the USB PHY found in Meson8b and GXBB SoCs.

    Signed-off-by: Martin Blumenstingl
    Signed-off-by: Jerome Brunet
    Tested-by: Kevin Hilman
    Signed-off-by: Kishon Vijay Abraham I

    Martin Blumenstingl
     

17 Nov, 2016

1 commit

  • 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
    Tested-by: Laurent Pinchart
    Signed-off-by: Tony Lindgren
    Acked-by: Kishon Vijay Abraham I
    Signed-off-by: Bin Liu
    Signed-off-by: Greg Kroah-Hartman

    Tony Lindgren