5 #include <linux/types.h>
7 #include <linux/i2c-algo-bit.h>
8 #include <linux/mutex.h>
11 #define NV_ARCH_04 0x04
12 #define NV_ARCH_10 0x10
13 #define NV_ARCH_20 0x20
14 #define NV_ARCH_30 0x30
15 #define NV_ARCH_40 0x40
17 #define BITMASK(t,b) (((unsigned)(1U << (((t)-(b)+1)))-1) << (b))
18 #define MASKEXPAND(mask) BITMASK(1?mask,0?mask)
19 #define SetBF(mask,value) ((value) << (0?mask))
20 #define GetBF(var,mask) (((unsigned)((var) & MASKEXPAND(mask))) >> (0?mask) )
21 #define SetBitField(value,from,to) SetBF(to, GetBF(value,from))
22 #define SetBit(n) (1<<(n))
23 #define Set8Bits(value) ((value)&0xff)
34 #define NUM_SEQ_REGS 0x05
35 #define NUM_CRT_REGS 0x41
36 #define NUM_GRC_REGS 0x09
37 #define NUM_ATC_REGS 0x15
41 struct nvidia_i2c_chan {
42 struct nvidia_par *par;
43 unsigned long ddc_base;
44 struct i2c_adapter adapter;
45 struct i2c_algo_bit_data algo;
48 typedef struct _riva_hw_state {
49 u8 attr[NUM_ATC_REGS];
50 u8 crtc[NUM_CRT_REGS];
97 RIVA_HW_STATE SavedReg;
98 RIVA_HW_STATE ModeReg;
99 RIVA_HW_STATE initial_state;
100 RIVA_HW_STATE *CurrentState;
101 struct vgastate vgastate;
102 struct mutex open_lock;
103 u32 pseudo_palette[16];
104 struct pci_dev *pci_dev;
108 unsigned long FbAddress;
112 u32 ScratchBufferSize;
113 u32 ScratchBufferStart;
115 u32 MinVClockFreqKHz;
116 u32 MaxVClockFreqKHz;
120 NVFBLayout CurrentLayout;
145 u32 __iomem *dmaBase;
147 int WaitVSyncPossible;
148 int BlendingPossible;
159 struct nvidia_i2c_chan chan[3];
161 volatile u32 __iomem *REGS;
162 volatile u32 __iomem *PCRTC0;
163 volatile u32 __iomem *PCRTC;
164 volatile u32 __iomem *PRAMDAC0;
165 volatile u32 __iomem *PFB;
166 volatile u32 __iomem *PFIFO;
167 volatile u32 __iomem *PGRAPH;
168 volatile u32 __iomem *PEXTDEV;
169 volatile u32 __iomem *PTIMER;
170 volatile u32 __iomem *PMC;
171 volatile u32 __iomem *PRAMIN;
172 volatile u32 __iomem *FIFO;
173 volatile u32 __iomem *CURSOR;
174 volatile u8 __iomem *PCIO0;
175 volatile u8 __iomem *PCIO;
176 volatile u8 __iomem *PVIO;
177 volatile u8 __iomem *PDIO0;
178 volatile u8 __iomem *PDIO;
179 volatile u32 __iomem *PRAMDAC;
182 #endif /* __NV_TYPE_H__ */