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];
96 RIVA_HW_STATE SavedReg;
97 RIVA_HW_STATE ModeReg;
98 RIVA_HW_STATE initial_state;
99 RIVA_HW_STATE *CurrentState;
100 struct vgastate vgastate;
101 struct mutex open_lock;
102 u32 pseudo_palette[16];
103 struct pci_dev *pci_dev;
107 unsigned long FbAddress;
111 u32 ScratchBufferSize;
112 u32 ScratchBufferStart;
114 u32 MinVClockFreqKHz;
115 u32 MaxVClockFreqKHz;
119 NVFBLayout CurrentLayout;
143 u32 __iomem *dmaBase;
145 int WaitVSyncPossible;
146 int BlendingPossible;
157 struct nvidia_i2c_chan chan[3];
159 volatile u32 __iomem *REGS;
160 volatile u32 __iomem *PCRTC0;
161 volatile u32 __iomem *PCRTC;
162 volatile u32 __iomem *PRAMDAC0;
163 volatile u32 __iomem *PFB;
164 volatile u32 __iomem *PFIFO;
165 volatile u32 __iomem *PGRAPH;
166 volatile u32 __iomem *PEXTDEV;
167 volatile u32 __iomem *PTIMER;
168 volatile u32 __iomem *PMC;
169 volatile u32 __iomem *PRAMIN;
170 volatile u32 __iomem *FIFO;
171 volatile u32 __iomem *CURSOR;
172 volatile u8 __iomem *PCIO0;
173 volatile u8 __iomem *PCIO;
174 volatile u8 __iomem *PVIO;
175 volatile u8 __iomem *PDIO0;
176 volatile u8 __iomem *PDIO;
177 volatile u32 __iomem *PRAMDAC;
180 #endif /* __NV_TYPE_H__ */