linux/drivers/phy/qualcomm
Stephen Boyd 52e013d0bf phy: qcom-qmp: Add support for DP in USB3+DP combo phy
Add support for the USB3 + DisplayPort (DP) "combo" phy to the qmp phy
driver. We already have support for the USB3 part of the combo phy, so
most additions are for the DP phy.

Split up the qcom_qmp_phy{enable,disable}() functions into the phy init,
power on, power off, and exit functions that the common phy framework
expects so that the DP phy can add even more phy ops like
phy_calibrate() and phy_configure(). This allows us to initialize the DP
PHY and configure the AUX channel before powering on the PHY at the link
rate that was negotiated during link training.

The general design is as follows:

  1) DP controller calls phy_init() to initialize the PHY and configure
  the dp_com register region.

  2) DP controller calls phy_configure() to tune the link rate and
  voltage swing and pre-emphasis settings.

  3) DP controller calls phy_power_on() to enable the PLL and power on
  the phy.

  4) DP controller calls phy_configure() again to tune the voltage swing
  and pre-emphasis settings determind during link training.

  5) DP controller calls phy_calibrate() some number of times to change
  the aux settings if the aux channel times out during link training.

  6) DP controller calls phy_power_off() if the link rate is to be
  changed and goes back to step 2 to try again at a different link rate.

  5) DP controller calls phy_power_off() and then phy_exit() to power
  down the PHY when it is done.

The DP PHY contains a PLL that is different from the one used for the
USB3 PHY. Instead of a pipe clk there is a link clk and a pixel clk
output from the DP PLL after going through various dividers. Introduce
clk ops for these two clks that just tell the child clks what the
frequency of the pixel and link are. When the phy link rate is
configured we call clk_set_rate() to update the child clks in the
display clk controller on what rate is in use. The clk frequencies
always differ based on the link rate (i.e. 1.6Gb/s 2.7Gb/s, 5.4Gb/s, or
8.1Gb/s corresponding to various transmission modes like HBR1, HBR2 or
HBR3) so we simply store the link rate and use that to calculate the clk
frequencies.

The PLL enable sequence is a little different from other QMP phy PLLs so
we power on the PLL in qcom_qmp_phy_configure_dp_phy() that gets called
from phy_power_on(). This should probably be split out better so that
each phy has a way to run the final PLL/PHY enable sequence.

This code is based on a submission of this phy and PLL in the drm
subsystem.

Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Cc: Jeykumar Sankaran <jsanka@codeaurora.org>
Cc: Chandan Uddaraju <chandanu@codeaurora.org>
Cc: Vara Reddy <varar@codeaurora.org>
Cc: Tanmay Shah <tanmay@codeaurora.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Manu Gautam <mgautam@codeaurora.org>
Cc: Sandeep Maheswaram <sanm@codeaurora.org>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Jonathan Marek <jonathan@marek.ca>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Rob Clark <robdclark@chromium.org>
Link: https://lore.kernel.org/r/20200609034623.10844-1-tanmay@codeaurora.org
Link: https://lore.kernel.org/r/20200916231202.3637932-8-swboyd@chromium.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-09-28 11:27:53 +05:30
..
Kconfig phy: qualcomm: add qcom ipq806x dwc usb phy driver 2020-07-20 11:54:03 +05:30
Makefile phy: qualcomm: add qcom ipq806x dwc usb phy driver 2020-07-20 11:54:03 +05:30
phy-ath79-usb.c phy: ath79-usb: Fix the main reset name to match the DT binding 2019-01-16 18:00:57 +05:30
phy-qcom-apq8064-sata.c phy: phy-qcom-apq8064-sata: convert to readl_relaxed_poll_timeout() 2020-09-08 09:56:11 +05:30
phy-qcom-ipq806x-sata.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
phy-qcom-ipq806x-usb.c phy: qualcomm: fix return value check in qcom_ipq806x_usb_phy_probe() 2020-08-17 09:37:12 +05:30
phy-qcom-ipq4019-usb.c phy: qcom-ipq4019-usb: Constify static phy_ops structs 2020-08-31 14:36:37 +05:30
phy-qcom-pcie2.c phy: qcom: Add Qualcomm PCIe2 PHY driver 2019-05-31 19:41:13 +05:30
phy-qcom-qmp.c phy: qcom-qmp: Add support for DP in USB3+DP combo phy 2020-09-28 11:27:53 +05:30
phy-qcom-qmp.h phy: qcom-qmp: Add support for DP in USB3+DP combo phy 2020-09-28 11:27:53 +05:30
phy-qcom-qusb2.c phy: qcom-qusb2: Add ipq8074 device compatible 2020-06-24 22:48:00 +05:30
phy-qcom-snps-femto-v2.c phy: qcom-snps: Add a set mode callback 2020-06-29 15:15:56 +05:30
phy-qcom-usb-hs-28nm.c phy: qualcomm: usb-hs-28nm: Prepare clocks in init 2020-04-30 12:10:49 +05:30
phy-qcom-usb-hs.c phy: qcom-usb-hs: Fix extcon double register after power cycle 2019-10-31 16:54:01 +05:30
phy-qcom-usb-hsic.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
phy-qcom-usb-ss.c phy: qualcomm: usb: Add SuperSpeed PHY driver 2020-03-20 19:34:29 +05:30