5 * linux/drivers/video/pxafb.h
6 * -- Intel PXA250/210 LCD Controller Frame Buffer Device
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
14 * Based on acornfb.c Copyright (C) Russell King.
16 * 2001-08-03: Cliff Brake <cbrake@acclent.com>
17 * - ported SA1100 code to PXA
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
24 /* PXA LCD DMA descriptor */
25 struct pxafb_dma_descriptor
{
53 /* maximum palette size - 256 entries, each 4 bytes long */
54 #define PALETTE_SIZE (256 * 4)
55 #define CMD_BUFF_SIZE (1024 * 50)
57 /* NOTE: the palette and frame dma descriptors are doubled to allow
58 * the 2nd set for branch settings (FBRx)
60 struct pxafb_dma_buff
{
61 unsigned char palette
[PAL_MAX
* PALETTE_SIZE
];
62 uint16_t cmd_buff
[CMD_BUFF_SIZE
];
63 struct pxafb_dma_descriptor pal_desc
[PAL_MAX
* 2];
64 struct pxafb_dma_descriptor dma_desc
[DMA_MAX
* 2];
73 OVERLAY_FORMAT_RGB
= 0,
74 OVERLAY_FORMAT_YUV444_PACKED
,
75 OVERLAY_FORMAT_YUV444_PLANAR
,
76 OVERLAY_FORMAT_YUV422_PLANAR
,
77 OVERLAY_FORMAT_YUV420_PLANAR
,
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)
86 struct pxafb_layer_ops
{
87 void (*enable
)(struct pxafb_layer
*);
88 void (*disable
)(struct pxafb_layer
*);
89 void (*setup
)(struct pxafb_layer
*);
99 struct pxafb_layer_ops
*ops
;
101 void __iomem
*video_mem
;
102 unsigned long video_mem_phys
;
103 size_t video_mem_size
;
104 struct completion branch_done
;
106 struct pxafb_info
*fbi
;
114 void __iomem
*mmio_base
;
116 struct pxafb_dma_buff
*dma_buff
;
117 size_t dma_buff_size
;
118 dma_addr_t dma_buff_phys
;
119 dma_addr_t fdadr
[DMA_MAX
* 2];
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 */
130 u_int cmap_inverse
:1,
141 unsigned long hsync_time
;
143 volatile u_char state
;
144 volatile u_char task_state
;
145 struct mutex ctrlr_lock
;
146 wait_queue_head_t ctrlr_wait
;
147 struct work_struct task
;
149 struct completion disable_done
;
151 #ifdef CONFIG_FB_PXA_SMARTPANEL
152 uint16_t *smart_cmds
;
154 struct completion command_done
;
155 struct completion refresh_done
;
156 struct task_struct
*smart_thread
;
159 #ifdef CONFIG_FB_PXA_OVERLAY
160 struct pxafb_layer overlay
[2];
163 #ifdef CONFIG_CPU_FREQ
164 struct notifier_block freq_transition
;
165 struct notifier_block freq_policy
;
168 struct regulator
*lcd_supply
;
169 bool lcd_supply_enabled
;
171 void (*lcd_power
)(int, struct fb_var_screeninfo
*);
172 void (*backlight_power
)(int);
174 struct pxafb_mach_info
*inf
;
177 #define TO_INF(ptr,member) container_of(ptr,struct pxafb_info,member)
180 * These are the actions for set_ctrlr_state
182 #define C_DISABLE (0)
184 #define C_DISABLE_CLKCHANGE (2)
185 #define C_ENABLE_CLKCHANGE (3)
186 #define C_REENABLE (4)
187 #define C_DISABLE_PM (5)
188 #define C_ENABLE_PM (6)
189 #define C_STARTUP (7)
191 #define PXA_NAME "PXA"
194 * Minimum X and Y resolutions
199 /* maximum X and Y resolutions - note these are limits from the register
200 * bits length instead of the real ones
202 #define MAX_XRES 1024
203 #define MAX_YRES 1024
205 #endif /* __PXAFB_H__ */