diff options
author | Ed Nash <ed.nash@timesys.com> | 2012-11-20 10:16:18 -0500 |
---|---|---|
committer | Andy Voltz <andy.voltz@timesys.com> | 2012-11-20 10:16:18 -0500 |
commit | 3fccd19ab025096259cd70364e05ce183a31bf21 (patch) | |
tree | 24c6b585b66282a04b65421619e7c0efd90279ce | |
parent | 7974a95ddfa0ad24e6d3684f350b7bfd84feb816 (diff) |
mvf_dcu: init all dcu registers at boot time
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-mvf-dcu.c | 4 | ||||
-rw-r--r-- | drivers/video/mvf_dcu.c | 36 |
2 files changed, 33 insertions, 7 deletions
diff --git a/arch/arm/plat-mxc/devices/platform-mvf-dcu.c b/arch/arm/plat-mxc/devices/platform-mvf-dcu.c index 13258aba9bb0..0fe5099eca34 100644 --- a/arch/arm/plat-mxc/devices/platform-mvf-dcu.c +++ b/arch/arm/plat-mxc/devices/platform-mvf-dcu.c @@ -38,8 +38,8 @@ int __init mvf_dcu_init(int id) } const struct mvf_dcu_data mvfa5_dcu_data[] __initconst = { - mvf_dcu_data_entry_single(MVF, 0, SZ_4K, mvf_dcu_init), - mvf_dcu_data_entry_single(MVF, 1, SZ_4K, mvf_dcu_init), + mvf_dcu_data_entry_single(MVF, 0, SZ_8K, mvf_dcu_init), + mvf_dcu_data_entry_single(MVF, 1, SZ_8K, mvf_dcu_init), }; struct platform_device *__init mvf_add_dcu( diff --git a/drivers/video/mvf_dcu.c b/drivers/video/mvf_dcu.c index 719e465b77e6..c10c07ea7dc8 100644 --- a/drivers/video/mvf_dcu.c +++ b/drivers/video/mvf_dcu.c @@ -138,6 +138,8 @@ static struct mfb_info mfb_template[] = { }, }; +static int total_open_layers = 0; + static int mvf_dcu_enable_panel(struct fb_info *info) { @@ -422,11 +424,6 @@ static void update_lcdc(struct fb_info *info) writel(DCU_THRESHOLD_LS_BF_VS(0x3) | DCU_THRESHOLD_OUT_BUF_HIGH(0x78) | DCU_THRESHOLD_OUT_BUF_LOW(0), dcu->base + DCU_THRESHOLD); - writel(0, dcu->base + DCU_INT_STATUS); - writel(0, dcu->base + DCU_PARR_ERR_STA_1); - writel(0, dcu->base + DCU_PARR_ERR_STA_2); - writel(0, dcu->base + DCU_PARR_ERR_STA_3); - /* Enable the DCU */ enable_lcdc(info); } @@ -718,10 +715,34 @@ static int mvf_dcu_ioctl(struct fb_info *info, unsigned int cmd, static int mvf_dcu_open(struct fb_info *info, int user) { struct mfb_info *mfbi = info->par; + struct mvf_dcu_fb_data *dcu = mfbi->parent; + int i; int ret = 0; mfbi->index = info->node; spin_lock(&dcu_lock); + + // if first time any layer open (e.g., at boot time) reset all + if(total_open_layers == 0) { + + writel(0, dcu->base + DCU_INT_STATUS); + writel(0, dcu->base + DCU_PARR_ERR_STA_1); + writel(0, dcu->base + DCU_PARR_ERR_STA_2); + writel(0, dcu->base + DCU_PARR_ERR_STA_3); + + for (i = 0; i < 64; i++) { + writel(0, dcu->base + DCU_CTRLDESCLN_0(i)); + writel(0, dcu->base + DCU_CTRLDESCLN_1(i)); + writel(0, dcu->base + DCU_CTRLDESCLN_2(i)); + writel(0, dcu->base + DCU_CTRLDESCLN_3(i)); + writel(0, dcu->base + DCU_CTRLDESCLN_4(i)); + writel(0, dcu->base + DCU_CTRLDESCLN_5(i)); + writel(0, dcu->base + DCU_CTRLDESCLN_6(i)); + writel(0, dcu->base + DCU_CTRLDESCLN_7(i)); + writel(0, dcu->base + DCU_CTRLDESCLN_8(i)); + } + } + mfbi->count++; if (mfbi->count == 1) { pr_debug("open layer index %d\n", mfbi->index); @@ -729,6 +750,8 @@ static int mvf_dcu_open(struct fb_info *info, int user) ret = mvf_dcu_set_par(info); if (ret < 0) mfbi->count--; + else + total_open_layers++; } spin_unlock(&dcu_lock); @@ -747,6 +770,8 @@ static int mvf_dcu_release(struct fb_info *info, int user) ret = mvf_dcu_disable_panel(info); if (ret < 0) mfbi->count++; + else + total_open_layers--; } spin_unlock(&dcu_lock); @@ -1008,6 +1033,7 @@ static int __devinit mvf_dcu_probe(struct platform_device *pdev) } dev_set_drvdata(&pdev->dev, dcu); + return 0; failed_install_fb: |