diff mbox series

[v3,09/22] drm/imx: imx-ldb: Provide ddc symlink in connector's sysfs

Message ID c73f0b5c89797584e0bdf7feee1560d7a4c4cec1.1561735433.git.andrzej.p@collabora.com (mailing list archive)
State New, archived
Headers show
Series [v3,01/22] drm: Include ddc adapter pointer in struct drm_connector | expand

Commit Message

Andrzej Pietrasiewicz June 28, 2019, 4:01 p.m. UTC
Use the ddc pointer provided by the generic connector.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
---
 drivers/gpu/drm/imx/imx-ldb.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
index 383733302280..44fdb264339e 100644
--- a/drivers/gpu/drm/imx/imx-ldb.c
+++ b/drivers/gpu/drm/imx/imx-ldb.c
@@ -55,7 +55,6 @@  struct imx_ldb_channel {
 	struct drm_bridge *bridge;
 
 	struct device_node *child;
-	struct i2c_adapter *ddc;
 	int chno;
 	void *edid;
 	int edid_len;
@@ -131,8 +130,8 @@  static int imx_ldb_connector_get_modes(struct drm_connector *connector)
 			return num_modes;
 	}
 
-	if (!imx_ldb_ch->edid && imx_ldb_ch->ddc)
-		imx_ldb_ch->edid = drm_get_edid(connector, imx_ldb_ch->ddc);
+	if (!imx_ldb_ch->edid && connector->ddc)
+		imx_ldb_ch->edid = drm_get_edid(connector, connector->ddc);
 
 	if (imx_ldb_ch->edid) {
 		drm_connector_update_edid_property(connector,
@@ -550,15 +549,15 @@  static int imx_ldb_panel_ddc(struct device *dev,
 
 	ddc_node = of_parse_phandle(child, "ddc-i2c-bus", 0);
 	if (ddc_node) {
-		channel->ddc = of_find_i2c_adapter_by_node(ddc_node);
+		channel->connector.ddc = of_find_i2c_adapter_by_node(ddc_node);
 		of_node_put(ddc_node);
-		if (!channel->ddc) {
+		if (!channel->connector.ddc) {
 			dev_warn(dev, "failed to get ddc i2c adapter\n");
 			return -EPROBE_DEFER;
 		}
 	}
 
-	if (!channel->ddc) {
+	if (!channel->connector.ddc) {
 		/* if no DDC available, fallback to hardcoded EDID */
 		dev_dbg(dev, "no ddc available\n");
 
@@ -725,7 +724,7 @@  static void imx_ldb_unbind(struct device *dev, struct device *master,
 			drm_panel_detach(channel->panel);
 
 		kfree(channel->edid);
-		i2c_put_adapter(channel->ddc);
+		i2c_put_adapter(channel->connector.ddc);
 	}
 }