2 * linux/drivers/video/offb.c -- Open Firmware based frame buffer device
4 * Copyright (C) 1997 Geert Uytterhoeven
6 * This driver is partly based on the PowerMac console driver:
8 * Copyright (C) 1996 Paul Mackerras
10 * This file is subject to the terms and conditions of the GNU General Public
11 * License. See the file COPYING in the main directory of this archive for
15 #include <linux/module.h>
16 #include <linux/kernel.h>
17 #include <linux/errno.h>
18 #include <linux/string.h>
20 #include <linux/vmalloc.h>
21 #include <linux/delay.h>
23 #include <linux/of_address.h>
24 #include <linux/interrupt.h>
26 #include <linux/init.h>
27 #include <linux/ioport.h>
28 #include <linux/pci.h>
32 #include <asm/pci-bridge.h>
36 #include <asm/bootx.h>
41 /* Supported palette hacks */
44 cmap_m64
, /* ATI Mach64 */
45 cmap_r128
, /* ATI Rage128 */
46 cmap_M3A
, /* ATI Rage Mobility M3 Head A */
47 cmap_M3B
, /* ATI Rage Mobility M3 Head B */
48 cmap_radeon
, /* ATI Radeon */
49 cmap_gxt2000
, /* IBM GXT2000 */
50 cmap_avivo
, /* ATI R5xx */
54 volatile void __iomem
*cmap_adr
;
55 volatile void __iomem
*cmap_data
;
60 struct offb_par default_par
;
63 extern boot_infos_t
*boot_infos
;
66 /* Definitions used by the Avivo palette hack */
67 #define AVIVO_DC_LUT_RW_SELECT 0x6480
68 #define AVIVO_DC_LUT_RW_MODE 0x6484
69 #define AVIVO_DC_LUT_RW_INDEX 0x6488
70 #define AVIVO_DC_LUT_SEQ_COLOR 0x648c
71 #define AVIVO_DC_LUT_PWL_DATA 0x6490
72 #define AVIVO_DC_LUT_30_COLOR 0x6494
73 #define AVIVO_DC_LUT_READ_PIPE_SELECT 0x6498
74 #define AVIVO_DC_LUT_WRITE_EN_MASK 0x649c
75 #define AVIVO_DC_LUT_AUTOFILL 0x64a0
77 #define AVIVO_DC_LUTA_CONTROL 0x64c0
78 #define AVIVO_DC_LUTA_BLACK_OFFSET_BLUE 0x64c4
79 #define AVIVO_DC_LUTA_BLACK_OFFSET_GREEN 0x64c8
80 #define AVIVO_DC_LUTA_BLACK_OFFSET_RED 0x64cc
81 #define AVIVO_DC_LUTA_WHITE_OFFSET_BLUE 0x64d0
82 #define AVIVO_DC_LUTA_WHITE_OFFSET_GREEN 0x64d4
83 #define AVIVO_DC_LUTA_WHITE_OFFSET_RED 0x64d8
85 #define AVIVO_DC_LUTB_CONTROL 0x6cc0
86 #define AVIVO_DC_LUTB_BLACK_OFFSET_BLUE 0x6cc4
87 #define AVIVO_DC_LUTB_BLACK_OFFSET_GREEN 0x6cc8
88 #define AVIVO_DC_LUTB_BLACK_OFFSET_RED 0x6ccc
89 #define AVIVO_DC_LUTB_WHITE_OFFSET_BLUE 0x6cd0
90 #define AVIVO_DC_LUTB_WHITE_OFFSET_GREEN 0x6cd4
91 #define AVIVO_DC_LUTB_WHITE_OFFSET_RED 0x6cd8
94 * Set a single color register. The values supplied are already
95 * rounded down to the hardware's capabilities (according to the
96 * entries in the var structure). Return != 0 for invalid regno.
99 static int offb_setcolreg(u_int regno
, u_int red
, u_int green
, u_int blue
,
100 u_int transp
, struct fb_info
*info
)
102 struct offb_par
*par
= (struct offb_par
*) info
->par
;
104 if (info
->fix
.visual
== FB_VISUAL_TRUECOLOR
) {
105 u32
*pal
= info
->pseudo_palette
;
106 u32 cr
= red
>> (16 - info
->var
.red
.length
);
107 u32 cg
= green
>> (16 - info
->var
.green
.length
);
108 u32 cb
= blue
>> (16 - info
->var
.blue
.length
);
114 value
= (cr
<< info
->var
.red
.offset
) |
115 (cg
<< info
->var
.green
.offset
) |
116 (cb
<< info
->var
.blue
.offset
);
117 if (info
->var
.transp
.length
> 0) {
118 u32 mask
= (1 << info
->var
.transp
.length
) - 1;
119 mask
<<= info
->var
.transp
.offset
;
136 switch (par
->cmap_type
) {
138 writeb(regno
, par
->cmap_adr
);
139 writeb(red
, par
->cmap_data
);
140 writeb(green
, par
->cmap_data
);
141 writeb(blue
, par
->cmap_data
);
144 /* Clear PALETTE_ACCESS_CNTL in DAC_CNTL */
145 out_le32(par
->cmap_adr
+ 0x58,
146 in_le32(par
->cmap_adr
+ 0x58) & ~0x20);
148 /* Set palette index & data */
149 out_8(par
->cmap_adr
+ 0xb0, regno
);
150 out_le32(par
->cmap_adr
+ 0xb4,
151 (red
<< 16 | green
<< 8 | blue
));
154 /* Set PALETTE_ACCESS_CNTL in DAC_CNTL */
155 out_le32(par
->cmap_adr
+ 0x58,
156 in_le32(par
->cmap_adr
+ 0x58) | 0x20);
157 /* Set palette index & data */
158 out_8(par
->cmap_adr
+ 0xb0, regno
);
159 out_le32(par
->cmap_adr
+ 0xb4, (red
<< 16 | green
<< 8 | blue
));
162 /* Set palette index & data (could be smarter) */
163 out_8(par
->cmap_adr
+ 0xb0, regno
);
164 out_le32(par
->cmap_adr
+ 0xb4, (red
<< 16 | green
<< 8 | blue
));
167 out_le32(((unsigned __iomem
*) par
->cmap_adr
) + regno
,
168 (red
<< 16 | green
<< 8 | blue
));
171 /* Write to both LUTs for now */
172 writel(1, par
->cmap_adr
+ AVIVO_DC_LUT_RW_SELECT
);
173 writeb(regno
, par
->cmap_adr
+ AVIVO_DC_LUT_RW_INDEX
);
174 writel(((red
) << 22) | ((green
) << 12) | ((blue
) << 2),
175 par
->cmap_adr
+ AVIVO_DC_LUT_30_COLOR
);
176 writel(0, par
->cmap_adr
+ AVIVO_DC_LUT_RW_SELECT
);
177 writeb(regno
, par
->cmap_adr
+ AVIVO_DC_LUT_RW_INDEX
);
178 writel(((red
) << 22) | ((green
) << 12) | ((blue
) << 2),
179 par
->cmap_adr
+ AVIVO_DC_LUT_30_COLOR
);
190 static int offb_blank(int blank
, struct fb_info
*info
)
192 struct offb_par
*par
= (struct offb_par
*) info
->par
;
202 par
->blanked
= blank
;
205 for (i
= 0; i
< 256; i
++) {
206 switch (par
->cmap_type
) {
208 writeb(i
, par
->cmap_adr
);
209 for (j
= 0; j
< 3; j
++)
210 writeb(0, par
->cmap_data
);
213 /* Clear PALETTE_ACCESS_CNTL in DAC_CNTL */
214 out_le32(par
->cmap_adr
+ 0x58,
215 in_le32(par
->cmap_adr
+ 0x58) & ~0x20);
217 /* Set palette index & data */
218 out_8(par
->cmap_adr
+ 0xb0, i
);
219 out_le32(par
->cmap_adr
+ 0xb4, 0);
222 /* Set PALETTE_ACCESS_CNTL in DAC_CNTL */
223 out_le32(par
->cmap_adr
+ 0x58,
224 in_le32(par
->cmap_adr
+ 0x58) | 0x20);
225 /* Set palette index & data */
226 out_8(par
->cmap_adr
+ 0xb0, i
);
227 out_le32(par
->cmap_adr
+ 0xb4, 0);
230 out_8(par
->cmap_adr
+ 0xb0, i
);
231 out_le32(par
->cmap_adr
+ 0xb4, 0);
234 out_le32(((unsigned __iomem
*) par
->cmap_adr
) + i
,
238 writel(1, par
->cmap_adr
+ AVIVO_DC_LUT_RW_SELECT
);
239 writeb(i
, par
->cmap_adr
+ AVIVO_DC_LUT_RW_INDEX
);
240 writel(0, par
->cmap_adr
+ AVIVO_DC_LUT_30_COLOR
);
241 writel(0, par
->cmap_adr
+ AVIVO_DC_LUT_RW_SELECT
);
242 writeb(i
, par
->cmap_adr
+ AVIVO_DC_LUT_RW_INDEX
);
243 writel(0, par
->cmap_adr
+ AVIVO_DC_LUT_30_COLOR
);
247 fb_set_cmap(&info
->cmap
, info
);
251 static int offb_set_par(struct fb_info
*info
)
253 struct offb_par
*par
= (struct offb_par
*) info
->par
;
255 /* On avivo, initialize palette control */
256 if (par
->cmap_type
== cmap_avivo
) {
257 writel(0, par
->cmap_adr
+ AVIVO_DC_LUTA_CONTROL
);
258 writel(0, par
->cmap_adr
+ AVIVO_DC_LUTA_BLACK_OFFSET_BLUE
);
259 writel(0, par
->cmap_adr
+ AVIVO_DC_LUTA_BLACK_OFFSET_GREEN
);
260 writel(0, par
->cmap_adr
+ AVIVO_DC_LUTA_BLACK_OFFSET_RED
);
261 writel(0x0000ffff, par
->cmap_adr
+ AVIVO_DC_LUTA_WHITE_OFFSET_BLUE
);
262 writel(0x0000ffff, par
->cmap_adr
+ AVIVO_DC_LUTA_WHITE_OFFSET_GREEN
);
263 writel(0x0000ffff, par
->cmap_adr
+ AVIVO_DC_LUTA_WHITE_OFFSET_RED
);
264 writel(0, par
->cmap_adr
+ AVIVO_DC_LUTB_CONTROL
);
265 writel(0, par
->cmap_adr
+ AVIVO_DC_LUTB_BLACK_OFFSET_BLUE
);
266 writel(0, par
->cmap_adr
+ AVIVO_DC_LUTB_BLACK_OFFSET_GREEN
);
267 writel(0, par
->cmap_adr
+ AVIVO_DC_LUTB_BLACK_OFFSET_RED
);
268 writel(0x0000ffff, par
->cmap_adr
+ AVIVO_DC_LUTB_WHITE_OFFSET_BLUE
);
269 writel(0x0000ffff, par
->cmap_adr
+ AVIVO_DC_LUTB_WHITE_OFFSET_GREEN
);
270 writel(0x0000ffff, par
->cmap_adr
+ AVIVO_DC_LUTB_WHITE_OFFSET_RED
);
271 writel(1, par
->cmap_adr
+ AVIVO_DC_LUT_RW_SELECT
);
272 writel(0, par
->cmap_adr
+ AVIVO_DC_LUT_RW_MODE
);
273 writel(0x0000003f, par
->cmap_adr
+ AVIVO_DC_LUT_WRITE_EN_MASK
);
274 writel(0, par
->cmap_adr
+ AVIVO_DC_LUT_RW_SELECT
);
275 writel(0, par
->cmap_adr
+ AVIVO_DC_LUT_RW_MODE
);
276 writel(0x0000003f, par
->cmap_adr
+ AVIVO_DC_LUT_WRITE_EN_MASK
);
281 static void offb_destroy(struct fb_info
*info
)
283 if (info
->screen_base
)
284 iounmap(info
->screen_base
);
285 release_mem_region(info
->apertures
->ranges
[0].base
, info
->apertures
->ranges
[0].size
);
286 framebuffer_release(info
);
289 static struct fb_ops offb_ops
= {
290 .owner
= THIS_MODULE
,
291 .fb_destroy
= offb_destroy
,
292 .fb_setcolreg
= offb_setcolreg
,
293 .fb_set_par
= offb_set_par
,
294 .fb_blank
= offb_blank
,
295 .fb_fillrect
= cfb_fillrect
,
296 .fb_copyarea
= cfb_copyarea
,
297 .fb_imageblit
= cfb_imageblit
,
300 static void __iomem
*offb_map_reg(struct device_node
*np
, int index
,
301 unsigned long offset
, unsigned long size
)
307 addrp
= of_get_pci_address(np
, index
, &asize
, &flags
);
309 addrp
= of_get_address(np
, index
, &asize
, &flags
);
312 if ((flags
& (IORESOURCE_IO
| IORESOURCE_MEM
)) == 0)
314 if ((offset
+ size
) > asize
)
316 taddr
= of_translate_address(np
, addrp
);
317 if (taddr
== OF_BAD_ADDR
)
319 return ioremap(taddr
+ offset
, size
);
322 static void offb_init_palette_hacks(struct fb_info
*info
, struct device_node
*dp
,
323 const char *name
, unsigned long address
)
325 struct offb_par
*par
= (struct offb_par
*) info
->par
;
327 if (dp
&& !strncmp(name
, "ATY,Rage128", 11)) {
328 par
->cmap_adr
= offb_map_reg(dp
, 2, 0, 0x1fff);
330 par
->cmap_type
= cmap_r128
;
331 } else if (dp
&& (!strncmp(name
, "ATY,RageM3pA", 12)
332 || !strncmp(name
, "ATY,RageM3p12A", 14))) {
333 par
->cmap_adr
= offb_map_reg(dp
, 2, 0, 0x1fff);
335 par
->cmap_type
= cmap_M3A
;
336 } else if (dp
&& !strncmp(name
, "ATY,RageM3pB", 12)) {
337 par
->cmap_adr
= offb_map_reg(dp
, 2, 0, 0x1fff);
339 par
->cmap_type
= cmap_M3B
;
340 } else if (dp
&& !strncmp(name
, "ATY,Rage6", 9)) {
341 par
->cmap_adr
= offb_map_reg(dp
, 1, 0, 0x1fff);
343 par
->cmap_type
= cmap_radeon
;
344 } else if (!strncmp(name
, "ATY,", 4)) {
345 unsigned long base
= address
& 0xff000000UL
;
347 ioremap(base
+ 0x7ff000, 0x1000) + 0xcc0;
348 par
->cmap_data
= par
->cmap_adr
+ 1;
349 par
->cmap_type
= cmap_m64
;
350 } else if (dp
&& (of_device_is_compatible(dp
, "pci1014,b7") ||
351 of_device_is_compatible(dp
, "pci1014,21c"))) {
352 par
->cmap_adr
= offb_map_reg(dp
, 0, 0x6000, 0x1000);
354 par
->cmap_type
= cmap_gxt2000
;
355 } else if (dp
&& !strncmp(name
, "vga,Display-", 12)) {
356 /* Look for AVIVO initialized by SLOF */
357 struct device_node
*pciparent
= of_get_parent(dp
);
358 const u32
*vid
, *did
;
359 vid
= of_get_property(pciparent
, "vendor-id", NULL
);
360 did
= of_get_property(pciparent
, "device-id", NULL
);
361 /* This will match most R5xx */
362 if (vid
&& did
&& *vid
== 0x1002 &&
363 ((*did
>= 0x7100 && *did
< 0x7800) ||
365 par
->cmap_adr
= offb_map_reg(pciparent
, 2, 0, 0x10000);
367 par
->cmap_type
= cmap_avivo
;
369 of_node_put(pciparent
);
371 info
->fix
.visual
= (par
->cmap_type
!= cmap_unknown
) ?
372 FB_VISUAL_PSEUDOCOLOR
: FB_VISUAL_STATIC_PSEUDOCOLOR
;
375 static void __init
offb_init_fb(const char *name
, const char *full_name
,
376 int width
, int height
, int depth
,
377 int pitch
, unsigned long address
,
378 int foreign_endian
, struct device_node
*dp
)
380 unsigned long res_size
= pitch
* height
;
381 struct offb_par
*par
= &default_par
;
382 unsigned long res_start
= address
;
383 struct fb_fix_screeninfo
*fix
;
384 struct fb_var_screeninfo
*var
;
385 struct fb_info
*info
;
387 if (!request_mem_region(res_start
, res_size
, "offb"))
391 "Using unsupported %dx%d %s at %lx, depth=%d, pitch=%d\n",
392 width
, height
, name
, address
, depth
, pitch
);
393 if (depth
!= 8 && depth
!= 15 && depth
!= 16 && depth
!= 32) {
394 printk(KERN_ERR
"%s: can't use depth = %d\n", full_name
,
396 release_mem_region(res_start
, res_size
);
400 info
= framebuffer_alloc(sizeof(u32
) * 16, NULL
);
403 release_mem_region(res_start
, res_size
);
411 strcpy(fix
->id
, "OFfb ");
412 strncat(fix
->id
, name
, sizeof(fix
->id
) - sizeof("OFfb "));
413 fix
->id
[sizeof(fix
->id
) - 1] = '\0';
415 var
->xres
= var
->xres_virtual
= width
;
416 var
->yres
= var
->yres_virtual
= height
;
417 fix
->line_length
= pitch
;
419 fix
->smem_start
= address
;
420 fix
->smem_len
= pitch
* height
;
421 fix
->type
= FB_TYPE_PACKED_PIXELS
;
424 par
->cmap_type
= cmap_unknown
;
426 offb_init_palette_hacks(info
, dp
, name
, address
);
428 fix
->visual
= FB_VISUAL_TRUECOLOR
;
430 var
->xoffset
= var
->yoffset
= 0;
433 var
->bits_per_pixel
= 8;
436 var
->green
.offset
= 0;
437 var
->green
.length
= 8;
438 var
->blue
.offset
= 0;
439 var
->blue
.length
= 8;
440 var
->transp
.offset
= 0;
441 var
->transp
.length
= 0;
443 case 15: /* RGB 555 */
444 var
->bits_per_pixel
= 16;
445 var
->red
.offset
= 10;
447 var
->green
.offset
= 5;
448 var
->green
.length
= 5;
449 var
->blue
.offset
= 0;
450 var
->blue
.length
= 5;
451 var
->transp
.offset
= 0;
452 var
->transp
.length
= 0;
454 case 16: /* RGB 565 */
455 var
->bits_per_pixel
= 16;
456 var
->red
.offset
= 11;
458 var
->green
.offset
= 5;
459 var
->green
.length
= 6;
460 var
->blue
.offset
= 0;
461 var
->blue
.length
= 5;
462 var
->transp
.offset
= 0;
463 var
->transp
.length
= 0;
465 case 32: /* RGB 888 */
466 var
->bits_per_pixel
= 32;
467 var
->red
.offset
= 16;
469 var
->green
.offset
= 8;
470 var
->green
.length
= 8;
471 var
->blue
.offset
= 0;
472 var
->blue
.length
= 8;
473 var
->transp
.offset
= 24;
474 var
->transp
.length
= 8;
477 var
->red
.msb_right
= var
->green
.msb_right
= var
->blue
.msb_right
=
478 var
->transp
.msb_right
= 0;
482 var
->height
= var
->width
= -1;
483 var
->pixclock
= 10000;
484 var
->left_margin
= var
->right_margin
= 16;
485 var
->upper_margin
= var
->lower_margin
= 16;
486 var
->hsync_len
= var
->vsync_len
= 8;
488 var
->vmode
= FB_VMODE_NONINTERLACED
;
490 /* set offb aperture size for generic probing */
491 info
->apertures
= alloc_apertures(1);
492 if (!info
->apertures
)
494 info
->apertures
->ranges
[0].base
= address
;
495 info
->apertures
->ranges
[0].size
= fix
->smem_len
;
497 info
->fbops
= &offb_ops
;
498 info
->screen_base
= ioremap(address
, fix
->smem_len
);
499 info
->pseudo_palette
= (void *) (info
+ 1);
500 info
->flags
= FBINFO_DEFAULT
| FBINFO_MISC_FIRMWARE
| foreign_endian
;
502 fb_alloc_cmap(&info
->cmap
, 256, 0);
504 if (register_framebuffer(info
) < 0)
507 printk(KERN_INFO
"fb%d: Open Firmware frame buffer device on %s\n",
508 info
->node
, full_name
);
512 iounmap(info
->screen_base
);
514 iounmap(par
->cmap_adr
);
515 par
->cmap_adr
= NULL
;
516 framebuffer_release(info
);
517 release_mem_region(res_start
, res_size
);
521 static void __init
offb_init_nodriver(struct device_node
*dp
, int no_real_node
)
524 int i
, width
= 640, height
= 480, depth
= 8, pitch
= 640;
525 unsigned int flags
, rsize
, addr_prop
= 0;
526 unsigned long max_size
= 0;
527 u64 rstart
, address
= OF_BAD_ADDR
;
528 const u32
*pp
, *addrp
, *up
;
530 int foreign_endian
= 0;
533 if (of_get_property(dp
, "little-endian", NULL
))
534 foreign_endian
= FBINFO_FOREIGN_ENDIAN
;
536 if (of_get_property(dp
, "big-endian", NULL
))
537 foreign_endian
= FBINFO_FOREIGN_ENDIAN
;
540 pp
= of_get_property(dp
, "linux,bootx-depth", &len
);
542 pp
= of_get_property(dp
, "depth", &len
);
543 if (pp
&& len
== sizeof(u32
))
546 pp
= of_get_property(dp
, "linux,bootx-width", &len
);
548 pp
= of_get_property(dp
, "width", &len
);
549 if (pp
&& len
== sizeof(u32
))
552 pp
= of_get_property(dp
, "linux,bootx-height", &len
);
554 pp
= of_get_property(dp
, "height", &len
);
555 if (pp
&& len
== sizeof(u32
))
558 pp
= of_get_property(dp
, "linux,bootx-linebytes", &len
);
560 pp
= of_get_property(dp
, "linebytes", &len
);
561 if (pp
&& len
== sizeof(u32
) && (*pp
!= 0xffffffffu
))
564 pitch
= width
* ((depth
+ 7) / 8);
566 rsize
= (unsigned long)pitch
* (unsigned long)height
;
568 /* Ok, now we try to figure out the address of the framebuffer.
570 * Unfortunately, Open Firmware doesn't provide a standard way to do
571 * so. All we can do is a dodgy heuristic that happens to work in
572 * practice. On most machines, the "address" property contains what
573 * we need, though not on Matrox cards found in IBM machines. What I've
574 * found that appears to give good results is to go through the PCI
575 * ranges and pick one that is both big enough and if possible encloses
576 * the "address" property. If none match, we pick the biggest
578 up
= of_get_property(dp
, "linux,bootx-addr", &len
);
580 up
= of_get_property(dp
, "address", &len
);
581 if (up
&& len
== sizeof(u32
))
584 /* Hack for when BootX is passing us */
588 for (i
= 0; (addrp
= of_get_address(dp
, i
, &asize
, &flags
))
592 if (!(flags
& IORESOURCE_MEM
))
596 rstart
= of_translate_address(dp
, addrp
);
597 if (rstart
== OF_BAD_ADDR
)
599 if (addr_prop
&& (rstart
<= addr_prop
) &&
600 ((rstart
+ asize
) >= (addr_prop
+ rsize
)))
606 if (rsize
> max_size
) {
608 address
= OF_BAD_ADDR
;
611 if (address
== OF_BAD_ADDR
)
615 if (address
== OF_BAD_ADDR
&& addr_prop
)
616 address
= (u64
)addr_prop
;
617 if (address
!= OF_BAD_ADDR
) {
618 /* kludge for valkyrie */
619 if (strcmp(dp
->name
, "valkyrie") == 0)
621 offb_init_fb(no_real_node
? "bootx" : dp
->name
,
622 no_real_node
? "display" : dp
->full_name
,
623 width
, height
, depth
, pitch
, address
,
624 foreign_endian
, no_real_node
? NULL
: dp
);
628 static int __init
offb_init(void)
630 struct device_node
*dp
= NULL
, *boot_disp
= NULL
;
632 if (fb_get_options("offb", NULL
))
635 /* Check if we have a MacOS display without a node spec */
636 if (of_get_property(of_chosen
, "linux,bootx-noscreen", NULL
) != NULL
) {
637 /* The old code tried to work out which node was the MacOS
638 * display based on the address. I'm dropping that since the
639 * lack of a node spec only happens with old BootX versions
640 * (users can update) and with this code, they'll still get
641 * a display (just not the palette hacks).
643 offb_init_nodriver(of_chosen
, 1);
646 for (dp
= NULL
; (dp
= of_find_node_by_type(dp
, "display"));) {
647 if (of_get_property(dp
, "linux,opened", NULL
) &&
648 of_get_property(dp
, "linux,boot-display", NULL
)) {
650 offb_init_nodriver(dp
, 0);
653 for (dp
= NULL
; (dp
= of_find_node_by_type(dp
, "display"));) {
654 if (of_get_property(dp
, "linux,opened", NULL
) &&
656 offb_init_nodriver(dp
, 0);
663 module_init(offb_init
);
664 MODULE_LICENSE("GPL");