blob: e968e1d6952074fe39d23f0bff2fc33fc9a705c7 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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
Linus Torvalds1da177e2005-04-16 15:20:36 -070013/* Shadows for LCD controller registers */
14struct sa1100fb_lcd_reg {
15 unsigned long lccr0;
16 unsigned long lccr1;
17 unsigned long lccr2;
18 unsigned long lccr3;
19};
20
Linus Torvalds1da177e2005-04-16 15:20:36 -070021struct sa1100fb_info {
22 struct fb_info fb;
23 struct device *dev;
Russell King58f5cbf2012-01-14 10:13:30 +000024 const struct sa1100fb_rgb *rgb[NR_RGB];
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 /*
27 * These are the addresses we mapped
28 * the framebuffer memory region to.
29 */
30 dma_addr_t map_dma;
31 u_char * map_cpu;
32 u_int map_size;
33
34 u_char * screen_cpu;
35 dma_addr_t screen_dma;
36 u16 * palette_cpu;
37 dma_addr_t palette_dma;
38 u_int palette_size;
39
40 dma_addr_t dbar1;
41 dma_addr_t dbar2;
42
Linus Torvalds1da177e2005-04-16 15:20:36 -070043 u_int reg_lccr0;
44 u_int reg_lccr1;
45 u_int reg_lccr2;
46 u_int reg_lccr3;
47
48 volatile u_char state;
49 volatile u_char task_state;
Matthias Kaehlcke7951ac92008-07-23 21:31:16 -070050 struct mutex ctrlr_lock;
Linus Torvalds1da177e2005-04-16 15:20:36 -070051 wait_queue_head_t ctrlr_wait;
52 struct work_struct task;
53
54#ifdef CONFIG_CPU_FREQ
55 struct notifier_block freq_transition;
56 struct notifier_block freq_policy;
57#endif
Russell King086ada52012-01-14 12:03:22 +000058
59 const struct sa1100fb_mach_info *inf;
Linus Torvalds1da177e2005-04-16 15:20:36 -070060};
61
Robert P. J. Dayb385a142007-02-10 01:46:25 -080062#define TO_INF(ptr,member) container_of(ptr,struct sa1100fb_info,member)
Linus Torvalds1da177e2005-04-16 15:20:36 -070063
64#define SA1100_PALETTE_MODE_VAL(bpp) (((bpp) & 0x018) << 9)
65
66/*
67 * These are the actions for set_ctrlr_state
68 */
69#define C_DISABLE (0)
70#define C_ENABLE (1)
71#define C_DISABLE_CLKCHANGE (2)
72#define C_ENABLE_CLKCHANGE (3)
73#define C_REENABLE (4)
74#define C_DISABLE_PM (5)
75#define C_ENABLE_PM (6)
76#define C_STARTUP (7)
77
78#define SA1100_NAME "SA1100"
79
80/*
Linus Torvalds1da177e2005-04-16 15:20:36 -070081 * Minimum X and Y resolutions
82 */
83#define MIN_XRES 64
84#define MIN_YRES 64
85