Yuan Can
4c0255e795
phy: qcom-qmp-combo: Use dev_err_probe() to simplify code
...
In the probe path, dev_err() can be replaced with dev_err_probe()
which will check if error code is -EPROBE_DEFER and prints the
error name. It also sets the defer probe reason which can be
checked later through debugfs.
Signed-off-by: Yuan Can <yuancan@huawei.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Andrew Halaney <ahalaney@redhat.com >
Link: https://lore.kernel.org/r/20220924070300.25080-2-yuancan@huawei.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-24 13:03:49 +05:30
Johan Hovold
9d94396191
phy: qcom-qmp-combo: drop redundant DP config flag
...
Drop the DP_COM control block flag from the configuration data, which is
set for all combo PHYs and hence no longer needed since the QMP driver
split.
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://lore.kernel.org/r/20220920073826.20811-18-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-24 10:59:58 +05:30
Johan Hovold
099155615a
phy: qcom-qmp-combo: consolidate lane config
...
For legacy reasons, there are two configuration parameters that appear
to describe the number of lanes a PHY has, even if "nlanes" was actually
used for a different purpose.
Replace them both with a new field simply named "lanes".
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://lore.kernel.org/r/20220920073826.20811-15-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-24 10:59:57 +05:30
Johan Hovold
b4e9da4d96
phy: qcom-qmp: drop unused index field
...
Only the MSM8996 PCIe QMP driver uses the index field so drop it from
the other drivers.
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://lore.kernel.org/r/20220920073826.20811-12-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-24 10:59:57 +05:30
Johan Hovold
f5d6b5d613
phy: qcom-qmp-combo: fix sc8280xp PCS_USB offset
...
The PCS_USB register block lives at an offset of 0x300 from the PCS
region on SC8280XP so add the missing offset to avoid corrupting
unrelated registers on runtime suspend.
Note that this region should probably be described separately in the
binding.
Fixes: a2e927b0e5 ("phy: qcom-qmp-combo: Add sc8280xp USB/DP combo phys")
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Link: https://lore.kernel.org/r/20220919095700.2228-1-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-20 11:44:10 +05:30
Johan Hovold
064bbdba4f
phy: qcom-qmp-combo: drop unused legacy DT workaround
...
Commit 5e17b95d98 ("phy: qcom-qmp: Utilize fully-specified DT
registers") added a workaround for legacy devicetrees which did not
specify register regions for the second lane of some dual-lane PHYs.
At the time, the only two dual-lane PHYs supported by mainline were
"qcom,sdm845-qmp-usb3-phy" and "qcom,sdm845-qmp-ufs-phy", neither
of which is a combo PHY.
Drop the workaround for malformed devicetrees, which should no longer be
needed since the QMP driver split.
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Link: https://lore.kernel.org/r/20220916102340.11520-10-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-20 11:31:16 +05:30
Johan Hovold
2de8a325b1
phy: qcom-qmp-combo: fix memleak on probe deferral
...
Switch to using the device-managed of_iomap helper to avoid leaking
memory on probe deferral and driver unbind.
Note that this helper checks for already reserved regions and may fail
if there are multiple devices claiming the same memory.
Fixes: e78f3d15e1 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Link: https://lore.kernel.org/r/20220916102340.11520-5-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-20 11:31:16 +05:30
Johan Hovold
e5cedefa72
phy: qcom-qmp-combo: shorten function prefixes
...
The driver function prefix has gotten unnecessarily long and hurts
readability.
Shorten "qcom_qmp_phy_" to "qmp_" (which likely stands for "Qualcomm
Multi PHY" or similar anyway).
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20220907110728.19092-13-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-20 11:28:08 +05:30
Johan Hovold
d44c3e1a1e
phy: qcom-qmp: silence noisy probe
...
Drivers should in general not log anything during unless there are
errors.
Drop the pointless registration info message from the QMP drivers.
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20220907110728.19092-12-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-20 11:28:08 +05:30
Johan Hovold
beee6ed1d6
phy: qcom-qmp-combo: drop unused defines
...
Drop defines and enums that are unused since the QMP driver split.
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20220907110728.19092-3-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-20 11:28:07 +05:30
Johan Hovold
4382d518d1
phy: qcom-qmp-combo: disable runtime PM on unbind
...
Make sure to disable runtime PM also on driver unbind.
Fixes: ac0d239936 ("phy: qcom-qmp: Add support for runtime PM").
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20220907110728.19092-2-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-20 11:28:07 +05:30
Johan Hovold
ac439ce88e
phy: qcom-qmp: drop dual-lane comments
...
Drop the obsolete and misleading dual-lane comments which gave the
impression that only combo PHYs have a second lane.
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20220906074550.4383-4-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-09-13 20:23:36 +05:30
Johan Hovold
70e25cac53
phy: qcom-qmp-combo: drop pipe clock lane suffix
...
The pipe clock is defined in the "lane" node so there's no need to keep
adding a redundant lane-number suffix to the clock name.
Update driver to support the new binding where the pipe clock name has
been deprecated by instead requesting the clock by index.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Link: https://lore.kernel.org/r/20220830112923.3725-28-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-08-30 18:56:22 +05:30
Johan Hovold
27759490cf
phy: qcom-qmp-combo: drop unused lane reset
...
Drop the unused lane reset pointer which isn't used by any combo PHY.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Link: https://lore.kernel.org/r/20220830112923.3725-27-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-08-30 18:56:22 +05:30
Bjorn Andersson
a2e927b0e5
phy: qcom-qmp-combo: Add sc8280xp USB/DP combo phys
...
The SC8280P has two copies of an USB/DP compbo PHY, add support for this
to the Qualcomm QMP PHY driver.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
Link: https://lore.kernel.org/r/20220810042303.3583194-5-bjorn.andersson@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-08-30 13:08:03 +05:30
Bjorn Andersson
712e5dffe9
phy: qcom-qmp-combo: Parameterize swing and pre_emphasis tables
...
The swing and pre-emphasis tables differ between different PHY versions,
or perhaps between different platforms. In particular in order to
introduce SC8280XP these tables needs to be replaced.
Make it possible to specify these tables per PHY config.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
Link: https://lore.kernel.org/r/20220810042303.3583194-3-bjorn.andersson@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-08-30 13:08:03 +05:30
Dmitry Baryshkov
d88497fb6b
phy: qualcomm: phy-qcom-qmp: add support for combo USB3+DP phy on SDM845
...
Define configuration to be used by combo USB3 + DisplayPort phy on
SDM845 SoC family. It closely follows sc7180, however like the main USB3
phy it uses the qmp_v3_usb3phy_cfg config.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
Link: https://lore.kernel.org/r/20220810030926.2794179-1-bjorn.andersson@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-08-30 13:07:34 +05:30
Vinod Koul
38b6dbcc94
phy: qcom-qmp-usb: statify qmp_phy_vreg_l
...
qmp_phy_vreg_l should be marked static, this resolves warning:
drivers/phy/qualcomm/phy-qcom-qmp-combo.c:616:27: warning: symbol 'qmp_phy_vreg_l' was not declared. Should it be static?
Signed-off-by: Vinod Koul <vkoul@kernel.org >
Link: https://lore.kernel.org/r/20220708052059.3049443-1-vkoul@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-07-15 17:20:03 +05:30
Dmitry Baryshkov
c1ab64aaac
phy: qcom-qmp-usb: define QPHY_V2_PCS_PLL_LOCK_CHK_DLY_TIME register
...
Other PHYs tables directly reference QPHY_PLL_LOCK_CHK_DLY_TIME register
without using reglayout. Define corresponding register to be used by
msm8996 PHY tables and use it directly.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20220705094320.1313312-29-dmitry.baryshkov@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-07-07 10:36:01 +05:30
Dmitry Baryshkov
d36e341a17
phy: qcom-qmp-usb: replace FLL layout writes for msm8996
...
Other PHYs tables directly reference FLL registers without using
reglayout. Define corresponding registers to be used by msm8996 PHY
tables and use them directly.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20220705094320.1313312-28-dmitry.baryshkov@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-07-07 10:36:01 +05:30
Dmitry Baryshkov
6cad29831d
phy: qcom-qmp: rename QMP V2 PCS registers
...
Rename QMP V2 PCS registers to follow the usual pattern of
QPHY_V2_PCS_*.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20220705094320.1313312-7-dmitry.baryshkov@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-07-07 10:35:59 +05:30
Dmitry Baryshkov
fc64623637
phy: qcom-qmp-combo,usb: add support for separate PCS_USB region
...
Different QMP USB PHYs might have different offset from PCS to PCS_USB
register space, but the same PCS_USB register layout. Add separate
PCS_USB region space and merge related PCS_USB definitions.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20220705094320.1313312-4-dmitry.baryshkov@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-07-07 10:35:58 +05:30
Kuogee Hsieh
85936d4f38
phy: qcom-qmp: add regulator_set_load to dp phy
...
This patch add regulator_set_load() before enable regulator at
DP phy driver.
Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com >
Reviewed-by: Stephen Boyd <swboyd@chromium.org >
Reviewed-by: Douglas Anderson <dianders@chromium.org >
Link: https://lore.kernel.org/r/1657038556-2231-3-git-send-email-quic_khsieh@quicinc.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-07-07 10:35:58 +05:30
Dmitry Baryshkov
1de24861af
phy: qcom-qmp-combo: use bulk reset_control API
...
Switch qcom-qmp-combo driver to use reset_control_bulk_assert / _deassert
functions rather than hardcoding the loops in the driver itself.
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org >
Tested-by: Bjorn Andersson <bjorn.andersson@linaro.org > # UFS, PCIe and USB on SC8180X
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20220607213203.2819885-28-dmitry.baryshkov@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-06-09 23:49:42 +05:30
Dmitry Baryshkov
6066bac15b
phy: qcom-qmp-combo: cleanup the driver
...
Remove the conditionals and options that are not used by any of combo
USB+DP PHY devices.
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org >
Tested-by: Bjorn Andersson <bjorn.andersson@linaro.org > # UFS, PCIe and USB on SC8180X
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20220607213203.2819885-20-dmitry.baryshkov@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-06-09 23:49:41 +05:30
Dmitry Baryshkov
b2bac0f095
phy: qcom-qmp-combo: drop support for PCIe,UFS PHY types
...
Drop remaining support for unused PHY types (PCIe, UFS).
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org >
Tested-by: Bjorn Andersson <bjorn.andersson@linaro.org > # UFS, PCIe and USB on SC8180X
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20220607213203.2819885-15-dmitry.baryshkov@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-06-09 23:49:41 +05:30
Dmitry Baryshkov
033f3a16fb
phy: qcom-qmp-combo: change symbol prefix to qcom_qmp_phy_combo
...
Change all symbol names to start with qcom_qmp_phy_combo_ rather than old
qcom_qmp_phy_
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org >
Tested-by: Bjorn Andersson <bjorn.andersson@linaro.org > # UFS, PCIe and USB on SC8180X
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20220607213203.2819885-8-dmitry.baryshkov@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-06-09 23:49:40 +05:30
Dmitry Baryshkov
ee7ffc92a9
phy: qcom-qmp-combo: drop all non-combo compatibles support
...
Drop support for all non-USB+DP compatibles from the new qmp-combo
driver. Currently this will result in duplication (both in terms of code
and in terms of config tables) with USB PHY support. This will be sorted
out later, after fixing the combo PHY init/reinit issues.
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org >
Tested-by: Bjorn Andersson <bjorn.andersson@linaro.org > # UFS, PCIe and USB on SC8180X
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20220607213203.2819885-7-dmitry.baryshkov@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-06-09 23:49:40 +05:30
Dmitry Baryshkov
94a407cc17
phy: qcom-qmp: create copies of QMP PHY driver
...
In order to split and cleanup the single monstrous QMP PHY driver,
create blind copies of the current file. They will be used for:
- PCIe (and a separate msm8996 PCIe PHY driver)
- UFS
- USB
- Combo DP + USB
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org >
Tested-by: Bjorn Andersson <bjorn.andersson@linaro.org > # UFS, PCIe and USB on SC8180X
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20220607213203.2819885-2-dmitry.baryshkov@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2022-06-09 23:49:40 +05:30