mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
drm/mediatek: dp: Move PHY registration to new function
[ Upstream commit 18ccc237cf ]
In preparation for adding support for eDP, move the PHY registration
code to a new mtk_dp_register_phy() function for better readability.
This commit brings no functional changes.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20230725073234.55892-9-angelogioacchino.delregno@collabora.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Stable-dep-of: 8431fff9e0f3 ("drm/mediatek: dp: Fix mtk_dp_aux_transfer return value")
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0f2c694d69
commit
a5bd618458
@@ -2490,6 +2490,29 @@ static int mtk_dp_register_audio_driver(struct device *dev)
|
|||||||
return PTR_ERR_OR_ZERO(mtk_dp->audio_pdev);
|
return PTR_ERR_OR_ZERO(mtk_dp->audio_pdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int mtk_dp_register_phy(struct mtk_dp *mtk_dp)
|
||||||
|
{
|
||||||
|
struct device *dev = mtk_dp->dev;
|
||||||
|
|
||||||
|
mtk_dp->phy_dev = platform_device_register_data(dev, "mediatek-dp-phy",
|
||||||
|
PLATFORM_DEVID_AUTO,
|
||||||
|
&mtk_dp->regs,
|
||||||
|
sizeof(struct regmap *));
|
||||||
|
if (IS_ERR(mtk_dp->phy_dev))
|
||||||
|
return dev_err_probe(dev, PTR_ERR(mtk_dp->phy_dev),
|
||||||
|
"Failed to create device mediatek-dp-phy\n");
|
||||||
|
|
||||||
|
mtk_dp_get_calibration_data(mtk_dp);
|
||||||
|
|
||||||
|
mtk_dp->phy = devm_phy_get(&mtk_dp->phy_dev->dev, "dp");
|
||||||
|
if (IS_ERR(mtk_dp->phy)) {
|
||||||
|
platform_device_unregister(mtk_dp->phy_dev);
|
||||||
|
return dev_err_probe(dev, PTR_ERR(mtk_dp->phy), "Failed to get phy\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int mtk_dp_probe(struct platform_device *pdev)
|
static int mtk_dp_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct mtk_dp *mtk_dp;
|
struct mtk_dp *mtk_dp;
|
||||||
@@ -2547,23 +2570,9 @@ static int mtk_dp_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mtk_dp->phy_dev = platform_device_register_data(dev, "mediatek-dp-phy",
|
ret = mtk_dp_register_phy(mtk_dp);
|
||||||
PLATFORM_DEVID_AUTO,
|
if (ret)
|
||||||
&mtk_dp->regs,
|
return ret;
|
||||||
sizeof(struct regmap *));
|
|
||||||
if (IS_ERR(mtk_dp->phy_dev))
|
|
||||||
return dev_err_probe(dev, PTR_ERR(mtk_dp->phy_dev),
|
|
||||||
"Failed to create device mediatek-dp-phy\n");
|
|
||||||
|
|
||||||
mtk_dp_get_calibration_data(mtk_dp);
|
|
||||||
|
|
||||||
mtk_dp->phy = devm_phy_get(&mtk_dp->phy_dev->dev, "dp");
|
|
||||||
|
|
||||||
if (IS_ERR(mtk_dp->phy)) {
|
|
||||||
platform_device_unregister(mtk_dp->phy_dev);
|
|
||||||
return dev_err_probe(dev, PTR_ERR(mtk_dp->phy),
|
|
||||||
"Failed to get phy\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
mtk_dp->bridge.funcs = &mtk_dp_bridge_funcs;
|
mtk_dp->bridge.funcs = &mtk_dp_bridge_funcs;
|
||||||
mtk_dp->bridge.of_node = dev->of_node;
|
mtk_dp->bridge.of_node = dev->of_node;
|
||||||
|
|||||||
Reference in New Issue
Block a user