platform/kernel/linux-starfive.git
2 years agophy: qcom-qmp-combo: Use dev_err_probe() to simplify code
Yuan Can [Sat, 24 Sep 2022 07:02:57 +0000 (07:02 +0000)]
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>
2 years agophy: qualcomm: call clk_disable_unprepare in the error handling
Dongliang Mu [Wed, 14 Sep 2022 05:13:33 +0000 (13:13 +0800)]
phy: qualcomm: call clk_disable_unprepare in the error handling

Smatch reports the following error:

drivers/phy/qualcomm/phy-qcom-usb-hsic.c:82 qcom_usb_hsic_phy_power_on()
warn: 'uphy->cal_clk' from clk_prepare_enable() not released on lines:
58.
drivers/phy/qualcomm/phy-qcom-usb-hsic.c:82 qcom_usb_hsic_phy_power_on()
warn: 'uphy->cal_sleep_clk' from clk_prepare_enable() not released on
lines: 58.
drivers/phy/qualcomm/phy-qcom-usb-hsic.c:82 qcom_usb_hsic_phy_power_on()
warn: 'uphy->phy_clk' from clk_prepare_enable() not released on lines:
58.

Fix this by calling proper clk_disable_unprepare calls.

Fixes: 0b56e9a7e835 ("phy: Group vendor specific phy drivers")
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20220914051334.69282-1-dzm91@hust.edu.cn
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: intel: Use dev_err_probe() to simplify code
Yuan Can [Thu, 22 Sep 2022 11:15:51 +0000 (11:15 +0000)]
phy: intel: 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>
Link: https://lore.kernel.org/r/20220922111551.37188-1-yuancan@huawei.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: tegra: xusb: Use dev_err_probe() to simplify code
Yuan Can [Thu, 22 Sep 2022 09:22:43 +0000 (09:22 +0000)]
phy: tegra: xusb: 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>
Link: https://lore.kernel.org/r/20220922092243.22281-1-yuancan@huawei.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-snps: Use dev_err_probe() to simplify code
Yuan Can [Thu, 22 Sep 2022 11:12:28 +0000 (11:12 +0000)]
phy: qcom-snps: 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/20220922111228.36355-8-yuancan@huawei.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qusb2: Use dev_err_probe() to simplify code
Yuan Can [Thu, 22 Sep 2022 11:12:27 +0000 (11:12 +0000)]
phy: qcom-qusb2: 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: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
Link: https://lore.kernel.org/r/20220922111228.36355-7-yuancan@huawei.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-pcie: Use dev_err_probe() to simplify code
Yuan Can [Thu, 22 Sep 2022 11:12:24 +0000 (11:12 +0000)]
phy: qcom-qmp-pcie: 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: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
Link: https://lore.kernel.org/r/20220922111228.36355-4-yuancan@huawei.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: ti: phy-j721e-wiz: fix reference leaks in wiz_probe()
Dan Carpenter [Thu, 22 Sep 2022 11:21:07 +0000 (14:21 +0300)]
phy: ti: phy-j721e-wiz: fix reference leaks in wiz_probe()

These two error paths need to call of_node_put(child_node) before
returning.

