diff options
-rw-r--r-- | drivers/video/offb.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/video/offb.c b/drivers/video/offb.c index 915acaecdbe1..da7cf7936b24 100644 --- a/drivers/video/offb.c +++ b/drivers/video/offb.c | |||
@@ -41,13 +41,14 @@ | |||
41 | /* Supported palette hacks */ | 41 | /* Supported palette hacks */ |
42 | enum { | 42 | enum { |
43 | cmap_unknown, | 43 | cmap_unknown, |
44 | cmap_m64, /* ATI Mach64 */ | 44 | cmap_simple, /* ATI Mach64 */ |
45 | cmap_r128, /* ATI Rage128 */ | 45 | cmap_r128, /* ATI Rage128 */ |
46 | cmap_M3A, /* ATI Rage Mobility M3 Head A */ | 46 | cmap_M3A, /* ATI Rage Mobility M3 Head A */ |
47 | cmap_M3B, /* ATI Rage Mobility M3 Head B */ | 47 | cmap_M3B, /* ATI Rage Mobility M3 Head B */ |
48 | cmap_radeon, /* ATI Radeon */ | 48 | cmap_radeon, /* ATI Radeon */ |
49 | cmap_gxt2000, /* IBM GXT2000 */ | 49 | cmap_gxt2000, /* IBM GXT2000 */ |
50 | cmap_avivo, /* ATI R5xx */ | 50 | cmap_avivo, /* ATI R5xx */ |
51 | cmap_qemu, /* qemu vga */ | ||
51 | }; | 52 | }; |
52 | 53 | ||
53 | struct offb_par { | 54 | struct offb_par { |
@@ -138,7 +139,7 @@ static int offb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, | |||
138 | return 0; | 139 | return 0; |
139 | 140 | ||
140 | switch (par->cmap_type) { | 141 | switch (par->cmap_type) { |
141 | case cmap_m64: | 142 | case cmap_simple: |
142 | writeb(regno, par->cmap_adr); | 143 | writeb(regno, par->cmap_adr); |
143 | writeb(red, par->cmap_data); | 144 | writeb(red, par->cmap_data); |
144 | writeb(green, par->cmap_data); | 145 | writeb(green, par->cmap_data); |
@@ -208,7 +209,7 @@ static int offb_blank(int blank, struct fb_info *info) | |||
208 | if (blank) | 209 | if (blank) |
209 | for (i = 0; i < 256; i++) { | 210 | for (i = 0; i < 256; i++) { |
210 | switch (par->cmap_type) { | 211 | switch (par->cmap_type) { |
211 | case cmap_m64: | 212 | case cmap_simple: |
212 | writeb(i, par->cmap_adr); | 213 | writeb(i, par->cmap_adr); |
213 | for (j = 0; j < 3; j++) | 214 | for (j = 0; j < 3; j++) |
214 | writeb(0, par->cmap_data); | 215 | writeb(0, par->cmap_data); |
@@ -350,7 +351,7 @@ static void offb_init_palette_hacks(struct fb_info *info, struct device_node *dp | |||
350 | par->cmap_adr = | 351 | par->cmap_adr = |
351 | ioremap(base + 0x7ff000, 0x1000) + 0xcc0; | 352 | ioremap(base + 0x7ff000, 0x1000) + 0xcc0; |
352 | par->cmap_data = par->cmap_adr + 1; | 353 | par->cmap_data = par->cmap_adr + 1; |
353 | par->cmap_type = cmap_m64; | 354 | par->cmap_type = cmap_simple; |
354 | } else if (dp && (of_device_is_compatible(dp, "pci1014,b7") || | 355 | } else if (dp && (of_device_is_compatible(dp, "pci1014,b7") || |
355 | of_device_is_compatible(dp, "pci1014,21c"))) { | 356 | of_device_is_compatible(dp, "pci1014,21c"))) { |
356 | par->cmap_adr = offb_map_reg(dp, 0, 0x6000, 0x1000); | 357 | par->cmap_adr = offb_map_reg(dp, 0, 0x6000, 0x1000); |
@@ -371,6 +372,16 @@ static void offb_init_palette_hacks(struct fb_info *info, struct device_node *dp | |||
371 | par->cmap_type = cmap_avivo; | 372 | par->cmap_type = cmap_avivo; |
372 | } | 373 | } |
373 | of_node_put(pciparent); | 374 | of_node_put(pciparent); |
375 | } else if (dp && of_device_is_compatible(dp, "qemu,std-vga")) { | ||
376 | const u32 io_of_addr[3] = { 0x01000000, 0x0, 0x0 }; | ||
377 | u64 io_addr = of_translate_address(dp, io_of_addr); | ||
378 | if (io_addr != OF_BAD_ADDR) { | ||
379 | par->cmap_adr = ioremap(io_addr + 0x3c8, 2); | ||
380 | if (par->cmap_adr) { | ||
381 | par->cmap_type = cmap_simple; | ||
382 | par->cmap_data = par->cmap_adr + 1; | ||
383 | } | ||
384 | } | ||
374 | } | 385 | } |
375 | info->fix.visual = (par->cmap_type != cmap_unknown) ? | 386 | info->fix.visual = (par->cmap_type != cmap_unknown) ? |
376 | FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_STATIC_PSEUDOCOLOR; | 387 | FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_STATIC_PSEUDOCOLOR; |