blob: f8605b807b0acbf5c018cc5ce407cc85b3f014ce [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#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 <cbrake@acclent.com>
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/* Shadows for LCD controller registers */
25struct pxafb_lcd_reg {
26 unsigned int lccr0;
27 unsigned int lccr1;
28 unsigned int lccr2;
29 unsigned int lccr3;
30};
31
32/* PXA LCD DMA descriptor */
33struct pxafb_dma_descriptor {
34 unsigned int fdadr;
35 unsigned int fsadr;
36 unsigned int fidr;
37 unsigned int ldcmd;
38};
39
40struct pxafb_info {
41 struct fb_info fb;
42 struct device *dev;
Russell King72e35242007-08-20 10:18:42 +010043 struct clk *clk;
Linus Torvalds1da177e2005-04-16 15:20:36 -070044
Linus Torvalds1da177e2005-04-16 15:20:36 -070045 /*
46 * These are the addresses we mapped
47 * the framebuffer memory region to.
48 */
49 /* raw memory addresses */
50 dma_addr_t map_dma; /* physical */
51 u_char * map_cpu; /* virtual */
52 u_int map_size;
53
54 /* addresses of pieces placed in raw buffer */
55 u_char * screen_cpu; /* virtual address of frame buffer */
56 dma_addr_t screen_dma; /* physical address of frame buffer */
57 u16 * palette_cpu; /* virtual address of palette memory */
58 dma_addr_t palette_dma; /* physical address of palette memory */
59 u_int palette_size;
60
61 /* DMA descriptors */
62 struct pxafb_dma_descriptor * dmadesc_fblow_cpu;
63 dma_addr_t dmadesc_fblow_dma;
64 struct pxafb_dma_descriptor * dmadesc_fbhigh_cpu;
65 dma_addr_t dmadesc_fbhigh_dma;
66 struct pxafb_dma_descriptor * dmadesc_palette_cpu;
67 dma_addr_t dmadesc_palette_dma;
68
69 dma_addr_t fdadr0;
70 dma_addr_t fdadr1;
71
72 u_int lccr0;
73 u_int lccr3;
74 u_int cmap_inverse:1,
75 cmap_static:1,
76 unused:30;
77
78 u_int reg_lccr0;
79 u_int reg_lccr1;
80 u_int reg_lccr2;
81 u_int reg_lccr3;
82
Richard Purdieba44cd22005-09-09 13:10:03 -070083 unsigned long hsync_time;
84
Linus Torvalds1da177e2005-04-16 15:20:36 -070085 volatile u_char state;
86 volatile u_char task_state;
87 struct semaphore ctrlr_sem;
88 wait_queue_head_t ctrlr_wait;
89 struct work_struct task;
90
91#ifdef CONFIG_CPU_FREQ
92 struct notifier_block freq_transition;
93 struct notifier_block freq_policy;
94#endif
95};
96
97#define TO_INF(ptr,member) container_of(ptr,struct pxafb_info,member)
98
99/*
100 * These are the actions for set_ctrlr_state
101 */
102#define C_DISABLE (0)
103#define C_ENABLE (1)
104#define C_DISABLE_CLKCHANGE (2)
105#define C_ENABLE_CLKCHANGE (3)
106#define C_REENABLE (4)
107#define C_DISABLE_PM (5)
108#define C_ENABLE_PM (6)
109#define C_STARTUP (7)
110
111#define PXA_NAME "PXA"
112
113/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114 * Minimum X and Y resolutions
115 */
116#define MIN_XRES 64
117#define MIN_YRES 64
118
119#endif /* __PXAFB_H__ */