#include <linux/ioport.h>
#include <asm/io.h>
#include <asm/prom.h>
-#ifdef CONFIG_BOOTX_TEXT
+
+#ifdef CONFIG_PPC32
#include <asm/bootx.h>
#endif
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
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
}
#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;
}
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);
info->node, full_name);
}
+module_init(offb_init);
MODULE_LICENSE("GPL");