Commit a9d37e68 authored by Sascha Hauer's avatar Sascha Hauer Committed by Heiko Stuebner

drm/rockchip: dw_hdmi: rename vpll clock to reference clock

"vpll" is a misnomer. A clock input to a device should be named after
the usage in the device, not after the clock that drives it. On the
rk3568 the same clock is driven by the HPLL.
To fix that, this patch renames the vpll clock to ref clock. The clock
name "vpll" is left for compatibility to old device trees.
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: default avatarDmitry Osipenko <dmitry.osipenko@collabora.com>
Tested-by: default avatarMichael Riesch <michael.riesch@wolfvision.net>
Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220422072841.2206452-5-s.hauer@pengutronix.de
parent cf544c6a
...@@ -69,7 +69,7 @@ struct rockchip_hdmi { ...@@ -69,7 +69,7 @@ struct rockchip_hdmi {
struct regmap *regmap; struct regmap *regmap;
struct rockchip_encoder encoder; struct rockchip_encoder encoder;
const struct rockchip_hdmi_chip_data *chip_data; const struct rockchip_hdmi_chip_data *chip_data;
struct clk *vpll_clk; struct clk *ref_clk;
struct clk *grf_clk; struct clk *grf_clk;
struct dw_hdmi *hdmi; struct dw_hdmi *hdmi;
struct phy *phy; struct phy *phy;
...@@ -201,14 +201,15 @@ static int rockchip_hdmi_parse_dt(struct rockchip_hdmi *hdmi) ...@@ -201,14 +201,15 @@ static int rockchip_hdmi_parse_dt(struct rockchip_hdmi *hdmi)
return PTR_ERR(hdmi->regmap); return PTR_ERR(hdmi->regmap);
} }
hdmi->vpll_clk = devm_clk_get(hdmi->dev, "vpll"); hdmi->ref_clk = devm_clk_get_optional(hdmi->dev, "ref");
if (PTR_ERR(hdmi->vpll_clk) == -ENOENT) { if (!hdmi->ref_clk)
hdmi->vpll_clk = NULL; hdmi->ref_clk = devm_clk_get_optional(hdmi->dev, "vpll");
} else if (PTR_ERR(hdmi->vpll_clk) == -EPROBE_DEFER) {
if (PTR_ERR(hdmi->ref_clk) == -EPROBE_DEFER) {
return -EPROBE_DEFER; return -EPROBE_DEFER;
} else if (IS_ERR(hdmi->vpll_clk)) { } else if (IS_ERR(hdmi->ref_clk)) {
DRM_DEV_ERROR(hdmi->dev, "failed to get vpll clock\n"); DRM_DEV_ERROR(hdmi->dev, "failed to get reference clock\n");
return PTR_ERR(hdmi->vpll_clk); return PTR_ERR(hdmi->ref_clk);
} }
hdmi->grf_clk = devm_clk_get(hdmi->dev, "grf"); hdmi->grf_clk = devm_clk_get(hdmi->dev, "grf");
...@@ -262,7 +263,7 @@ static void dw_hdmi_rockchip_encoder_mode_set(struct drm_encoder *encoder, ...@@ -262,7 +263,7 @@ static void dw_hdmi_rockchip_encoder_mode_set(struct drm_encoder *encoder,
{ {
struct rockchip_hdmi *hdmi = to_rockchip_hdmi(encoder); struct rockchip_hdmi *hdmi = to_rockchip_hdmi(encoder);
clk_set_rate(hdmi->vpll_clk, adj_mode->clock * 1000); clk_set_rate(hdmi->ref_clk, adj_mode->clock * 1000);
} }
static void dw_hdmi_rockchip_encoder_enable(struct drm_encoder *encoder) static void dw_hdmi_rockchip_encoder_enable(struct drm_encoder *encoder)
...@@ -542,9 +543,9 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, ...@@ -542,9 +543,9 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
return ret; return ret;
} }
ret = clk_prepare_enable(hdmi->vpll_clk); ret = clk_prepare_enable(hdmi->ref_clk);
if (ret) { if (ret) {
DRM_DEV_ERROR(hdmi->dev, "Failed to enable HDMI vpll: %d\n", DRM_DEV_ERROR(hdmi->dev, "Failed to enable HDMI reference clock: %d\n",
ret); ret);
return ret; return ret;
} }
...@@ -563,7 +564,7 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, ...@@ -563,7 +564,7 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
if (IS_ERR(hdmi->hdmi)) { if (IS_ERR(hdmi->hdmi)) {
ret = PTR_ERR(hdmi->hdmi); ret = PTR_ERR(hdmi->hdmi);
drm_encoder_cleanup(encoder); drm_encoder_cleanup(encoder);
clk_disable_unprepare(hdmi->vpll_clk); clk_disable_unprepare(hdmi->ref_clk);
} }
return ret; return ret;
...@@ -575,7 +576,7 @@ static void dw_hdmi_rockchip_unbind(struct device *dev, struct device *master, ...@@ -575,7 +576,7 @@ static void dw_hdmi_rockchip_unbind(struct device *dev, struct device *master,
struct rockchip_hdmi *hdmi = dev_get_drvdata(dev); struct rockchip_hdmi *hdmi = dev_get_drvdata(dev);
dw_hdmi_unbind(hdmi->hdmi); dw_hdmi_unbind(hdmi->hdmi);
clk_disable_unprepare(hdmi->vpll_clk); clk_disable_unprepare(hdmi->ref_clk);
} }
static const struct component_ops dw_hdmi_rockchip_ops = { static const struct component_ops dw_hdmi_rockchip_ops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment