[PATCH v3 2/6] drm/bridge: sii902x: Set output mode to HDMI or DVI according to EDID

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed Mar 13 16:23:27 UTC 2019


Hello Jyri,

Thank you for the patch.

On Wed, Mar 13, 2019 at 06:01:04PM +0200, Jyri Sarha wrote:
> Set output mode to HDMI or DVI according to EDID HDMI signature.
> 
> Signed-off-by: Jyri Sarha <jsarha at ti.com>
> Reviewed-by: Andrzej Hajda <a.hajda at samsung.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

> ---
>  drivers/gpu/drm/bridge/sii902x.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
> index 1afa000141d5..0e21fa419d27 100644
> --- a/drivers/gpu/drm/bridge/sii902x.c
> +++ b/drivers/gpu/drm/bridge/sii902x.c
> @@ -181,11 +181,15 @@ static int sii902x_get_modes(struct drm_connector *connector)
>  	struct sii902x *sii902x = connector_to_sii902x(connector);
>  	u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24;
>  	struct edid *edid;
> +	u8 output_mode = SII902X_SYS_CTRL_OUTPUT_DVI;
>  	int num = 0, ret;
>  
>  	edid = drm_get_edid(connector, sii902x->i2cmux->adapter[0]);
>  	drm_connector_update_edid_property(connector, edid);
>  	if (edid) {
> +	        if (drm_detect_hdmi_monitor(edid))
> +			output_mode = SII902X_SYS_CTRL_OUTPUT_HDMI;
> +
>  		num = drm_add_edid_modes(connector, edid);
>  		kfree(edid);
>  	}
> @@ -195,6 +199,11 @@ static int sii902x_get_modes(struct drm_connector *connector)
>  	if (ret)
>  		return ret;
>  
> +	ret = regmap_update_bits(sii902x->regmap, SII902X_SYS_CTRL_DATA,
> +				 SII902X_SYS_CTRL_OUTPUT_MODE, output_mode);
> +	if (ret)
> +		return ret;
> +
>  	return num;
>  }
>  

-- 
Regards,

Laurent Pinchart


More information about the dri-devel mailing list