fbdev: move FBIO_WAITFORVSYNC to linux/fb.h
[safe/jmp/linux-2.6] / drivers / video / intelfb / intelfb.h
index e290d74..6b51175 100644 (file)
@@ -6,11 +6,15 @@
 #include <linux/agp_backend.h>
 #include <linux/fb.h>
 
 #include <linux/agp_backend.h>
 #include <linux/fb.h>
 
+#ifdef CONFIG_FB_INTEL_I2C
+#include <linux/i2c.h>
+#include <linux/i2c-algo-bit.h>
+#endif
 
 /*** Version/name ***/
 
 /*** Version/name ***/
-#define INTELFB_VERSION                        "0.9.4"
+#define INTELFB_VERSION                        "0.9.6"
 #define INTELFB_MODULE_NAME            "intelfb"
 #define INTELFB_MODULE_NAME            "intelfb"
-#define SUPPORTED_CHIPSETS             "830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM"
+#define SUPPORTED_CHIPSETS             "830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/945GME/965G/965GM"
 
 
 /*** Debug/feature defines ***/
 
 
 /*** Debug/feature defines ***/
 #define PCI_DEVICE_ID_INTEL_830M       0x3577
 #define PCI_DEVICE_ID_INTEL_845G       0x2562
 #define PCI_DEVICE_ID_INTEL_85XGM      0x3582
 #define PCI_DEVICE_ID_INTEL_830M       0x3577
 #define PCI_DEVICE_ID_INTEL_845G       0x2562
 #define PCI_DEVICE_ID_INTEL_85XGM      0x3582
+#define PCI_DEVICE_ID_INTEL_854                0x358E
 #define PCI_DEVICE_ID_INTEL_865G       0x2572
 #define PCI_DEVICE_ID_INTEL_915G       0x2582
 #define PCI_DEVICE_ID_INTEL_915GM      0x2592
 #define PCI_DEVICE_ID_INTEL_945G       0x2772
 #define PCI_DEVICE_ID_INTEL_945GM      0x27A2
 #define PCI_DEVICE_ID_INTEL_865G       0x2572
 #define PCI_DEVICE_ID_INTEL_915G       0x2582
 #define PCI_DEVICE_ID_INTEL_915GM      0x2592
 #define PCI_DEVICE_ID_INTEL_945G       0x2772
 #define PCI_DEVICE_ID_INTEL_945GM      0x27A2
+#define PCI_DEVICE_ID_INTEL_945GME     0x27AE
+#define PCI_DEVICE_ID_INTEL_965G       0x29A2
+#define PCI_DEVICE_ID_INTEL_965GM      0x2A02
 
 /* Size of MMIO region */
 #define INTEL_REG_SIZE                 0x80000
 
 /* Size of MMIO region */
 #define INTEL_REG_SIZE                 0x80000
 
 #define FIXED_MODE(d) ((d)->fixed_mode)
 
 
 #define FIXED_MODE(d) ((d)->fixed_mode)
 
-/*** Driver paramters ***/
+/*** Driver parameters ***/
 
 #define RINGBUFFER_SIZE                KB(64)
 #define HW_CURSOR_SIZE         KB(4)
 
 #define RINGBUFFER_SIZE                KB(64)
 #define HW_CURSOR_SIZE         KB(4)
 /* Intel agpgart driver */
 #define AGP_PHYSICAL_MEMORY     2
 
 /* Intel agpgart driver */
 #define AGP_PHYSICAL_MEMORY     2
 
+/* store information about an Ixxx DVO */
+/* The i830->i865 use multiple DVOs with multiple i2cs */
+/* the i915, i945 have a single sDVO i2c bus - which is different */
+#define MAX_OUTPUTS 6
+
+/* these are outputs from the chip - integrated only
+   external chips are via DVO or SDVO output */
+#define INTELFB_OUTPUT_UNUSED 0
+#define INTELFB_OUTPUT_ANALOG 1
+#define INTELFB_OUTPUT_DVO 2
+#define INTELFB_OUTPUT_SDVO 3
+#define INTELFB_OUTPUT_LVDS 4
+#define INTELFB_OUTPUT_TVOUT 5
+
+#define INTELFB_DVO_CHIP_NONE 0
+#define INTELFB_DVO_CHIP_LVDS 1
+#define INTELFB_DVO_CHIP_TMDS 2
+#define INTELFB_DVO_CHIP_TVOUT 4
+
+#define INTELFB_OUTPUT_PIPE_NC  0
+#define INTELFB_OUTPUT_PIPE_A   1
+#define INTELFB_OUTPUT_PIPE_B   2
+
 /*** Data Types ***/
 
 /* supported chipsets */
 /*** Data Types ***/
 
 /* supported chipsets */
