]> err.no Git - linux-2.6/blobdiff - drivers/video/cirrusfb.c
pm2fb: white spaces clean up
[linux-2.6] / drivers / video / cirrusfb.c
index dda240eb73609c5f93a0efa7895548d5f47603cf..8269d704ab2a2c27731490b3eeb39b203c9f80f3 100644 (file)
 
 #define CIRRUSFB_VERSION "2.0-pre2"
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/mm.h>
-#include <linux/tty.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/fb.h>
 #define assert(expr)
 #endif
 
-#ifdef TRUE
-#undef TRUE
-#endif
-#ifdef FALSE
-#undef FALSE
-#endif
-#define TRUE  1
-#define FALSE 0
-
 #define MB_ (1024*1024)
 #define KB_ (1024)
 
@@ -148,9 +137,9 @@ static const struct cirrusfb_board_info_rec {
        char *name;             /* ASCII name of chipset */
        long maxclock[5];               /* maximum video clock */
        /* for  1/4bpp, 8bpp 15/16bpp, 24bpp, 32bpp - numbers from xorg code */
-       unsigned init_sr07 : 1; /* init SR07 during init_vgachip() */
-       unsigned init_sr1f : 1; /* write SR1F during init_vgachip() */
-       unsigned scrn_start_bit19 : 1; /* construct bit 19 of screen start address */
+       bool init_sr07 : 1; /* init SR07 during init_vgachip() */
+       bool init_sr1f : 1; /* write SR1F during init_vgachip() */
+       bool scrn_start_bit19 : 1; /* construct bit 19 of screen start address */
 
        /* initial SR07 value, then for each mode */
        unsigned char sr07;
@@ -168,9 +157,9 @@ static const struct cirrusfb_board_info_rec {
                        /* the SD64/P4 have a higher max. videoclock */
                        140000, 140000, 140000, 140000, 140000,
                },
-               .init_sr07              = TRUE,
-               .init_sr1f              = TRUE,
-               .scrn_start_bit19       = TRUE,
+               .init_sr07              = true,
+               .init_sr1f              = true,
+               .scrn_start_bit19       = true,
                .sr07                   = 0xF0,
                .sr07_1bpp              = 0xF0,
                .sr07_8bpp              = 0xF1,
@@ -182,9 +171,9 @@ static const struct cirrusfb_board_info_rec {
                        /* guess */
                        90000, 90000, 90000, 90000, 90000
                },
-               .init_sr07              = TRUE,
-               .init_sr1f              = TRUE,
-               .scrn_start_bit19       = FALSE,
+               .init_sr07              = true,
+               .init_sr1f              = true,
+               .scrn_start_bit19       = false,
                .sr07                   = 0x80,
                .sr07_1bpp              = 0x80,
                .sr07_8bpp              = 0x81,
@@ -196,9 +185,9 @@ static const struct cirrusfb_board_info_rec {
                        /* guess */
                        90000, 90000, 90000, 90000, 90000
                },
-               .init_sr07              = TRUE,
-               .init_sr1f              = TRUE,
-               .scrn_start_bit19       = FALSE,
+               .init_sr07              = true,
+               .init_sr1f              = true,
+               .scrn_start_bit19       = false,
                .sr07                   = 0x20,
                .sr07_1bpp              = 0x20,
                .sr07_8bpp              = 0x21,
@@ -210,9 +199,9 @@ static const struct cirrusfb_board_info_rec {
                        /* guess */
                        90000, 90000, 90000, 90000, 90000
                },
-               .init_sr07              = TRUE,
-               .init_sr1f              = TRUE,
-               .scrn_start_bit19       = FALSE,
+               .init_sr07              = true,
+               .init_sr1f              = true,
+               .scrn_start_bit19       = false,
                .sr07                   = 0x80,
                .sr07_1bpp              = 0x80,
                .sr07_8bpp              = 0x81,
@@ -223,9 +212,9 @@ static const struct cirrusfb_board_info_rec {
                .maxclock               = {
                        135100, 135100, 85500, 85500, 0
                },
-               .init_sr07              = TRUE,
-               .init_sr1f              = FALSE,
-               .scrn_start_bit19       = TRUE,
+               .init_sr07              = true,
+               .init_sr1f              = false,
+               .scrn_start_bit19       = true,
                .sr07                   = 0x20,
                .sr07_1bpp              = 0x20,
                .sr07_8bpp              = 0x21,
@@ -237,9 +226,9 @@ static const struct cirrusfb_board_info_rec {
                        /* for the GD5430.  GD5446 can do more... */
                        85500, 85500, 50000, 28500, 0
                },
-               .init_sr07              = TRUE,
-               .init_sr1f              = TRUE,
-               .scrn_start_bit19       = TRUE,
+               .init_sr07              = true,
+               .init_sr1f              = true,
+               .scrn_start_bit19       = true,
                .sr07                   = 0xA0,
                .sr07_1bpp              = 0xA1,
                .sr07_1bpp_mux          = 0xA7,
@@ -252,9 +241,9 @@ static const struct cirrusfb_board_info_rec {
                .maxclock               = {
                        135100, 200000, 200000, 135100, 135100
                },
-               .init_sr07              = TRUE,
-               .init_sr1f              = TRUE,
-               .scrn_start_bit19       = TRUE,
+               .init_sr07              = true,
+               .init_sr1f              = true,
+               .scrn_start_bit19       = true,
                .sr07                   = 0x10,
                .sr07_1bpp              = 0x11,
                .sr07_8bpp              = 0x11,
@@ -266,9 +255,9 @@ static const struct cirrusfb_board_info_rec {
                        /* guess */
                        135100, 135100, 135100, 135100, 135100,
                },
-               .init_sr07              = FALSE,
-               .init_sr1f              = FALSE,
-               .scrn_start_bit19       = TRUE,
+               .init_sr07              = false,
+               .init_sr1f              = false,
+               .scrn_start_bit19       = true,
        }
 };
 
@@ -817,7 +806,7 @@ static int cirrusfb_check_var(struct fb_var_screeninfo *var,
 
        default:
                DPRINTK("Unsupported bpp size: %d\n", var->bits_per_pixel);
-               assert (FALSE);
+               assert(false);
                /* should never occur */
                break;
        }
@@ -888,7 +877,7 @@ static int cirrusfb_decode_var (const struct fb_var_screeninfo *var,
 
        default:
                DPRINTK("Unsupported bpp size: %d\n", var->bits_per_pixel);
-               assert (FALSE);
+               assert(false);
                /* should never occur */
                break;
        }
@@ -2444,7 +2433,10 @@ static int cirrusfb_pci_register (struct pci_dev *pdev,
        printk ("Cirrus Logic chipset on PCI bus\n");
        pci_set_drvdata(pdev, info);
 
-       return cirrusfb_register(cinfo);
+       ret = cirrusfb_register(cinfo);
+       if (ret)
+               iounmap(cinfo->fbmem);
+       return ret;
 
 err_release_legacy:
        if (release_io_ports)
@@ -2576,7 +2568,15 @@ static int cirrusfb_zorro_register(struct zorro_dev *z,
        printk (KERN_INFO "Cirrus Logic chipset on Zorro bus\n");
        zorro_set_drvdata(z, info);
 
-       return cirrusfb_register(cinfo);
+       ret = cirrusfb_register(cinfo);
+       if (ret) {
+               if (btype == BT_PICASSO4) {
+                       iounmap(cinfo->fbmem);
+                       iounmap(cinfo->regbase - 0x600000);
+               } else if (board_addr > 0x01000000)
+                       iounmap(cinfo->fbmem);
+       }
+       return ret;
 
 err_unmap_regbase:
        /* Parental advisory: explicit hack */
@@ -3194,7 +3194,7 @@ void cirrusfb_dbg_print_regs (caddr_t regbase, cirrusfb_dbg_reg_class_t reg_clas
                        break;
                default:
                        /* should never occur */
-                       assert (FALSE);
+                       assert(false);
                        break;
                }