5 #include <linux/types.h>
7 #include <linux/i2c-algo-bit.h>
10 #define NV_ARCH_04 0x04
11 #define NV_ARCH_10 0x10
12 #define NV_ARCH_20 0x20
13 #define NV_ARCH_30 0x30
14 #define NV_ARCH_40 0x40
16 #define BITMASK(t,b) (((unsigned)(1U << (((t)-(b)+1)))-1) << (b))
17 #define MASKEXPAND(mask) BITMASK(1?mask,0?mask)
18 #define SetBF(mask,value) ((value) << (0?mask))
19 #define GetBF(var,mask) (((unsigned)((var) & MASKEXPAND(mask))) >> (0?mask) )
20 #define SetBitField(value,from,to) SetBF(to, GetBF(value,from))
21 #define SetBit(n) (1<<(n))
22 #define Set8Bits(value) ((value)&0xff)
33 #define NUM_SEQ_REGS 0x05
34 #define NUM_CRT_REGS 0x41
35 #define NUM_GRC_REGS 0x09
36 #define NUM_ATC_REGS 0x15
40 struct nvidia_i2c_chan {
41 struct nvidia_par *par;
42 unsigned long ddc_base;
43 struct i2c_adapter adapter;
44 struct i2c_algo_bit_data algo;
47 typedef struct _riva_hw_state {
48 u8 attr[NUM_ATC_REGS];
49 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 u32 pseudo_palette[16];
102 struct pci_dev *pci_dev;
106 unsigned long FbAddress;
110 u32 ScratchBufferSize;
111 u32 ScratchBufferStart;
113 u32 MinVClockFreqKHz;
114 u32 MaxVClockFreqKHz;
118 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__ */