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