diff options
author | Eric Miao <eric.miao@marvell.com> | 2009-03-19 03:24:30 -0400 |
---|---|---|
committer | Eric Miao <eric.miao@marvell.com> | 2009-03-19 04:20:39 -0400 |
commit | 782385ae176b304c7105051e1b06c68bc0b4a2ba (patch) | |
tree | 0b4c4904b347fe4697d3025ea6de0af2a5303e8b /drivers | |
parent | c68ffddabcaaa64c6ea681d2944cbda50a8654ea (diff) |
[ARM] pxa: fix overlay being un-necessarily initialized on pxa25x
pxa25x doesn't support overlay in its LCD controller, this patch adds
pxafb_overlay_supported() functions to check the initialization is
necessary.
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/pxafb.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index 48ff701d3a72..40a5d9d66755 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c | |||
@@ -883,10 +883,21 @@ static void __devinit init_pxafb_overlay(struct pxafb_info *fbi, | |||
883 | init_completion(&ofb->branch_done); | 883 | init_completion(&ofb->branch_done); |
884 | } | 884 | } |
885 | 885 | ||
886 | static inline int pxafb_overlay_supported(void) | ||
887 | { | ||
888 | if (cpu_is_pxa27x() || cpu_is_pxa3xx()) | ||
889 | return 1; | ||
890 | |||
891 | return 0; | ||
892 | } | ||
893 | |||
886 | static int __devinit pxafb_overlay_init(struct pxafb_info *fbi) | 894 | static int __devinit pxafb_overlay_init(struct pxafb_info *fbi) |
887 | { | 895 | { |
888 | int i, ret; | 896 | int i, ret; |
889 | 897 | ||
898 | if (!pxafb_overlay_supported()) | ||
899 | return 0; | ||
900 | |||
890 | for (i = 0; i < 2; i++) { | 901 | for (i = 0; i < 2; i++) { |
891 | init_pxafb_overlay(fbi, &fbi->overlay[i], i); | 902 | init_pxafb_overlay(fbi, &fbi->overlay[i], i); |
892 | ret = register_framebuffer(&fbi->overlay[i].fb); | 903 | ret = register_framebuffer(&fbi->overlay[i].fb); |
@@ -909,6 +920,9 @@ static void __devexit pxafb_overlay_exit(struct pxafb_info *fbi) | |||
909 | { | 920 | { |
910 | int i; | 921 | int i; |
911 | 922 | ||
923 | if (!pxafb_overlay_supported()) | ||
924 | return; | ||
925 | |||
912 | for (i = 0; i < 2; i++) | 926 | for (i = 0; i < 2; i++) |
913 | unregister_framebuffer(&fbi->overlay[i].fb); | 927 | unregister_framebuffer(&fbi->overlay[i].fb); |
914 | } | 928 | } |