@@ -124,6 +155,7 @@ enum intel_chips {
        INTEL_85XGM,
        INTEL_852GM,
        INTEL_852GME,
        INTEL_85XGM,
        INTEL_852GM,
        INTEL_852GME,
+       INTEL_854,
        INTEL_855GM,
        INTEL_855GME,
        INTEL_865G,
        INTEL_855GM,
        INTEL_855GME,
        INTEL_865G,
@@ -131,6 +163,9 @@ enum intel_chips {
        INTEL_915GM,
        INTEL_945G,
        INTEL_945GM,
        INTEL_915GM,
        INTEL_945G,
        INTEL_945GM,
+       INTEL_945GME,
+       INTEL_965G,
+       INTEL_965GM,
 };
 
 struct intelfb_hwstate {
 };
 
 struct intelfb_hwstate {
@@ -195,13 +230,44 @@ struct intelfb_hwstate {
        u32 mem_mode;
        u32 fw_blc_0;
        u32 fw_blc_1;
        u32 mem_mode;
        u32 fw_blc_0;
        u32 fw_blc_1;
+       u16 hwstam;
+       u16 ier;
+       u16 iir;
+       u16 imr;
 };
 
 struct intelfb_heap_data {
        u32 physical;
        u8 __iomem *virtual;
 };
 
 struct intelfb_heap_data {
        u32 physical;
        u8 __iomem *virtual;
-       u32 offset;  // in GATT pages
-       u32 size;    // in bytes
+       u32 offset;             /* in GATT pages */
+       u32 size;               /* in bytes */
+};
+
+#ifdef CONFIG_FB_INTEL_I2C
+struct intelfb_i2c_chan {
+    struct intelfb_info *dinfo;
+    u32 reg;
+    struct i2c_adapter adapter;
+    struct i2c_algo_bit_data algo;
+};
+#endif
+
+struct intelfb_output_rec {
+    int type;
+    int pipe;
+    int flags;
+
+#ifdef CONFIG_FB_INTEL_I2C
+    struct intelfb_i2c_chan i2c_bus;
+    struct intelfb_i2c_chan ddc_bus;
+#endif
+};
+
+struct intelfb_vsync {
+       wait_queue_head_t wait;
+       unsigned int count;
+       int pan_display;
+       u32 pan_offset;
 };
 
 struct intelfb_info {
 };
 
 struct intelfb_info {
@@ -212,15 +278,15 @@ struct intelfb_info {
        struct intelfb_hwstate save_state;
 
        /* agpgart structs */
        struct intelfb_hwstate save_state;
 
        /* agpgart structs */
-       struct agp_memory *gtt_fb_mem;     // use all stolen memory or vram
-       struct agp_memory *gtt_ring_mem;   // ring buffer
-       struct agp_memory *gtt_cursor_mem; // hw cursor
+       struct agp_memory *gtt_fb_mem;     /* use all stolen memory or vram */
+       struct agp_memory *gtt_ring_mem;   /* ring buffer */
+       struct agp_memory *gtt_cursor_mem; /* hw cursor */
 
        /* use a gart reserved fb mem */
        u8 fbmem_gart;
 
        /* mtrr support */
 
        /* use a gart reserved fb mem */
        u8 fbmem_gart;
 
        /* mtrr support */
-       u32 mtrr_reg;
+       int mtrr_reg;
        u32 has_mtrr;
 
        /* heap data */
        u32 has_mtrr;
 
        /* heap data */
@@ -244,7 +310,7 @@ struct intelfb_info {
        u32 ring_lockup;
 
        /* palette */
        u32 ring_lockup;
 
        /* palette */
-       u32 pseudo_palette[17];
+       u32 pseudo_palette[16];
 
        /* chip info */
        int pci_chipset;
 
        /* chip info */
        int pci_chipset;
@@ -267,6 +333,12 @@ struct intelfb_info {
        int fixed_mode;
        int ring_active;
        int flag;
        int fixed_mode;
        int ring_active;
        int flag;
+       unsigned long irq_flags;
+       int open;
+
+       /* vsync */
+       struct intelfb_vsync vsync;
+       spinlock_t int_lock;
 
        /* hw cursor */
        int cursor_on;
 
        /* hw cursor */
        int cursor_on;
@@ -282,15 +354,30 @@ struct intelfb_info {
 
        /* driver registered */
        int registered;
 
        /* driver registered */
        int registered;
-       
+
        /* index into plls */
        int pll_index;
        /* index into plls */
        int pll_index;
+
+       /* outputs */
+       int num_outputs;
+       struct intelfb_output_rec output[MAX_OUTPUTS];
 };
 
 };
 
-#define IS_I9XX(dinfo) (((dinfo)->chipset == INTEL_915G)||(dinfo->chipset == INTEL_915GM)||((dinfo)->chipset == INTEL_945G)||(dinfo->chipset==INTEL_945GM))
+#define IS_I9XX(dinfo) (((dinfo)->chipset == INTEL_915G) ||    \
+                       ((dinfo)->chipset == INTEL_915GM) ||    \
+                       ((dinfo)->chipset == INTEL_945G) ||     \
+                       ((dinfo)->chipset == INTEL_945GM) ||    \
+                       ((dinfo)->chipset == INTEL_945GME) ||   \
+                       ((dinfo)->chipset == INTEL_965G) ||     \
+                       ((dinfo)->chipset == INTEL_965GM))
 
 /*** function prototypes ***/
 
 extern int intelfb_var_to_depth(const struct fb_var_screeninfo *var);
 
 
 /*** function prototypes ***/
 
 extern int intelfb_var_to_depth(const struct fb_var_screeninfo *var);
 
+#ifdef CONFIG_FB_INTEL_I2C
+extern void intelfb_create_i2c_busses(struct intelfb_info *dinfo);
+extern void intelfb_delete_i2c_busses(struct intelfb_info *dinfo);
+#endif
+
 #endif /* _INTELFB_H */
 #endif /* _INTELFB_H */