This source file includes following definitions.
- ps_to_hz
1
2 #ifndef LYNXDRV_H_
3 #define LYNXDRV_H_
4
5 #define FB_ACCEL_SMI 0xab
6
7 #define MHZ(x) ((x) * 1000000)
8
9 #define DEFAULT_SM750_CHIP_CLOCK 290
10 #define DEFAULT_SM750LE_CHIP_CLOCK 333
11 #ifndef SM750LE_REVISION_ID
12 #define SM750LE_REVISION_ID ((unsigned char)0xfe)
13 #endif
14
15 enum sm750_pnltype {
16 sm750_24TFT = 0,
17 sm750_dualTFT = 2,
18 sm750_doubleTFT = 1,
19 };
20
21
22 enum sm750_dataflow {
23 sm750_simul_pri,
24 sm750_simul_sec,
25 sm750_dual_normal,
26 sm750_dual_swap,
27 };
28
29 enum sm750_channel {
30 sm750_primary = 0,
31
32 sm750_secondary = 1,
33 };
34
35 enum sm750_path {
36 sm750_panel = 1,
37 sm750_crt = 2,
38 sm750_pnc = 3,
39 };
40
41 struct init_status {
42 ushort powerMode;
43
44 ushort chip_clk;
45 ushort mem_clk;
46 ushort master_clk;
47 ushort setAllEngOff;
48 ushort resetMemory;
49 };
50
51 struct lynx_accel {
52
53 volatile unsigned char __iomem *dprBase;
54
55 volatile unsigned char __iomem *dpPortBase;
56
57
58 void (*de_init)(struct lynx_accel *);
59
60 int (*de_wait)(void);
61
62 int (*de_fillrect)(struct lynx_accel *, u32, u32, u32, u32,
63 u32, u32, u32, u32, u32);
64
65 int (*de_copyarea)(struct lynx_accel *, u32, u32, u32, u32,
66 u32, u32, u32, u32,
67 u32, u32, u32, u32);
68
69 int (*de_imageblit)(struct lynx_accel *, const char *, u32, u32, u32, u32,
70 u32, u32, u32, u32,
71 u32, u32, u32, u32);
72
73 };
74
75 struct sm750_dev {
76
77 u16 devid;
78 u8 revid;
79 struct pci_dev *pdev;
80 struct fb_info *fbinfo[2];
81 struct lynx_accel accel;
82 int accel_off;
83 int fb_count;
84 int mtrr_off;
85 struct{
86 int vram;
87 } mtrr;
88
89 unsigned long vidmem_start;
90 unsigned long vidreg_start;
91 __u32 vidmem_size;
92 __u32 vidreg_size;
93 void __iomem *pvReg;
94 unsigned char __iomem *pvMem;
95
96 spinlock_t slock;
97
98 struct init_status initParm;
99 enum sm750_pnltype pnltype;
100 enum sm750_dataflow dataflow;
101 int nocrt;
102
103
104
105
106
107
108
109 int hwCursor;
110 };
111
112 struct lynx_cursor {
113
114 int w;
115 int h;
116 int size;
117
118 int maxW;
119 int maxH;
120
121 char __iomem *vstart;
122 int offset;
123
124 volatile char __iomem *mmio;
125 };
126
127 struct lynxfb_crtc {
128 unsigned char __iomem *vCursor;
129 unsigned char __iomem *vScreen;
130 int oCursor;
131 int oScreen;
132 int channel;
133 resource_size_t vidmem_size;
134
135
136 u16 line_pad;
137 u16 xpanstep;
138 u16 ypanstep;
139 u16 ywrapstep;
140
141 void *priv;
142
143
144 struct lynx_cursor cursor;
145 };
146
147 struct lynxfb_output {
148 int dpms;
149 int paths;
150
151
152
153
154
155
156
157 int *channel;
158
159
160
161
162
163
164 void *priv;
165
166 int (*proc_setBLANK)(struct lynxfb_output*, int);
167 };
168
169 struct lynxfb_par {
170
171 int index;
172 unsigned int pseudo_palette[256];
173 struct lynxfb_crtc crtc;
174 struct lynxfb_output output;
175 struct fb_info *info;
176 struct sm750_dev *dev;
177 };
178
179 static inline unsigned long ps_to_hz(unsigned int psvalue)
180 {
181 unsigned long long numerator = 1000 * 1000 * 1000 * 1000ULL;
182
183 do_div(numerator, psvalue);
184 return (unsigned long)numerator;
185 }
186
187 int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev);
188 int hw_sm750_inithw(struct sm750_dev *sm750_dev, struct pci_dev *pdev);
189 void hw_sm750_initAccel(struct sm750_dev *sm750_dev);
190 int hw_sm750_deWait(void);
191 int hw_sm750le_deWait(void);
192
193 int hw_sm750_output_setMode(struct lynxfb_output *output,
194 struct fb_var_screeninfo *var,
195 struct fb_fix_screeninfo *fix);
196
197 int hw_sm750_crtc_checkMode(struct lynxfb_crtc *crtc,
198 struct fb_var_screeninfo *var);
199
200 int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc,
201 struct fb_var_screeninfo *var,
202 struct fb_fix_screeninfo *fix);
203
204 int hw_sm750_setColReg(struct lynxfb_crtc *crtc, ushort index,
205 ushort red, ushort green, ushort blue);
206
207 int hw_sm750_setBLANK(struct lynxfb_output *output, int blank);
208 int hw_sm750le_setBLANK(struct lynxfb_output *output, int blank);
209 int hw_sm750_pan_display(struct lynxfb_crtc *crtc,
210 const struct fb_var_screeninfo *var,
211 const struct fb_info *info);
212
213 #endif