aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/s3c-fb.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2011-12-08 04:08:00 -0500
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-12-19 15:06:24 -0500
commitff8c91072389491375f6d1ea86ce55942c460a04 (patch)
treeb449eda8941bd1d7f1b7423f684e0ec66590a785 /drivers/video/s3c-fb.c
parent35784b4315d949e431df9a0ffef721a4801b1588 (diff)
video: s3c-fb: add shadow register protect
Shadow registers should be protectd whenever the registers are updated. Shadow registers are updated after SHADOWCON shadow register is cleared. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/s3c-fb.c')
-rw-r--r--drivers/video/s3c-fb.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 25a5c7665855..a0b3fd670f71 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -812,12 +812,16 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info)
812 812
813 case FB_BLANK_NORMAL: 813 case FB_BLANK_NORMAL:
814 /* disable the DMA and display 0x0 (black) */ 814 /* disable the DMA and display 0x0 (black) */
815 shadow_protect_win(win, 1);
815 writel(WINxMAP_MAP | WINxMAP_MAP_COLOUR(0x0), 816 writel(WINxMAP_MAP | WINxMAP_MAP_COLOUR(0x0),
816 sfb->regs + sfb->variant.winmap + (index * 4)); 817 sfb->regs + sfb->variant.winmap + (index * 4));
818 shadow_protect_win(win, 0);
817 break; 819 break;
818 820
819 case FB_BLANK_UNBLANK: 821 case FB_BLANK_UNBLANK:
822 shadow_protect_win(win, 1);
820 writel(0x0, sfb->regs + sfb->variant.winmap + (index * 4)); 823 writel(0x0, sfb->regs + sfb->variant.winmap + (index * 4));
824 shadow_protect_win(win, 0);
821 wincon |= WINCONx_ENWIN; 825 wincon |= WINCONx_ENWIN;
822 sfb->enabled |= (1 << index); 826 sfb->enabled |= (1 << index);
823 break; 827 break;
@@ -828,7 +832,9 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info)
828 return 1; 832 return 1;
829 } 833 }
830 834
835 shadow_protect_win(win, 1);
831 writel(wincon, sfb->regs + sfb->variant.wincon + (index * 4)); 836 writel(wincon, sfb->regs + sfb->variant.wincon + (index * 4));
837 shadow_protect_win(win, 0);
832 838
833 /* Check the enabled state to see if we need to be running the 839 /* Check the enabled state to see if we need to be running the
834 * main LCD interface, as if there are no active windows then 840 * main LCD interface, as if there are no active windows then
@@ -847,8 +853,11 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info)
847 /* we're stuck with this until we can do something about overriding 853 /* we're stuck with this until we can do something about overriding
848 * the power control using the blanking event for a single fb. 854 * the power control using the blanking event for a single fb.
849 */ 855 */
850 if (index == sfb->pdata->default_win) 856 if (index == sfb->pdata->default_win) {
857 shadow_protect_win(win, 1);
851 s3c_fb_enable(sfb, blank_mode != FB_BLANK_POWERDOWN ? 1 : 0); 858 s3c_fb_enable(sfb, blank_mode != FB_BLANK_POWERDOWN ? 1 : 0);
859 shadow_protect_win(win, 0);
860 }
852 861
853 return 0; 862 return 0;
854} 863}
@@ -1551,10 +1560,15 @@ static int s3c_fb_resume(struct device *dev)
1551 1560
1552 for (win_no = 0; win_no < sfb->variant.nr_windows - 1; win_no++) { 1561 for (win_no = 0; win_no < sfb->variant.nr_windows - 1; win_no++) {
1553 void __iomem *regs = sfb->regs + sfb->variant.keycon; 1562 void __iomem *regs = sfb->regs + sfb->variant.keycon;
1563 win = sfb->windows[win_no];
1564 if (!win)
1565 continue;
1554 1566
1567 shadow_protect_win(win, 1);
1555 regs += (win_no * 8); 1568 regs += (win_no * 8);
1556 writel(0xffffff, regs + WKEYCON0); 1569 writel(0xffffff, regs + WKEYCON0);
1557 writel(0xffffff, regs + WKEYCON1); 1570 writel(0xffffff, regs + WKEYCON1);
1571 shadow_protect_win(win, 0);
1558 } 1572 }
1559 1573
1560 /* restore framebuffers */ 1574 /* restore framebuffers */