]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/video/sa1100fb.h
77239b766e5634ac956f002209c2c001a6318984
[karo-tx-linux.git] / drivers / video / sa1100fb.h
1 /*
2  * linux/drivers/video/sa1100fb.h
3  *    -- StrongARM 1100 LCD Controller Frame Buffer Device
4  *
5  *  Copyright (C) 1999 Eric A. Thomas
6  *   Based on acornfb.c Copyright (C) Russell King.
7  *  
8  * This file is subject to the terms and conditions of the GNU General Public
9  * License.  See the file COPYING in the main directory of this archive
10  * for more details.
11  */
12
13 #define RGB_4   0
14 #define RGB_8   1
15 #define RGB_16  2
16 #define NR_RGB  3
17
18 /* These are the bitfields for each display depth that we support. */
19 struct sa1100fb_rgb {
20         struct fb_bitfield      red;
21         struct fb_bitfield      green;
22         struct fb_bitfield      blue;
23         struct fb_bitfield      transp;
24 };
25
26 /* This structure describes the machine which we are running on. */
27 struct sa1100fb_mach_info {
28         u_long          pixclock;
29
30         u_short         xres;
31         u_short         yres;
32
33         u_char          bpp;
34         u_char          hsync_len;
35         u_char          left_margin;
36         u_char          right_margin;
37
38         u_char          vsync_len;
39         u_char          upper_margin;
40         u_char          lower_margin;
41         u_char          sync;
42
43         u_int           cmap_greyscale:1,
44                         cmap_inverse:1,
45                         cmap_static:1,
46                         unused:29;
47
48         u_int           lccr0;
49         u_int           lccr3;
50
51         /* Overrides for the default RGB maps */
52         const struct sa1100fb_rgb *rgb[NR_RGB];
53 };
54
55 /* Shadows for LCD controller registers */
56 struct sa1100fb_lcd_reg {
57         unsigned long lccr0;
58         unsigned long lccr1;
59         unsigned long lccr2;
60         unsigned long lccr3;
61 };
62
63 struct sa1100fb_info {
64         struct fb_info          fb;
65         struct device           *dev;
66         const struct sa1100fb_rgb *rgb[NR_RGB];
67
68         u_int                   max_bpp;
69         u_int                   max_xres;
70         u_int                   max_yres;
71
72         /*
73          * These are the addresses we mapped
74          * the framebuffer memory region to.
75          */
76         dma_addr_t              map_dma;
77         u_char *                map_cpu;
78         u_int                   map_size;
79
80         u_char *                screen_cpu;
81         dma_addr_t              screen_dma;
82         u16 *                   palette_cpu;
83         dma_addr_t              palette_dma;
84         u_int                   palette_size;
85
86         dma_addr_t              dbar1;
87         dma_addr_t              dbar2;
88
89         u_int                   lccr0;
90         u_int                   lccr3;
91         u_int                   cmap_inverse:1,
92                                 cmap_static:1,
93                                 unused:30;
94
95         u_int                   reg_lccr0;
96         u_int                   reg_lccr1;
97         u_int                   reg_lccr2;
98         u_int                   reg_lccr3;
99
100         volatile u_char         state;
101         volatile u_char         task_state;
102         struct mutex            ctrlr_lock;
103         wait_queue_head_t       ctrlr_wait;
104         struct work_struct      task;
105
106 #ifdef CONFIG_CPU_FREQ
107         struct notifier_block   freq_transition;
108         struct notifier_block   freq_policy;
109 #endif
110 };
111
112 #define TO_INF(ptr,member)      container_of(ptr,struct sa1100fb_info,member)
113
114 #define SA1100_PALETTE_MODE_VAL(bpp)    (((bpp) & 0x018) << 9)
115
116 /*
117  * These are the actions for set_ctrlr_state
118  */
119 #define C_DISABLE               (0)
120 #define C_ENABLE                (1)
121 #define C_DISABLE_CLKCHANGE     (2)
122 #define C_ENABLE_CLKCHANGE      (3)
123 #define C_REENABLE              (4)
124 #define C_DISABLE_PM            (5)
125 #define C_ENABLE_PM             (6)
126 #define C_STARTUP               (7)
127
128 #define SA1100_NAME     "SA1100"
129
130 /*
131  * Minimum X and Y resolutions
132  */
133 #define MIN_XRES        64
134 #define MIN_YRES        64
135