[PATCH v3 07/22] drm/mediatek: Provide ddc symlink in hdmi connector sysfs directory

Andrzej Pietrasiewicz
2019-06-28T16:01:21Z

drivers/gpu/drm/mediatek/mtk_hdmi.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c
index 5d6a9f094df5..6c5321dcc4b8 100644
--- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
+++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
@@ -146,7 +146,6 @@ struct mtk_hdmi {
struct device *dev;
struct phy *phy;
struct device *cec_dev;
- struct i2c_adapter *ddc_adpt;
struct clk *clk[MTK_HDMI_CLK_COUNT];
struct drm_display_mode mode;
bool dvi_mode;
@@ -1213,10 +1212,10 @@ static int mtk_hdmi_conn_get_modes(struct drm_connector *conn)
struct edid *edid;
int ret;

- if (!hdmi->ddc_adpt)
+ if (!conn->ddc)
return -ENODEV;

- edid = drm_get_edid(conn, hdmi->ddc_adpt);
+ edid = drm_get_edid(conn, conn->ddc);
if (!edid)
return -ENODEV;

@@ -1509,9 +1508,9 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
}
of_node_put(remote);

- hdmi->ddc_adpt = of_find_i2c_adapter_by_node(i2c_np);
+ hdmi->conn.ddc = of_find_i2c_adapter_by_node(i2c_np);
of_node_put(i2c_np);
- if (!hdmi->ddc_adpt) {
+ if (!hdmi->conn.ddc) {
dev_err(dev, "Failed to get ddc i2c adapter by node\n");
return -EINVAL;
}
--
2.17.1