drm/rockchip: Support tve uboot logo

Add tve connector port. If uboot logo is enabled,
dac will not be disabled when tve bind.

Change-Id: I5d87f9d1afc05481968dc34b0bd09dd82719a933
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
This commit is contained in:
Algea Cao
2018-01-25 11:01:50 +08:00
committed by Tao Huang
parent 9d155c640f
commit 21c38316b3

View File

@@ -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,