[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>
This commit is contained in:
parent
c68ffddabc
commit
782385ae17
1 changed files with 14 additions and 0 deletions
|
@ -883,10 +883,21 @@ static void __devinit init_pxafb_overlay(struct pxafb_info *fbi,
|
||||||
init_completion(&ofb->branch_done);
|
init_completion(&ofb->branch_done);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int pxafb_overlay_supported(void)
|
||||||
|
{
|
||||||
|
if (cpu_is_pxa27x() || cpu_is_pxa3xx())
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int __devinit pxafb_overlay_init(struct pxafb_info *fbi)
|
static int __devinit pxafb_overlay_init(struct pxafb_info *fbi)
|
||||||
{
|
{
|
||||||
int i, ret;
|
int i, ret;
|
||||||
|
|
||||||
|
if (!pxafb_overlay_supported())
|
||||||
|
return 0;
|
||||||
|
|
||||||
for (i = 0; i < 2; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
init_pxafb_overlay(fbi, &fbi->overlay[i], i);
|
init_pxafb_overlay(fbi, &fbi->overlay[i], i);
|
||||||
ret = register_framebuffer(&fbi->overlay[i].fb);
|
ret = register_framebuffer(&fbi->overlay[i].fb);
|
||||||
|
@ -909,6 +920,9 @@ static void __devexit pxafb_overlay_exit(struct pxafb_info *fbi)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (!pxafb_overlay_supported())
|
||||||
|
return;
|
||||||
|
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
unregister_framebuffer(&fbi->overlay[i].fb);
|
unregister_framebuffer(&fbi->overlay[i].fb);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue