Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pxafb.h
Go to the documentation of this file.
1 #ifndef __PXAFB_H__
2 #define __PXAFB_H__
3 
4 /*
5  * linux/drivers/video/pxafb.h
6  * -- Intel PXA250/210 LCD Controller Frame Buffer Device
7  *
8  * Copyright (C) 1999 Eric A. Thomas.
9  * Copyright (C) 2004 Jean-Frederic Clere.
10  * Copyright (C) 2004 Ian Campbell.
11  * Copyright (C) 2004 Jeff Lackey.
12  * Based on sa1100fb.c Copyright (C) 1999 Eric A. Thomas
13  * which in turn is
14  * Based on acornfb.c Copyright (C) Russell King.
15  *
16  * 2001-08-03: Cliff Brake <[email protected]>
17  * - ported SA1100 code to PXA
18  *
19  * This file is subject to the terms and conditions of the GNU General Public
20  * License. See the file COPYING in the main directory of this archive
21  * for more details.
22  */
23 
24 /* PXA LCD DMA descriptor */
26  unsigned int fdadr;
27  unsigned int fsadr;
28  unsigned int fidr;
29  unsigned int ldcmd;
30 };
31 
32 enum {
33  PAL_NONE = -1,
34  PAL_BASE = 0,
35  PAL_OV1 = 1,
36  PAL_OV2 = 2,
38 };
39 
40 enum {
41  DMA_BASE = 0,
42  DMA_UPPER = 0,
43  DMA_LOWER = 1,
44  DMA_OV1 = 1,
45  DMA_OV2_Y = 2,
49  DMA_CMD = 6,
51 };
52 
53 /* maximum palette size - 256 entries, each 4 bytes long */
54 #define PALETTE_SIZE (256 * 4)
55 #define CMD_BUFF_SIZE (1024 * 50)
56 
57 /* NOTE: the palette and frame dma descriptors are doubled to allow
58  * the 2nd set for branch settings (FBRx)
59  */
61  unsigned char palette[PAL_MAX * PALETTE_SIZE];
65 };
66 
67 enum {
70 };
71 
72 enum {
78 };
79 
80 #define NONSTD_TO_XPOS(x) (((x) >> 0) & 0x3ff)
81 #define NONSTD_TO_YPOS(x) (((x) >> 10) & 0x3ff)
82 #define NONSTD_TO_PFOR(x) (((x) >> 20) & 0x7)
83 
84 struct pxafb_layer;
85 
87  void (*enable)(struct pxafb_layer *);
88  void (*disable)(struct pxafb_layer *);
89  void (*setup)(struct pxafb_layer *);
90 };
91 
92 struct pxafb_layer {
93  struct fb_info fb;
94  int id;
98 
100 
102  unsigned long video_mem_phys;
105 
106  struct pxafb_info *fbi;
107 };
108 
109 struct pxafb_info {
110  struct fb_info fb;
111  struct device *dev;
112  struct clk *clk;
113 
115 
120 
121  void __iomem *video_mem; /* virtual address of frame buffer */
122  unsigned long video_mem_phys; /* physical address of frame buffer */
123  size_t video_mem_size; /* size of the frame buffer */
124  u16 * palette_cpu; /* virtual address of palette memory */
126 
131  cmap_static:1,
132  unused:30;
133 
140 
141  unsigned long hsync_time;
142 
143  volatile u_char state;
144  volatile u_char task_state;
148 
150 
151 #ifdef CONFIG_FB_PXA_SMARTPANEL
152  uint16_t *smart_cmds;
153  size_t n_smart_cmds;
154  struct completion command_done;
155  struct completion refresh_done;
156  struct task_struct *smart_thread;
157 #endif
158 
159 #ifdef CONFIG_FB_PXA_OVERLAY
160  struct pxafb_layer overlay[2];
161 #endif
162 
163 #ifdef CONFIG_CPU_FREQ
164  struct notifier_block freq_transition;
165  struct notifier_block freq_policy;
166 #endif
167 
170 };
171 
172 #define TO_INF(ptr,member) container_of(ptr,struct pxafb_info,member)
173 
174 /*
175  * These are the actions for set_ctrlr_state
176  */
177 #define C_DISABLE (0)
178 #define C_ENABLE (1)
179 #define C_DISABLE_CLKCHANGE (2)
180 #define C_ENABLE_CLKCHANGE (3)
181 #define C_REENABLE (4)
182 #define C_DISABLE_PM (5)
183 #define C_ENABLE_PM (6)
184 #define C_STARTUP (7)
185 
186 #define PXA_NAME "PXA"
187 
188 /*
189  * Minimum X and Y resolutions
190  */
191 #define MIN_XRES 64
192 #define MIN_YRES 64
193 
194 /* maximum X and Y resolutions - note these are limits from the register
195  * bits length instead of the real ones
196  */
197 #define MAX_XRES 1024
198 #define MAX_YRES 1024
199 
200 #endif /* __PXAFB_H__ */