diff mbox series

[v4,23/23] drm/i915: Provide ddc symlink in hdmi connector sysfs directory

Message ID 1d9bb3d65127a5093d6e9f9cc62a5c7c7502f61d.1562843413.git.andrzej.p@collabora.com (mailing list archive)
State New, archived
Headers show
Series Associate ddc adapters with connectors | expand

Commit Message

Andrzej Pietrasiewicz July 11, 2019, 11:26 a.m. UTC
Use the ddc pointer provided by the generic connector.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
---
 drivers/gpu/drm/i915/display/intel_hdmi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Ville Syrjala July 11, 2019, 11:59 a.m. UTC | #1
On Thu, Jul 11, 2019 at 01:26:50PM +0200, Andrzej Pietrasiewicz wrote:
> Use the ddc pointer provided by the generic connector.

We already have a symlink via intel_hdmi_create_i2c_symlink(). I guess
we should remove that in favor of the generic one. Oleg?

> 
> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
> ---
>  drivers/gpu/drm/i915/display/intel_hdmi.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
> index 0ebec69bbbfc..678fa4d1bd4e 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
> @@ -3094,6 +3094,9 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
>  		 intel_dig_port->max_lanes, port_name(port)))
>  		return;
>  
> +	intel_hdmi->ddc_bus = intel_hdmi_ddc_pin(dev_priv, port);
> +	connector->ddc = intel_gmbus_get_adapter(dev_priv, intel_hdmi->ddc_bus);
> +
>  	drm_connector_init(dev, connector, &intel_hdmi_connector_funcs,
>  			   DRM_MODE_CONNECTOR_HDMIA);
>  	drm_connector_helper_add(connector, &intel_hdmi_connector_helper_funcs);
> @@ -3105,8 +3108,6 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
>  	if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
>  		connector->ycbcr_420_allowed = true;
>  
> -	intel_hdmi->ddc_bus = intel_hdmi_ddc_pin(dev_priv, port);
> -
>  	if (WARN_ON(port == PORT_A))
>  		return;
>  	intel_encoder->hpd_pin = intel_hpd_pin_default(dev_priv, port);
> -- 
> 2.17.1
Daniel Vetter July 11, 2019, 1:21 p.m. UTC | #2
On Thu, Jul 11, 2019 at 02:59:26PM +0300, Ville Syrjälä wrote:
> On Thu, Jul 11, 2019 at 01:26:50PM +0200, Andrzej Pietrasiewicz wrote:
> > Use the ddc pointer provided by the generic connector.
> 
> We already have a symlink via intel_hdmi_create_i2c_symlink(). I guess
> we should remove that in favor of the generic one. Oleg?

Since that commit is very new I think we should try real hard to avoid the
i915-ism here ...
-Daniel

> 
> > 
> > Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_hdmi.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
> > index 0ebec69bbbfc..678fa4d1bd4e 100644
> > --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> > +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
> > @@ -3094,6 +3094,9 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
> >  		 intel_dig_port->max_lanes, port_name(port)))
> >  		return;
> >  
> > +	intel_hdmi->ddc_bus = intel_hdmi_ddc_pin(dev_priv, port);
> > +	connector->ddc = intel_gmbus_get_adapter(dev_priv, intel_hdmi->ddc_bus);
> > +
> >  	drm_connector_init(dev, connector, &intel_hdmi_connector_funcs,
> >  			   DRM_MODE_CONNECTOR_HDMIA);
> >  	drm_connector_helper_add(connector, &intel_hdmi_connector_helper_funcs);
> > @@ -3105,8 +3108,6 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
> >  	if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
> >  		connector->ycbcr_420_allowed = true;
> >  
> > -	intel_hdmi->ddc_bus = intel_hdmi_ddc_pin(dev_priv, port);
> > -
> >  	if (WARN_ON(port == PORT_A))
> >  		return;
> >  	intel_encoder->hpd_pin = intel_hpd_pin_default(dev_priv, port);
> > -- 
> > 2.17.1
> 
> -- 
> Ville Syrjälä
> Intel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index 0ebec69bbbfc..678fa4d1bd4e 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -3094,6 +3094,9 @@  void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
 		 intel_dig_port->max_lanes, port_name(port)))
 		return;
 
+	intel_hdmi->ddc_bus = intel_hdmi_ddc_pin(dev_priv, port);
+	connector->ddc = intel_gmbus_get_adapter(dev_priv, intel_hdmi->ddc_bus);
+
 	drm_connector_init(dev, connector, &intel_hdmi_connector_funcs,
 			   DRM_MODE_CONNECTOR_HDMIA);
 	drm_connector_helper_add(connector, &intel_hdmi_connector_helper_funcs);
@@ -3105,8 +3108,6 @@  void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
 	if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
 		connector->ycbcr_420_allowed = true;
 
-	intel_hdmi->ddc_bus = intel_hdmi_ddc_pin(dev_priv, port);
-
 	if (WARN_ON(port == PORT_A))
 		return;
 	intel_encoder->hpd_pin = intel_hpd_pin_default(dev_priv, port);