diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_tve.c b/drivers/gpu/drm/rockchip/rockchip_drm_tve.c index 4f91c7e9cc4c..23f2ad73b7bc 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_tve.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_tve.c @@ -366,6 +366,31 @@ static int tve_parse_dt(struct device_node *np, return 0; } +static void check_uboot_logo(struct rockchip_tve *tve) +{ + int lumafilter0, lumafilter1, lumafilter2, vdac; + + vdac = tve_dac_readl(VDAC_VDAC1); + /* Whether the dac power has been turned down. */ + if (vdac & m_DR_PWR_DOWN) + return; + + lumafilter0 = tve_readl(TV_LUMA_FILTER0); + lumafilter1 = tve_readl(TV_LUMA_FILTER1); + lumafilter2 = tve_readl(TV_LUMA_FILTER2); + + /* + * The default lumafilter value is 0. If lumafilter value + * is equal to the dts value, uboot logo is enabled. + */ + if (lumafilter0 == tve->lumafilter0 && + lumafilter1 == tve->lumafilter1 && + lumafilter2 == tve->lumafilter2) + return; + + dac_init(tve); +} + static const struct of_device_id rockchip_tve_dt_ids[] = { { .compatible = "rockchip,rk3328-tve", @@ -434,10 +459,8 @@ static int rockchip_tve_bind(struct device *dev, struct device *master, return PTR_ERR(tve->vdacbase); } - dac_init(tve); - mutex_init(&tve->suspend_lock); - + check_uboot_logo(tve); tve->tv_format = TVOUT_CVBS_PAL; encoder = &tve->encoder; encoder->possible_crtcs = drm_of_find_possible_crtcs(drm_dev, @@ -455,7 +478,7 @@ static int rockchip_tve_bind(struct device *dev, struct device *master, connector = &tve->connector; connector->dpms = DRM_MODE_DPMS_OFF; - + connector->port = dev->of_node; connector->interlace_allowed = 1; ret = drm_connector_init(drm_dev, connector, &rockchip_tve_connector_funcs,