From cd4db62ef0da68a6523b9b07c7236b1fabe6685a Mon Sep 17 00:00:00 2001 From: Algea Cao Date: Wed, 20 Mar 2024 20:02:29 +0800 Subject: [PATCH] drm/rockchip: dw_hdmi: Don't set enable-gpio value when hdmi bind If uboot logo is enabled and the enable-gpio value is different from that in uboot, kernel logo will be displayed abnormally. Therefore, we do not set the value of enable-gpio when hdmi bind, but set it in encoder enable when hdmi is switched after system boot. This method is also compatible with scenarios that uboot logo is not enabled. Change-Id: I238aeb63790b67414036e2c89382870ff575c4e5 Signed-off-by: Algea Cao --- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index 09d8ddc6b993..30a66d6620cc 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -1654,7 +1654,7 @@ static int rockchip_hdmi_parse_dt(struct rockchip_hdmi *hdmi) } hdmi->enable_gpio = devm_gpiod_get_optional(hdmi->dev, "enable", - GPIOD_OUT_HIGH); + GPIOD_ASIS); if (IS_ERR(hdmi->enable_gpio)) { ret = PTR_ERR(hdmi->enable_gpio); dev_err(hdmi->dev, "failed to request enable GPIO: %d\n", ret); @@ -1934,9 +1934,9 @@ static void dw_hdmi_rockchip_encoder_enable(struct drm_encoder *encoder) if (hdmi->is_hdmi_qp) { if (hdmi->link_cfg.frl_mode) - gpiod_set_value(hdmi->enable_gpio, 0); + gpiod_direction_output(hdmi->enable_gpio, 0); else - gpiod_set_value(hdmi->enable_gpio, 1); + gpiod_direction_output(hdmi->enable_gpio, 1); } if (hdmi->chip_data->lcdsel_grf_reg < 0)