diff options
author | Thomas Abraham <thomas.abraham@linaro.org> | 2012-03-24 12:28:46 -0400 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2012-04-09 12:11:23 -0400 |
commit | 3c582647a9f84affd5c86e89d548157c62f8d9ca (patch) | |
tree | 8dba1da72fe1a2a3b29c3e38975a78c427b2e23a /drivers/video/s3c-fb.c | |
parent | a4196febbe75e2cc8fcb7af6460d2c3ef208d66c (diff) |
video: s3c-fb: remove 'default_win' element from platform data
The decision to enable or disable the data output to the lcd panel from
the controller need not be based on the value of 'default_win' element
in the platform data. Instead, the data output to the panel is enabled
if any of the windows are active, else data output is disabled.
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/s3c-fb.c')
-rw-r--r-- | drivers/video/s3c-fb.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c index c94f40d2cc2e..18c84b8d45b5 100644 --- a/drivers/video/s3c-fb.c +++ b/drivers/video/s3c-fb.c | |||
@@ -531,7 +531,7 @@ static int s3c_fb_set_par(struct fb_info *info) | |||
531 | /* disable the window whilst we update it */ | 531 | /* disable the window whilst we update it */ |
532 | writel(0, regs + WINCON(win_no)); | 532 | writel(0, regs + WINCON(win_no)); |
533 | 533 | ||
534 | if (win_no == sfb->pdata->default_win) | 534 | if (!sfb->output_on) |
535 | s3c_fb_enable(sfb, 1); | 535 | s3c_fb_enable(sfb, 1); |
536 | 536 | ||
537 | /* write the buffer address */ | 537 | /* write the buffer address */ |
@@ -799,6 +799,7 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info) | |||
799 | struct s3c_fb *sfb = win->parent; | 799 | struct s3c_fb *sfb = win->parent; |
800 | unsigned int index = win->index; | 800 | unsigned int index = win->index; |
801 | u32 wincon; | 801 | u32 wincon; |
802 | u32 output_on = sfb->output_on; | ||
802 | 803 | ||
803 | dev_dbg(sfb->dev, "blank mode %d\n", blank_mode); | 804 | dev_dbg(sfb->dev, "blank mode %d\n", blank_mode); |
804 | 805 | ||
@@ -837,34 +838,18 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info) | |||
837 | 838 | ||
838 | shadow_protect_win(win, 1); | 839 | shadow_protect_win(win, 1); |
839 | writel(wincon, sfb->regs + sfb->variant.wincon + (index * 4)); | 840 | writel(wincon, sfb->regs + sfb->variant.wincon + (index * 4)); |
840 | shadow_protect_win(win, 0); | ||
841 | 841 | ||
842 | /* Check the enabled state to see if we need to be running the | 842 | /* Check the enabled state to see if we need to be running the |
843 | * main LCD interface, as if there are no active windows then | 843 | * main LCD interface, as if there are no active windows then |
844 | * it is highly likely that we also do not need to output | 844 | * it is highly likely that we also do not need to output |
845 | * anything. | 845 | * anything. |
846 | */ | 846 | */ |
847 | 847 | s3c_fb_enable(sfb, sfb->enabled ? 1 : 0); | |
848 | /* We could do something like the following code, but the current | 848 | shadow_protect_win(win, 0); |
849 | * system of using framebuffer events means that we cannot make | ||
850 | * the distinction between just window 0 being inactive and all | ||
851 | * the windows being down. | ||
852 | * | ||
853 | * s3c_fb_enable(sfb, sfb->enabled ? 1 : 0); | ||
854 | */ | ||
855 | |||
856 | /* we're stuck with this until we can do something about overriding | ||
857 | * the power control using the blanking event for a single fb. | ||
858 | */ | ||
859 | if (index == sfb->pdata->default_win) { | ||
860 | shadow_protect_win(win, 1); | ||
861 | s3c_fb_enable(sfb, blank_mode != FB_BLANK_POWERDOWN ? 1 : 0); | ||
862 | shadow_protect_win(win, 0); | ||
863 | } | ||
864 | 849 | ||
865 | pm_runtime_put_sync(sfb->dev); | 850 | pm_runtime_put_sync(sfb->dev); |
866 | 851 | ||
867 | return 0; | 852 | return output_on == sfb->output_on; |
868 | } | 853 | } |
869 | 854 | ||
870 | /** | 855 | /** |