1 #ifndef LYNX_HW750_H__
2 #define LYNX_HW750_H__
3 
4 
5 #define DEFAULT_SM750_CHIP_CLOCK 		290
6 #define DEFAULT_SM750LE_CHIP_CLOCK  	333
7 #ifndef SM750LE_REVISION_ID
8 #define SM750LE_REVISION_ID (unsigned char)0xfe
9 #endif
10 
11 //#define DEFAULT_MEM_CLOCK	(DEFAULT_SM750_CHIP_CLOCK/1)
12 //#define DEFAULT_MASTER_CLOCK	(DEFAULT_SM750_CHIP_CLOCK/3)
13 
14 
15 enum sm750_pnltype{
16 
17 	sm750_24TFT = 0,/* 24bit tft */
18 
19 	sm750_dualTFT = 2,/* dual 18 bit tft */
20 
21 	sm750_doubleTFT = 1,/* 36 bit double pixel tft */
22 };
23 
24 /* vga channel is not concerned  */
25 enum sm750_dataflow{
26 	sm750_simul_pri,/* primary => all head */
27 
28 	sm750_simul_sec,/* secondary => all head */
29 
30 	sm750_dual_normal,/* 	primary => panel head and secondary => crt */
31 
32 	sm750_dual_swap,/* 	primary => crt head and secondary => panel */
33 };
34 
35 
36 enum sm750_channel{
37 	sm750_primary = 0,
38 	/* enum value equal to the register filed data */
39 	sm750_secondary = 1,
40 };
41 
42 enum sm750_path{
43 	sm750_panel = 1,
44 	sm750_crt = 2,
45 	sm750_pnc = 3,/* panel and crt */
46 };
47 
48 struct init_status{
49 	ushort powerMode;
50 	/* below three clocks are in unit of MHZ*/
51 	ushort chip_clk;
52 	ushort mem_clk;
53 	ushort master_clk;
54 	ushort setAllEngOff;
55 	ushort resetMemory;
56 };
57 
58 struct sm750_state{
59 	struct init_status initParm;
60 	enum sm750_pnltype pnltype;
61 	enum sm750_dataflow dataflow;
62 	int nocrt;
63 	int xLCD;
64 	int yLCD;
65 };
66 
67 /* 	sm750_share stands for a presentation of two frame buffer
68 	that use one sm750 adaptor, it is similiar to the super class of lynx_share
69 	in C++
70 */
71 
72 struct sm750_share{
73 	/* it's better to put lynx_share struct to the first place of sm750_share */
74 	struct lynx_share share;
75 	struct sm750_state state;
76 	int hwCursor;
77 	/* 	0: no hardware cursor
78 		1: primary crtc hw cursor enabled,
79 		2: secondary crtc hw cursor enabled
80 		3: both ctrc hw cursor enabled
81 	*/
82 };
83 
84 int hw_sm750_map(struct lynx_share* share,struct pci_dev* pdev);
85 int hw_sm750_inithw(struct lynx_share*,struct pci_dev *);
86 void hw_sm750_initAccel(struct lynx_share *);
87 int hw_sm750_deWait(void);
88 int hw_sm750le_deWait(void);
89 
90 resource_size_t hw_sm750_getVMSize(struct lynx_share *);
91 int hw_sm750_output_checkMode(struct lynxfb_output*,struct fb_var_screeninfo*);
92 int hw_sm750_output_setMode(struct lynxfb_output*,struct fb_var_screeninfo*,struct fb_fix_screeninfo*);
93 int hw_sm750_crtc_checkMode(struct lynxfb_crtc*,struct fb_var_screeninfo*);
94 int hw_sm750_crtc_setMode(struct lynxfb_crtc*,struct fb_var_screeninfo*,struct fb_fix_screeninfo*);
95 int hw_sm750_setColReg(struct lynxfb_crtc*,ushort,ushort,ushort,ushort);
96 int hw_sm750_setBLANK(struct lynxfb_output*,int);
97 int hw_sm750le_setBLANK(struct lynxfb_output*,int);
98 void hw_sm750_crtc_clear(struct lynxfb_crtc*);
99 void hw_sm750_output_clear(struct lynxfb_output*);
100 int hw_sm750_pan_display(struct lynxfb_crtc *crtc,
101         const struct fb_var_screeninfo *var,
102         const struct fb_info *info);
103 
104 #endif
105