Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | /* Shadows for LCD controller registers */ |
| 14 | struct sa1100fb_lcd_reg { |
| 15 | unsigned long lccr0; |
| 16 | unsigned long lccr1; |
| 17 | unsigned long lccr2; |
| 18 | unsigned long lccr3; |
| 19 | }; |
| 20 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | struct sa1100fb_info { |
| 22 | struct fb_info fb; |
| 23 | struct device *dev; |
Russell King | 58f5cbf | 2012-01-14 10:13:30 +0000 | [diff] [blame] | 24 | const struct sa1100fb_rgb *rgb[NR_RGB]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | |
| 26 | u_int max_bpp; |
| 27 | u_int max_xres; |
| 28 | u_int max_yres; |
| 29 | |
| 30 | /* |
| 31 | * These are the addresses we mapped |
| 32 | * the framebuffer memory region to. |
| 33 | */ |
| 34 | dma_addr_t map_dma; |
| 35 | u_char * map_cpu; |
| 36 | u_int map_size; |
| 37 | |
| 38 | u_char * screen_cpu; |
| 39 | dma_addr_t screen_dma; |
| 40 | u16 * palette_cpu; |
| 41 | dma_addr_t palette_dma; |
| 42 | u_int palette_size; |
| 43 | |
| 44 | dma_addr_t dbar1; |
| 45 | dma_addr_t dbar2; |
| 46 | |
| 47 | u_int lccr0; |
| 48 | u_int lccr3; |
| 49 | u_int cmap_inverse:1, |
| 50 | cmap_static:1, |
| 51 | unused:30; |
| 52 | |
| 53 | u_int reg_lccr0; |
| 54 | u_int reg_lccr1; |
| 55 | u_int reg_lccr2; |
| 56 | u_int reg_lccr3; |
| 57 | |
| 58 | volatile u_char state; |
| 59 | volatile u_char task_state; |
Matthias Kaehlcke | 7951ac9 | 2008-07-23 21:31:16 -0700 | [diff] [blame] | 60 | struct mutex ctrlr_lock; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | wait_queue_head_t ctrlr_wait; |
| 62 | struct work_struct task; |
| 63 | |
| 64 | #ifdef CONFIG_CPU_FREQ |
| 65 | struct notifier_block freq_transition; |
| 66 | struct notifier_block freq_policy; |
| 67 | #endif |
Russell King | 086ada5 | 2012-01-14 12:03:22 +0000 | [diff] [blame^] | 68 | |
| 69 | const struct sa1100fb_mach_info *inf; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | }; |
| 71 | |
Robert P. J. Day | b385a14 | 2007-02-10 01:46:25 -0800 | [diff] [blame] | 72 | #define TO_INF(ptr,member) container_of(ptr,struct sa1100fb_info,member) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 73 | |
| 74 | #define SA1100_PALETTE_MODE_VAL(bpp) (((bpp) & 0x018) << 9) |
| 75 | |
| 76 | /* |
| 77 | * These are the actions for set_ctrlr_state |
| 78 | */ |
| 79 | #define C_DISABLE (0) |
| 80 | #define C_ENABLE (1) |
| 81 | #define C_DISABLE_CLKCHANGE (2) |
| 82 | #define C_ENABLE_CLKCHANGE (3) |
| 83 | #define C_REENABLE (4) |
| 84 | #define C_DISABLE_PM (5) |
| 85 | #define C_ENABLE_PM (6) |
| 86 | #define C_STARTUP (7) |
| 87 | |
| 88 | #define SA1100_NAME "SA1100" |
| 89 | |
| 90 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 91 | * Minimum X and Y resolutions |
| 92 | */ |
| 93 | #define MIN_XRES 64 |
| 94 | #define MIN_YRES 64 |
| 95 | |