Fixes: edd473d4293a ("phy: ti: phy-j721e-wiz: add support for j7200-wiz-10g")
Fixes: 7ae14cf581f2 ("phy: ti: j721e-wiz: Implement DisplayPort mode to the wiz driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Link: https://lore.kernel.org/r/YyxFI8aW23IC/21U@kili
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: mediatek: mipi: remove register access helpers
Chunfeng Yun [Tue, 20 Sep 2022 09:00:38 +0000 (17:00 +0800)]
phy: mediatek: mipi: remove register access helpers

Remove private register access helpers, use the common ones instead.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220920090038.15133-19-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: mediatek: mipi: mt8183: use common helper to access registers
Chunfeng Yun [Tue, 20 Sep 2022 09:00:37 +0000 (17:00 +0800)]
phy: mediatek: mipi: mt8183: use common helper to access registers

Use MediaTek phy's common helper to access registers, then we can remove
mipi-dsi's I/O helpers.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220920090038.15133-18-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: mediatek: mipi: mt8183: use GENMASK to generate bits mask
Chunfeng Yun [Tue, 20 Sep 2022 09:00:36 +0000 (17:00 +0800)]
phy: mediatek: mipi: mt8183: use GENMASK to generate bits mask

Use GENMASK() macro to generate bits mask

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220920090038.15133-17-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: mediatek: mipi: mt8173: use common helper to access registers
Chunfeng Yun [Tue, 20 Sep 2022 09:00:35 +0000 (17:00 +0800)]
phy: mediatek: mipi: mt8173: use common helper to access registers

Use MediaTek phy's common helper to access registers, then we can remove
mipi-dsi's I/O helpers.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220920090038.15133-16-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: mediatek: mipi: mt8173: use FIELD_PREP to prepare bits field
Chunfeng Yun [Tue, 20 Sep 2022 09:00:34 +0000 (17:00 +0800)]
phy: mediatek: mipi: mt8173: use FIELD_PREP to prepare bits field

Use FIELD_PREP() macro to prepare bits field value, then no need define
macros of bits offset.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220920090038.15133-15-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: mediatek: mipi: mt8173: use GENMASK to generate bits mask
Chunfeng Yun [Tue, 20 Sep 2022 09:00:33 +0000 (17:00 +0800)]
phy: mediatek: mipi: mt8173: use GENMASK to generate bits mask

Use GENMASK() macro to generate bits mask

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220920090038.15133-14-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: mediatek: hdmi: remove register access helpers
Chunfeng Yun [Tue, 20 Sep 2022 09:00:32 +0000 (17:00 +0800)]
phy: mediatek: hdmi: remove register access helpers

Remove private register access helpers, use the common ones instead.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220920090038.15133-13-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: mediatek: hdmi: mt8173: use common helper to access registers
Chunfeng Yun [Tue, 20 Sep 2022 09:00:31 +0000 (17:00 +0800)]
phy: mediatek: hdmi: mt8173: use common helper to access registers

Use MediaTek phy's common helper to access registers, then we can remove
hdmi's I/O helpers.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220920090038.15133-12-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: mediatek: hdmi: mt8173: use FIELD_PREP to prepare bits field
Chunfeng Yun [Tue, 20 Sep 2022 09:00:30 +0000 (17:00 +0800)]
phy: mediatek: hdmi: mt8173: use FIELD_PREP to prepare bits field

Use FIELD_PREP() macro to prepare bits field value, then no need define
macros of bits offset.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220920090038.15133-11-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: mediatek: hdmi: mt8173: use GENMASK to generate bits mask
Chunfeng Yun [Tue, 20 Sep 2022 09:00:29 +0000 (17:00 +0800)]
phy: mediatek: hdmi: mt8173: use GENMASK to generate bits mask

Use GENMASK() macro to generate bits mask

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220920090038.15133-10-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: mediatek: hdmi: mt2701: use common helper to access registers
Chunfeng Yun [Tue, 20 Sep 2022 09:00:28 +0000 (17:00 +0800)]
phy: mediatek: hdmi: mt2701: use common helper to access registers

Use MediaTek phy's common helper to access registers, then we can remove
hdmi's I/O helpers.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220920090038.15133-9-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: mediatek: hdmi: mt2701: use FIELD_PREP to prepare bits field
Chunfeng Yun [Tue, 20 Sep 2022 09:00:27 +0000 (17:00 +0800)]
phy: mediatek: hdmi: mt2701: use FIELD_PREP to prepare bits field

Use FIELD_PREP() macro to prepare bits field value, then no need define
macros of bits offset.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220920090038.15133-8-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: mediatek: hdmi: mt2701: use GENMASK and BIT to generate mask and bits
Chunfeng Yun [Tue, 20 Sep 2022 09:00:26 +0000 (17:00 +0800)]
phy: mediatek: hdmi: mt2701: use GENMASK and BIT to generate mask and bits

Use GENMASK() and BIT() macros to generate mask and bits

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220920090038.15133-7-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: mediatek: pcie: use new helper to update register bits
Chunfeng Yun [Tue, 20 Sep 2022 09:00:25 +0000 (17:00 +0800)]
phy: mediatek: pcie: use new helper to update register bits

The new helper will use FIELD_PREP() macro to prepare bits value
according to mask, then we no need do it anymore.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220920090038.15133-6-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: mediatek: ufs: use common register access helpers
Chunfeng Yun [Tue, 20 Sep 2022 09:00:24 +0000 (17:00 +0800)]
phy: mediatek: ufs: use common register access helpers

No need define private register access helpers, use common ones defined
in phy-mtk-io.h

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220920090038.15133-5-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: mediatek: xsphy: remove macros used to prepare bitfield value
Chunfeng Yun [Tue, 20 Sep 2022 09:00:23 +0000 (17:00 +0800)]
phy: mediatek: xsphy: remove macros used to prepare bitfield value

Prefer to make use of FIELD_PREP() macro to prepare bitfield value,
then no need local ones anymore.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20220920090038.15133-4-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: mediatek: tphy: remove macros to prepare bitfield value
Chunfeng Yun [Tue, 20 Sep 2022 09:00:22 +0000 (17:00 +0800)]
phy: mediatek: tphy: remove macros to prepare bitfield value

Prefer to make use of FIELD_PREP() macro to prepare bitfield value,
then no need local ones anymore.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20220920090038.15133-3-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: mediatek: add a new helper to update bitfield
Chunfeng Yun [Tue, 20 Sep 2022 09:00:21 +0000 (17:00 +0800)]
phy: mediatek: add a new helper to update bitfield

Due to FIELD_PREP() macro can be used to prepare a bitfield value,
local ones can be remove; add the new helper to make bitfield update
easier.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20220920090038.15133-2-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-combo: drop redundant DP config flag
Johan Hovold [Tue, 20 Sep 2022 07:38:26 +0000 (09:38 +0200)]
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>
2 years agophy: qcom-qmp-usb: consolidate lane config
Johan Hovold [Tue, 20 Sep 2022 07:38:25 +0000 (09:38 +0200)]
phy: qcom-qmp-usb: 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-17-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-ufs: consolidate lane config
Johan Hovold [Tue, 20 Sep 2022 07:38:24 +0000 (09:38 +0200)]
phy: qcom-qmp-ufs: consolidate lane config

For legacy reasons, there are two configuration parameters that describe
the number of lanes a PHY has.

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-16-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-combo: consolidate lane config
Johan Hovold [Tue, 20 Sep 2022 07:38:23 +0000 (09:38 +0200)]
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>
2 years agophy: qcom-qmp-pcie-msm8996: rename nlanes config
Johan Hovold [Tue, 20 Sep 2022 07:38:22 +0000 (09:38 +0200)]
phy: qcom-qmp-pcie-msm8996: rename nlanes config

The nlanes configuration parameter is really the number of PHYs provided
by this QMP block on MSM8996. Rename it accordingly.

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-14-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-pcie: consolidate lane config
Johan Hovold [Tue, 20 Sep 2022 07:38:21 +0000 (09:38 +0200)]
phy: qcom-qmp-pcie: consolidate lane config

For legacy reasons, there are two configuration parameters that describe
the number of lanes a PHY has.

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-13-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp: drop unused index field
Johan Hovold [Tue, 20 Sep 2022 07:38:20 +0000 (09:38 +0200)]
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>
2 years agophy: qcom-qmp-pcie: drop unused config field
Johan Hovold [Tue, 20 Sep 2022 07:38:19 +0000 (09:38 +0200)]
phy: qcom-qmp-pcie: drop unused config field

Drop the unused mask_com_pcs_ready field from struct qmp_phy_cfg.

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-11-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-pcie: drop unused mode field
Johan Hovold [Tue, 20 Sep 2022 07:38:18 +0000 (09:38 +0200)]
phy: qcom-qmp-pcie: drop unused mode field

Drop the unused mode field from struct qmp_phy.

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-10-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-pcie-msm8996: drop unused kernel doc
Johan Hovold [Tue, 20 Sep 2022 07:38:17 +0000 (09:38 +0200)]
phy: qcom-qmp-pcie-msm8996: drop unused kernel doc

Drop the removed mode field from the struct qmp_phy kernel doc.

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-9-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp: drop unused forward declarations
Johan Hovold [Tue, 20 Sep 2022 07:38:16 +0000 (09:38 +0200)]
phy: qcom-qmp: drop unused forward declarations

Only the combo QMP driver needs a forward declaration of struct qmp_phy.

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-8-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-usb: drop init and exit wrappers
Johan Hovold [Tue, 20 Sep 2022 07:38:15 +0000 (09:38 +0200)]
phy: qcom-qmp-usb: drop init and exit wrappers

Drop the unnecessary PHY init and exit callback wrappers.

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-7-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-pcie: drop init and exit wrappers
Johan Hovold [Tue, 20 Sep 2022 07:38:14 +0000 (09:38 +0200)]
phy: qcom-qmp-pcie: drop init and exit wrappers

Drop the unnecessary PHY init and exit callback wrappers.

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-6-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-usb: drop unused type from config
Johan Hovold [Tue, 20 Sep 2022 07:38:13 +0000 (09:38 +0200)]
phy: qcom-qmp-usb: drop unused type from config

The configuration PHY type is no longer needed since the QMP driver
split so drop it from the configuration and suspend callbacks.

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-5-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-ufs: drop unused type from config
Johan Hovold [Tue, 20 Sep 2022 07:38:12 +0000 (09:38 +0200)]
phy: qcom-qmp-ufs: drop unused type from config

The configuration PHY type is no longer used since the QMP driver split
so drop it from the configuration.

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-4-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-pcie-msm8996: drop unused type from config
Johan Hovold [Tue, 20 Sep 2022 07:38:11 +0000 (09:38 +0200)]
phy: qcom-qmp-pcie-msm8996: drop unused type from config

The configuration PHY type is no longer used since the QMP driver split
so drop it from the configuration.

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-3-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-pcie: drop unused type from config
Johan Hovold [Tue, 20 Sep 2022 07:38:10 +0000 (09:38 +0200)]
phy: qcom-qmp-pcie: drop unused type from config

The configuration PHY type is no longer used since the QMP driver split
so drop it from the configurations.

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-2-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: ti: phy-j721e-wiz: stop name conflict if multiple serdes are initialized
Matt Ranostay [Fri, 9 Sep 2022 20:00:26 +0000 (13:00 -0700)]
phy: ti: phy-j721e-wiz: stop name conflict if multiple serdes are initialized

When multiple serdes instances are initialized the first will succeed but
additional will conflict over clocks names and probing fails.

Signed-off-by: Matt Ranostay <mranostay@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Link: https://lore.kernel.org/r/20220909200026.3422-1-mranostay@ti.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: phy-mtk-tphy: fix the phy type setting issue
Chunfeng Yun [Wed, 14 Sep 2022 06:07:46 +0000 (14:07 +0800)]
phy: phy-mtk-tphy: fix the phy type setting issue

The PHY type is not set if the index is non zero, prepare type
value according to the index, like as mask value.

Fixes: 39099a443358 ("phy: phy-mtk-tphy: support type switch by pericfg")
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220914060746.10004-7-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: phy-mtk-tphy: set utmi 0 register in init() ops
Chunfeng Yun [Wed, 14 Sep 2022 06:07:45 +0000 (14:07 +0800)]
phy: phy-mtk-tphy: set utmi 0 register in init() ops

No need repeat to clear utmi 0 register in ->power_on() and
->power_off(), just do it in ->init()

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220914060746.10004-6-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: phy-mtk-tphy: disable gpio mode for all usb2 phys
Chunfeng Yun [Wed, 14 Sep 2022 06:07:44 +0000 (14:07 +0800)]
phy: phy-mtk-tphy: disable gpio mode for all usb2 phys

Disable DP/DM's GPIO mode for all usb2 phy, not only for the first
usb2 phy which usually supports dual-role mode.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220914060746.10004-5-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: phy-mtk-tphy: disable hardware efuse when set INTR
Chunfeng Yun [Wed, 14 Sep 2022 06:07:43 +0000 (14:07 +0800)]
phy: phy-mtk-tphy: disable hardware efuse when set INTR

INTR's value is able autoload from hardware efuse by default, when
software tries to update its value, should disable hardware efuse
firstly.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20220914060746.10004-4-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: phy-mtk-tphy: add property to set pre-emphasis
Chunfeng Yun [Wed, 14 Sep 2022 06:07:42 +0000 (14:07 +0800)]
phy: phy-mtk-tphy: add property to set pre-emphasis

Add a property to set usb2 phy's pre-emphasis, it's disabled by default
on some SoCs.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220914060746.10004-3-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agodt-bindings: phy: mediatek,tphy: add property to set pre-emphasis
Chunfeng Yun [Wed, 14 Sep 2022 06:07:41 +0000 (14:07 +0800)]
dt-bindings: phy: mediatek,tphy: add property to set pre-emphasis

Add a property to set usb2 phy's pre-emphasis, which used to widen eye
opening and boost eye swing.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20220914060746.10004-2-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agodt-bindings: phy: mediatek,tphy: add support type of SGMII
Chunfeng Yun [Wed, 14 Sep 2022 06:07:40 +0000 (14:07 +0800)]
dt-bindings: phy: mediatek,tphy: add support type of SGMII

Add support ethernet SGMII, forgot to update type supported.

Fixes: c01608b3b46b ("dt-bindings: phy: mediatek: tphy: support type switch by pericfg")
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20220914060746.10004-1-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: rockchip-snps-pcie3: Use devm_platform_get_and_ioremap_resource()
Yang Yingliang [Wed, 14 Sep 2022 13:37:28 +0000 (21:37 +0800)]
phy: rockchip-snps-pcie3: Use devm_platform_get_and_ioremap_resource()

Use devm_platform_get_and_ioremap_resource() to simplify
code.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220914133728.3781160-1-yangyingliang@huawei.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: amlogic: phy-meson-axg-mipi-pcie-analog: Hold reference returned by of_get_parent()
Liang He [Thu, 15 Sep 2022 09:35:06 +0000 (17:35 +0800)]
phy: amlogic: phy-meson-axg-mipi-pcie-analog: Hold reference returned by of_get_parent()

As the of_get_parent() will increase the refcount of the node->parent
and the reference will be discarded, so we should hold the reference
with which we can decrease the refcount when done.

Fixes: 8eff8b4e22d9 ("phy: amlogic: phy-meson-axg-mipi-pcie-analog: add support for MIPI DSI analog")
Signed-off-by: Liang He <windhl@126.com>
Link: https://lore.kernel.org/r/20220915093506.4009456-1-windhl@126.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agodt-bindings: phy: renesas,rcar-gen2-usb-phy: Convert to json-schema
Geert Uytterhoeven [Wed, 14 Sep 2022 14:17:37 +0000 (16:17 +0200)]
dt-bindings: phy: renesas,rcar-gen2-usb-phy: Convert to json-schema

Convert the Renesas R-Car Gen2 USB PHY Device Tree binding documentation
to json-schema.

Add missing properties.
Rename the device node from "usb-phy" to "usb-phy-controller", as it
does not represent a USB PHY itself, and thus does not have a
"#phy-cells" property.
Rename the child nodes from "usb-channel" to "usb-phy", as these do
represent USB PHYs.
Drop the second example, as it doesn't add any value.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/dbdcffd009302734fe2fb895ce04b72fa1ea4355.1663165000.git.geert+renesas@glider.be
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-combo: fix sc8280xp PCS_USB offset
Johan Hovold [Mon, 19 Sep 2022 09:57:00 +0000 (11:57 +0200)]
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: a2e927b0e50d ("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>
2 years agophy: rockchip: inno-dsidphy: Add support for rk3568
Chris Morgan [Mon, 19 Sep 2022 16:46:15 +0000 (11:46 -0500)]
phy: rockchip: inno-dsidphy: Add support for rk3568

Add support for the Rockchip RK3568 DSI-DPHY. Registers were taken from
the BSP kernel driver and wherever possible cross referenced with the
TRM.

Refactor the code to allow the different compatible strings to set
either a max 1GHz timing table (all existing hardware) or a max 2.5GHz
timing table (the new RK356x). This works (for me) on both an RK3326
(PX30) and a new RK3566 device.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Link: https://lore.kernel.org/r/20220919164616.12492-3-macroalpha82@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agodt-bindings: phy-rockchip-inno-dsidphy: add compatible for rk3568
Chris Morgan [Mon, 19 Sep 2022 16:46:14 +0000 (11:46 -0500)]
dt-bindings: phy-rockchip-inno-dsidphy: add compatible for rk3568

Add a compatible string for the rk3568 dsi-dphy.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20220919164616.12492-2-macroalpha82@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agodt-bindings: phy: qcom,qmp-ufs: Fix SM6115 clocks, regs
Iskren Chernev [Mon, 19 Sep 2022 18:06:15 +0000 (21:06 +0300)]
dt-bindings: phy: qcom,qmp-ufs: Fix SM6115 clocks, regs

The Sm6115 UFS PHY has 2 clocks and 3 regs.

Signed-off-by: Iskren Chernev <iskren.chernev@gmail.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220919180618.1840194-6-iskren.chernev@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-usb: drop legacy DT workaround
Johan Hovold [Fri, 16 Sep 2022 10:23:40 +0000 (12:23 +0200)]
phy: qcom-qmp-usb: drop legacy DT workaround

Commit 5e17b95d9893 ("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" and they had
been added to the binding less than six months before the binding was
fixed.

Presumably no one is using four-year old SDM845 dtbs with mainline
anymore so drop the workaround for malformed devicetrees. In the
unlikely event that anyone complains, we can consider reverting.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20220916102340.11520-12-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-ufs: drop legacy DT workaround
Johan Hovold [Fri, 16 Sep 2022 10:23:39 +0000 (12:23 +0200)]
phy: qcom-qmp-ufs: drop legacy DT workaround

Commit 5e17b95d9893 ("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" and they had
been added to the binding less than six months before the binding was
fixed.

Presumably no one is using four-year old SDM845 dtbs with mainline
anymore so drop the workaround for malformed devicetrees. In the
unlikely event that anyone complains, we can consider reverting.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20220916102340.11520-11-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-combo: drop unused legacy DT workaround
Johan Hovold [Fri, 16 Sep 2022 10:23:38 +0000 (12:23 +0200)]
phy: qcom-qmp-combo: drop unused legacy DT workaround

Commit 5e17b95d9893 ("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>
2 years agophy: qcom-qmp-pcie: drop unused legacy DT workaround
Johan Hovold [Fri, 16 Sep 2022 10:23:37 +0000 (12:23 +0200)]
phy: qcom-qmp-pcie: drop unused legacy DT workaround

Commit 5e17b95d9893 ("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 PCIe 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-9-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-pcie-msm8996: drop unused pcs_misc handling
Johan Hovold [Fri, 16 Sep 2022 10:23:36 +0000 (12:23 +0200)]
phy: qcom-qmp-pcie-msm8996: drop unused pcs_misc handling

The MSM8996 QMP PHY driver does not use the PCS_MISC IO region (and
neither do the DT binding specify it) so remove the corresponding code
from the driver.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20220916102340.11520-8-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-usb: fix memleak on probe deferral
Johan Hovold [Fri, 16 Sep 2022 10:23:35 +0000 (12:23 +0200)]
phy: qcom-qmp-usb: 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.

Two bindings currently rely on overlapping mappings for the PCS region
so fallback to non-exclusive mappings for those for now.

Fixes: e78f3d15e115 ("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-7-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-ufs: fix memleak on probe deferral
Johan Hovold [Fri, 16 Sep 2022 10:23:34 +0000 (12:23 +0200)]
phy: qcom-qmp-ufs: 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: e78f3d15e115 ("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-6-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-combo: fix memleak on probe deferral
Johan Hovold [Fri, 16 Sep 2022 10:23:33 +0000 (12:23 +0200)]
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: e78f3d15e115 ("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>
2 years agophy: qcom-qmp-pcie-msm8996: fix memleak on probe deferral
Johan Hovold [Fri, 16 Sep 2022 10:23:32 +0000 (12:23 +0200)]
phy: qcom-qmp-pcie-msm8996: 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: e78f3d15e115 ("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-4-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-pcie: fix memleak on probe deferral
Johan Hovold [Fri, 16 Sep 2022 10:23:31 +0000 (12:23 +0200)]
phy: qcom-qmp-pcie: 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: e78f3d15e115 ("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-3-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-pcie: add pcs_misc sanity check
Johan Hovold [Fri, 16 Sep 2022 10:23:30 +0000 (12:23 +0200)]
phy: qcom-qmp-pcie: add pcs_misc sanity check

Make sure that the (otherwise) optional pcs_misc IO region has been
provided in case the configuration specifies a corresponding
initialisation table to avoid crashing with malformed device trees.

Note that the related debug message is now superfluous as the region is
only used when the configuration has a pcs_misc table.

Fixes: 421c9a0e9731 ("phy: qcom: qmp: Add SDM845 PCIe QMP PHY support")
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20220916102340.11520-2-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-usb: shorten function prefixes
Johan Hovold [Wed, 7 Sep 2022 11:07:28 +0000 (13:07 +0200)]
phy: qcom-qmp-usb: 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-17-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-ufs: shorten function prefixes
Johan Hovold [Wed, 7 Sep 2022 11:07:27 +0000 (13:07 +0200)]
phy: qcom-qmp-ufs: 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-16-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-pcie-msm8996: shorten function prefixes
Johan Hovold [Wed, 7 Sep 2022 11:07:26 +0000 (13:07 +0200)]
phy: qcom-qmp-pcie-msm8996: 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-15-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-pcie-msm8996: drop unused secondary init tables
Johan Hovold [Wed, 7 Sep 2022 11:07:25 +0000 (13:07 +0200)]
phy: qcom-qmp-pcie-msm8996: drop unused secondary init tables

Drop the secondary register initialisation tables which aren't used by
this driver.

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-14-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-combo: shorten function prefixes
Johan Hovold [Wed, 7 Sep 2022 11:07:24 +0000 (13:07 +0200)]
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>
2 years agophy: qcom-qmp: silence noisy probe
Johan Hovold [Wed, 7 Sep 2022 11:07:23 +0000 (13:07 +0200)]
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>
2 years agophy: qcom-qmp-usb: drop unused defines
Johan Hovold [Wed, 7 Sep 2022 11:07:22 +0000 (13:07 +0200)]
phy: qcom-qmp-usb: drop unused defines

Drop defines and enums that are unused since the QMP driver split.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20220907110728.19092-11-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-usb: disable runtime PM on unbind
Johan Hovold [Wed, 7 Sep 2022 11:07:21 +0000 (13:07 +0200)]
phy: qcom-qmp-usb: disable runtime PM on unbind

Make sure to disable runtime PM also on driver unbind.

Fixes: ac0d239936bd ("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-10-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-ufs: drop unused defines
Johan Hovold [Wed, 7 Sep 2022 11:07:20 +0000 (13:07 +0200)]
phy: qcom-qmp-ufs: drop unused defines

Drop defines and enums that are unused since the QMP driver split.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20220907110728.19092-9-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-ufs: drop unused runtime PM implementation
Johan Hovold [Wed, 7 Sep 2022 11:07:19 +0000 (13:07 +0200)]
phy: qcom-qmp-ufs: drop unused runtime PM implementation

Drop the unused and incomplete runtime PM implementation, which was
only used by USB PHYs before splitting the QMP driver.

Note that the runtime PM was never disabled (and state restored) on
driver unbind.

This effectively reverts commit ac0d239936bd ("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-8-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-pcie-msm8996: drop unused defines
Johan Hovold [Wed, 7 Sep 2022 11:07:18 +0000 (13:07 +0200)]
phy: qcom-qmp-pcie-msm8996: drop unused defines

Drop defines and enums that are unused since the QMP driver split.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20220907110728.19092-7-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-pcie-msm8996: drop unused runtime PM implementation
Johan Hovold [Wed, 7 Sep 2022 11:07:17 +0000 (13:07 +0200)]
phy: qcom-qmp-pcie-msm8996: drop unused runtime PM implementation

Drop the unused and incomplete runtime PM implementation, which was
only used by USB PHYs before splitting the QMP driver.

Note that the runtime PM was never disabled (and state restored) on
driver unbind.

This effectively reverts commit ac0d239936bd ("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-6-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-pcie: drop unused defines
Johan Hovold [Wed, 7 Sep 2022 11:07:16 +0000 (13:07 +0200)]
phy: qcom-qmp-pcie: 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-5-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-pcie: drop unused runtime PM implementation
Johan Hovold [Wed, 7 Sep 2022 11:07:15 +0000 (13:07 +0200)]
phy: qcom-qmp-pcie: drop unused runtime PM implementation

Drop the unused and incomplete runtime PM implementation, which was
only used by USB PHYs before splitting the QMP driver.

Note that the runtime PM was never disabled (and state restored) on
driver unbind.

This effectively reverts commit ac0d239936bd ("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-4-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-combo: drop unused defines
Johan Hovold [Wed, 7 Sep 2022 11:07:14 +0000 (13:07 +0200)]
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>
2 years agophy: qcom-qmp-combo: disable runtime PM on unbind
Johan Hovold [Wed, 7 Sep 2022 11:07:13 +0000 (13:07 +0200)]
phy: qcom-qmp-combo: disable runtime PM on unbind

Make sure to disable runtime PM also on driver unbind.

Fixes: ac0d239936bd ("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>
2 years agophy: ti: gmii-sel: Add support for CPSW5G GMII SEL in J7200
Siddharth Vadapalli [Mon, 12 Sep 2022 08:56:50 +0000 (14:26 +0530)]
phy: ti: gmii-sel: Add support for CPSW5G GMII SEL in J7200

Each of the CPSW5G ports in J7200 support additional modes like QSGMII.
Add a new compatible for J7200 to support the additional modes.

In TI's J7200, each of the CPSW5G ethernet interfaces can act as a
QSGMII or QSGMII-SUB port. The QSGMII interface is responsible for
performing auto-negotiation between the MAC and the PHY while the rest of
the interfaces are designated as QSGMII-SUB interfaces, indicating that
they will not be taking part in the auto-negotiation process.

To indicate the interface which will serve as the main QSGMII interface,
add a property "ti,qsgmii-main-ports", whose value indicates the
port number of the interface which shall serve as the main QSGMII
interface. The rest of the interfaces are then assigned QSGMII-SUB mode by
default. The property "ti,qsgmii-main-ports" is used to configure the
CTRLMMR_ENETx_CTRL register.

Depending on the device, it is possible for more than one QSGMII main port
to exist. Thus, the property "ti,qsgmii-main-ports" is defined as an array
of values in order to reuse the property for other devices.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Link: https://lore.kernel.org/r/20220912085650.83263-4-s-vadapalli@ti.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agodt-bindings: phy: ti: phy-gmii-sel: Add bindings for J7200
Siddharth Vadapalli [Mon, 12 Sep 2022 08:56:49 +0000 (14:26 +0530)]
dt-bindings: phy: ti: phy-gmii-sel: Add bindings for J7200

TI's J7200 SoC supports additional PHY modes like QSGMII and SGMII
that are not supported on earlier SoCs. Add a compatible for it.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220912085650.83263-3-s-vadapalli@ti.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agodt-bindings: phy: ti: phy-gmii-sel: Cleanup example
Siddharth Vadapalli [Mon, 12 Sep 2022 08:56:48 +0000 (14:26 +0530)]
dt-bindings: phy: ti: phy-gmii-sel: Cleanup example

Change node name in example from "phy-gmii-sel" to "phy", following the
device-tree convention of using generic node names.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220912085650.83263-2-s-vadapalli@ti.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agodt-bindings: phy: phy-rockchip-inno-usb2: add rockchip,rk3128-usb2phy
Johan Jonker [Fri, 9 Sep 2022 22:01:45 +0000 (00:01 +0200)]
dt-bindings: phy: phy-rockchip-inno-usb2: add rockchip,rk3128-usb2phy

Add rockchip,rk3128-usb2phy compatible string.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/d477a077-a68f-e752-5192-807db80a9e68@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agodt-bindings: phy: ocelot-serdes: convert to YAML
Colin Foster [Sun, 11 Sep 2022 16:37:15 +0000 (09:37 -0700)]
dt-bindings: phy: ocelot-serdes: convert to YAML

Convert the phy-ocelot-serdes device tree binding to the new YAML format.

Additionally, add the file to MAINTAINERS since the original file didn't
exist.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220911163715.4036144-2-colin.foster@in-advantage.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: usb: sunplus: Fix return value check in update_disc_vol()
Wei Yongjun [Fri, 9 Sep 2022 09:47:09 +0000 (09:47 +0000)]
phy: usb: sunplus: Fix return value check in update_disc_vol()

In case of error, the function nvmem_cell_read() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().

Fixes: 99d9ccd97385 ("phy: usb: Add USB2.0 phy driver for Sunplus SP7021")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20220909094709.1790970-1-weiyongjun@huaweicloud.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-snps: Add support for overriding phy tuning parameters
Krishna Kurapati [Tue, 6 Sep 2022 16:15:32 +0000 (21:45 +0530)]
phy: qcom-snps: Add support for overriding phy tuning parameters

Add support for overriding electrical signal tuning parameters for
SNPS HS Phy.

Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/1662480933-12326-3-git-send-email-quic_kriskura@quicinc.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agodt-bindings: phy: qcom,usb-snps-femto-v2: Add phy override params bindings
Sandeep Maheswaram [Tue, 6 Sep 2022 16:15:31 +0000 (21:45 +0530)]
dt-bindings: phy: qcom,usb-snps-femto-v2: Add phy override params bindings

Add device tree bindings for SNPS phy tuning parameters.

Signed-off-by: Sandeep Maheswaram <quic_c_sanm@quicinc.com>
Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/1662480933-12326-2-git-send-email-quic_kriskura@quicinc.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp: drop dual-lane comments
Johan Hovold [Tue, 6 Sep 2022 07:45:50 +0000 (09:45 +0200)]
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>
2 years agophy: qcom-qmp-pcie: shorten function prefixes
Johan Hovold [Tue, 6 Sep 2022 07:45:49 +0000 (09:45 +0200)]
phy: qcom-qmp-pcie: 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/20220906074550.4383-3-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: qcom-qmp-pcie: drop if (table) conditions
Dmitry Baryshkov [Tue, 6 Sep 2022 07:45:48 +0000 (09:45 +0200)]
phy: qcom-qmp-pcie: drop if (table) conditions

Drop unused if (table) conditions, since the function
qcom_qmp_phy_pcie_configure_lane() has this check anyway.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20220906074550.4383-2-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agodt-bindings: phy: qcom,qmp-usb3-dp: add missing power-domains property
Johan Hovold [Fri, 2 Sep 2022 08:07:05 +0000 (10:07 +0200)]
dt-bindings: phy: qcom,qmp-usb3-dp: add missing power-domains property

At least the "qcom,sc8280xp-qmp-usb43dp-phy" binding requires a power
domain to be specified.

Fixes: aa27597e594c ("dt-bindings: phy: qcom,qmp: Add compatible for SC8280XP USB phys")
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220902080705.12050-3-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agodt-bindings: phy: qcom,qmp-usb: add missing power-domains property
Johan Hovold [Fri, 2 Sep 2022 08:07:04 +0000 (10:07 +0200)]
dt-bindings: phy: qcom,qmp-usb: add missing power-domains property

At least the "sc8280xp-qmp-usb3-uni-phy" binding requires a power domain
to be specified.

Fixes: aa27597e594c ("dt-bindings: phy: qcom,qmp: Add compatible for SC8280XP USB phys")
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220902080705.12050-2-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: Add RGMII support on lan966x
Horatiu Vultur [Thu, 1 Sep 2022 12:14:55 +0000 (14:14 +0200)]
phy: Add RGMII support on lan966x

The serdes driver contains also a mux to decide which interface type to
use. Currently the driver supports GMII/SGMII/QSGMII and partially RGMII.
As it doesn't support all the other RGMII interfaces like
RGMII_TXID/RXID/ID and it could run only at 1G.
Therefore extend this for all the other speeds(10/100) and also allow
the other interfaces.

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Link: https://lore.kernel.org/r/20220901121455.245103-1-horatiu.vultur@microchip.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2 years agophy: rockchip-inno-usb2: Return zero after otg sync
Peter Geis [Fri, 2 Sep 2022 18:45:42 +0000 (14:45 -0400)]
phy: rockchip-inno-usb2: Return zero after otg sync

The otg sync state patch reuses the ret variable, but fails to set it to
zero after use. This leads to a situation when the otg port is in
peripheral mode where the otg phy aborts halfway through setup.  It also
fails to account for a failure to register the extcon notifier. Fix this
by using our own variable and skipping otg sync in case of failure.

Fixes: 8dc60f8da22f ("phy: rockchip-inno-usb2: Sync initial otg state")
Reported-by: Markus Reichl <m.reichl@fivetechno.de>
Reported-by: Michael Riesch <michael.riesch@wolfvision.net>
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Tested-by: Michael Riesch <michael.riesch@wolfvision.net>
Tested-by: Markus Reichl <m.reichl@fivetechno.de>
Reviewed-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20220902184543.1234835-1-pgwipeout@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>