diff options
Diffstat (limited to 'drivers/video/S3triofb.c')
-rw-r--r-- | drivers/video/S3triofb.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/video/S3triofb.c b/drivers/video/S3triofb.c index 333fd6576..bcc2b9b7b 100644 --- a/drivers/video/S3triofb.c +++ b/drivers/video/S3triofb.c @@ -77,6 +77,7 @@ static struct fb_var_screeninfo fb_var = { 0, }; * Interface used by the world */ +static void __init s3triofb_of_init(struct device_node *dp); static int s3trio_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info); static int s3trio_get_var(struct fb_var_screeninfo *var, int con, @@ -263,12 +264,11 @@ static int s3trio_set_cmap(struct fb_cmap *cmap, int kspc, int con, int __init s3triofb_init(void) { -#ifdef __powerpc__ - /* We don't want to be called like this. */ - /* We rely on Open Firmware (offb) instead. */ -#else /* !__powerpc__ */ - /* To be merged with cybervision */ -#endif /* !__powerpc__ */ + struct device_node *dp; + + dp = find_devices("S3Trio"); + if (dp != 0) + s3triofb_of_init(dp); return 0; } @@ -376,10 +376,10 @@ int __init s3trio_init(struct device_node *dp){ * We heavily rely on OF for the moment. This needs fixing. */ -void __init s3triofb_init_of(struct device_node *dp) +static void __init s3triofb_of_init(struct device_node *dp) { int i, *pp, len; - unsigned long address; + unsigned long address, size; u_long *CursorBase; strncat(s3trio_name, dp->name, sizeof(s3trio_name)); @@ -416,9 +416,13 @@ void __init s3triofb_init_of(struct device_node *dp) fb_fix.line_length = fb_var.xres_virtual; fb_fix.smem_len = fb_fix.line_length*fb_var.yres; - s3trio_init(dp); address = 0xc6000000; - s3trio_base = ioremap(address,64*1024*1024); + size = 64*1024*1024; + if (!request_mem_region(address, size, "S3triofb")) + return; + + s3trio_init(dp); + s3trio_base = ioremap(address, size); fb_fix.smem_start = address; fb_fix.type = FB_TYPE_PACKED_PIXELS; fb_fix.type_aux = 0; @@ -695,12 +699,6 @@ static void do_install_cmap(int con, struct fb_info *info) s3trio_setcolreg, &fb_info); } -int s3triofb_setup(char *options) { - - return 0; - -} - static void Trio_WaitQueue(u_short fifo) { u_short status; |