sa1100fb.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. struct gpio_desc;
  13. #define LCCR0 0x0000 /* LCD Control Reg. 0 */
  14. #define LCSR 0x0004 /* LCD Status Reg. */
  15. #define DBAR1 0x0010 /* LCD DMA Base Address Reg. channel 1 */
  16. #define DCAR1 0x0014 /* LCD DMA Current Address Reg. channel 1 */
  17. #define DBAR2 0x0018 /* LCD DMA Base Address Reg. channel 2 */
  18. #define DCAR2 0x001C /* LCD DMA Current Address Reg. channel 2 */
  19. #define LCCR1 0x0020 /* LCD Control Reg. 1 */
  20. #define LCCR2 0x0024 /* LCD Control Reg. 2 */
  21. #define LCCR3 0x0028 /* LCD Control Reg. 3 */
  22. /* Shadows for LCD controller registers */
  23. struct sa1100fb_lcd_reg {
  24. unsigned long lccr0;
  25. unsigned long lccr1;
  26. unsigned long lccr2;
  27. unsigned long lccr3;
  28. };
  29. struct sa1100fb_info {
  30. struct fb_info fb;
  31. struct device *dev;
  32. const struct sa1100fb_rgb *rgb[NR_RGB];
  33. void __iomem *base;
  34. struct gpio_desc *shannon_lcden;
  35. /*
  36. * These are the addresses we mapped
  37. * the framebuffer memory region to.
  38. */
  39. dma_addr_t map_dma;
  40. u_char * map_cpu;
  41. u_int map_size;
  42. u_char * screen_cpu;
  43. dma_addr_t screen_dma;
  44. u16 * palette_cpu;
  45. dma_addr_t palette_dma;
  46. u_int palette_size;
  47. dma_addr_t dbar1;
  48. dma_addr_t dbar2;
  49. u_int reg_lccr0;
  50. u_int reg_lccr1;
  51. u_int reg_lccr2;
  52. u_int reg_lccr3;
  53. volatile u_char state;
  54. volatile u_char task_state;
  55. struct mutex ctrlr_lock;
  56. wait_queue_head_t ctrlr_wait;
  57. struct work_struct task;
  58. #ifdef CONFIG_CPU_FREQ
  59. struct notifier_block freq_transition;
  60. #endif
  61. const struct sa1100fb_mach_info *inf;
  62. struct clk *clk;
  63. u32 pseudo_palette[16];
  64. };
  65. #define TO_INF(ptr,member) container_of(ptr,struct sa1100fb_info,member)
  66. #define SA1100_PALETTE_MODE_VAL(bpp) (((bpp) & 0x018) << 9)
  67. /*
  68. * These are the actions for set_ctrlr_state
  69. */
  70. #define C_DISABLE (0)
  71. #define C_ENABLE (1)
  72. #define C_DISABLE_CLKCHANGE (2)
  73. #define C_ENABLE_CLKCHANGE (3)
  74. #define C_REENABLE (4)
  75. #define C_DISABLE_PM (5)
  76. #define C_ENABLE_PM (6)
  77. #define C_STARTUP (7)
  78. #define SA1100_NAME "SA1100"
  79. /*
  80. * Minimum X and Y resolutions
  81. */
  82. #define MIN_XRES 64
  83. #define MIN_YRES 64