[PATCH v3 20/22] drm/bridge: ti-tfp410: Provide ddc symlink in connector sysfs directory

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

drivers/gpu/drm/bridge/ti-tfp410.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c
index dbf35c7bc85e..e55358f0a5ba 100644
--- a/drivers/gpu/drm/bridge/ti-tfp410.c
+++ b/drivers/gpu/drm/bridge/ti-tfp410.c
@@ -26,7 +26,6 @@ struct tfp410 {
unsigned int connector_type;

u32 bus_format;
- struct i2c_adapter *ddc;
struct gpio_desc *hpd;
int hpd_irq;
struct delayed_work hpd_work;
@@ -55,10 +54,10 @@ static int tfp410_get_modes(struct drm_connector *connector)
struct edid *edid;
int ret;

- if (!dvi->ddc)
+ if (!dvi->connector.ddc)
goto fallback;

- edid = drm_get_edid(connector, dvi->ddc);
+ edid = drm_get_edid(connector, dvi->connector.ddc);
if (!edid) {
DRM_INFO("EDID read failed. Fallback to standard modes\n");
goto fallback;
@@ -98,8 +97,8 @@ tfp410_connector_detect(struct drm_connector *connector, bool force)
return connector_status_disconnected;
}

- if (dvi->ddc) {
- if (drm_probe_ddc(dvi->ddc))
+ if (dvi->connector.ddc) {
+ if (drm_probe_ddc(dvi->connector.ddc))
return connector_status_connected;
else
return connector_status_disconnected;
@@ -297,8 +296,8 @@ static int tfp410_get_connector_properties(struct tfp410 *dvi)
if (!ddc_phandle)
goto fail;

- dvi->ddc = of_get_i2c_adapter_by_node(ddc_phandle);
- if (dvi->ddc)
+ dvi->connector.ddc = of_get_i2c_adapter_by_node(ddc_phandle);
+ if (dvi->connector.ddc)
dev_info(dvi->dev, "Connector's ddc i2c bus found\n");
else
ret = -EPROBE_DEFER;
@@ -367,7 +366,7 @@ static int tfp410_init(struct device *dev, bool i2c)

return 0;
fail:
- i2c_put_adapter(dvi->ddc);
+ i2c_put_adapter(dvi->connector.ddc);
if (dvi->hpd)
gpiod_put(dvi->hpd);
return ret;
@@ -382,8 +381,8 @@ static int tfp410_fini(struct device *dev)

drm_bridge_remove(&dvi->bridge);

- if (dvi->ddc)
- i2c_put_adapter(dvi->ddc);
+ if (dvi->connector.ddc)
+ i2c_put_adapter(dvi->connector.ddc);
if (dvi->hpd)
gpiod_put(dvi->hpd);

--
2.17.1