X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fvideo%2Foffb.c;h=92a41f71e2e072bfe9b821a3bc478d69c06b7541;hb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;hp=99c2e6322ebb05fc9a74a4ca627a8f3282fef19d;hpb=a2c21200f1c81b08cb55e417b68150bba439b646;p=linux-2.6.git diff --git a/drivers/video/offb.c b/drivers/video/offb.c index 99c2e6322..92a41f71e 100644 --- a/drivers/video/offb.c +++ b/drivers/video/offb.c @@ -28,7 +28,8 @@ #include #include #include -#ifdef CONFIG_BOOTX_TEXT + +#ifdef CONFIG_PPC32 #include #endif @@ -70,7 +71,7 @@ static int offb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info); static int offb_blank(int blank, struct fb_info *info); -#ifdef CONFIG_BOOTX_TEXT +#ifdef CONFIG_PPC32 extern boot_infos_t *boot_infos; #endif @@ -245,18 +246,20 @@ static int offb_blank(int blank, struct fb_info *info) int __init offb_init(void) { - struct device_node *dp; - unsigned int dpy; + struct device_node *dp = NULL, *boot_disp = NULL; #if defined(CONFIG_BOOTX_TEXT) && defined(CONFIG_PPC32) - struct device_node *displays = find_type_devices("display"); struct device_node *macos_display = NULL; +#endif + if (fb_get_options("offb", NULL)) + return -ENODEV; +#if defined(CONFIG_BOOTX_TEXT) && defined(CONFIG_PPC32) /* If we're booted from BootX... */ - if (prom_num_displays == 0 && boot_infos != 0) { + if (boot_infos != 0) { unsigned long addr = (unsigned long) boot_infos->dispDeviceBase; /* find the device node corresponding to the macos display */ - for (dp = displays; dp != NULL; dp = dp->next) { + while ((dp = of_find_node_by_type(dp, "display"))) { int i; /* * Grrr... It looks like the MacOS ATI driver @@ -325,10 +328,19 @@ int __init offb_init(void) } #endif /* defined(CONFIG_BOOTX_TEXT) && defined(CONFIG_PPC32) */ - for (dpy = 0; dpy < prom_num_displays; dpy++) { - if ((dp = find_path_device(prom_display_paths[dpy]))) + for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) { + if (get_property(dp, "linux,opened", NULL) && + get_property(dp, "linux,boot-display", NULL)) { + boot_disp = dp; offb_init_nodriver(dp); + } } + for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) { + if (get_property(dp, "linux,opened", NULL) && + dp != boot_disp) + offb_init_nodriver(dp); + } + return 0; } @@ -527,7 +539,7 @@ static void __init offb_init_fb(const char *name, const char *full_name, info->screen_base = ioremap(address, fix->smem_len); info->par = par; info->pseudo_palette = (void *) (info + 1); - info->flags = FBINFO_FLAG_DEFAULT; + info->flags = FBINFO_DEFAULT; fb_alloc_cmap(&info->cmap, 256, 0); @@ -541,4 +553,5 @@ static void __init offb_init_fb(const char *name, const char *full_name, info->node, full_name); } +module_init(offb_init); MODULE_LICENSE("GPL");