sh_mobile_lcdc.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #ifndef __ASM_SH_MOBILE_LCDC_H__
  2. #define __ASM_SH_MOBILE_LCDC_H__
  3. #include <linux/fb.h>
  4. #include <video/sh_mobile_meram.h>
  5. enum {
  6. RGB8, /* 24bpp, 8:8:8 */
  7. RGB9, /* 18bpp, 9:9 */
  8. RGB12A, /* 24bpp, 12:12 */
  9. RGB12B, /* 12bpp */
  10. RGB16, /* 16bpp */
  11. RGB18, /* 18bpp */
  12. RGB24, /* 24bpp */
  13. YUV422, /* 16bpp */
  14. SYS8A, /* 24bpp, 8:8:8 */
  15. SYS8B, /* 18bpp, 8:8:2 */
  16. SYS8C, /* 18bpp, 2:8:8 */
  17. SYS8D, /* 16bpp, 8:8 */
  18. SYS9, /* 18bpp, 9:9 */
  19. SYS12, /* 24bpp, 12:12 */
  20. SYS16A, /* 16bpp */
  21. SYS16B, /* 18bpp, 16:2 */
  22. SYS16C, /* 18bpp, 2:16 */
  23. SYS18, /* 18bpp */
  24. SYS24, /* 24bpp */
  25. };
  26. enum { LCDC_CHAN_DISABLED = 0,
  27. LCDC_CHAN_MAINLCD,
  28. LCDC_CHAN_SUBLCD };
  29. enum { LCDC_CLK_BUS, LCDC_CLK_PERIPHERAL, LCDC_CLK_EXTERNAL };
  30. #define LCDC_FLAGS_DWPOL (1 << 0) /* Rising edge dot clock data latch */
  31. #define LCDC_FLAGS_DIPOL (1 << 1) /* Active low display enable polarity */
  32. #define LCDC_FLAGS_DAPOL (1 << 2) /* Active low display data polarity */
  33. #define LCDC_FLAGS_HSCNT (1 << 3) /* Disable HSYNC during VBLANK */
  34. #define LCDC_FLAGS_DWCNT (1 << 4) /* Disable dotclock during blanking */
  35. struct sh_mobile_lcdc_sys_bus_cfg {
  36. unsigned long ldmt2r;
  37. unsigned long ldmt3r;
  38. unsigned long deferred_io_msec;
  39. };
  40. struct sh_mobile_lcdc_sys_bus_ops {
  41. void (*write_index)(void *handle, unsigned long data);
  42. void (*write_data)(void *handle, unsigned long data);
  43. unsigned long (*read_data)(void *handle);
  44. };
  45. struct module;
  46. struct sh_mobile_lcdc_board_cfg {
  47. struct module *owner;
  48. void *board_data;
  49. int (*setup_sys)(void *board_data, void *sys_ops_handle,
  50. struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
  51. void (*start_transfer)(void *board_data, void *sys_ops_handle,
  52. struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
  53. void (*display_on)(void *board_data, struct fb_info *info);
  54. void (*display_off)(void *board_data);
  55. int (*set_brightness)(void *board_data, int brightness);
  56. int (*get_brightness)(void *board_data);
  57. };
  58. struct sh_mobile_lcdc_lcd_size_cfg { /* width and height of panel in mm */
  59. unsigned long width;
  60. unsigned long height;
  61. };
  62. /* backlight info */
  63. struct sh_mobile_lcdc_bl_info {
  64. const char *name;
  65. int max_brightness;
  66. };
  67. struct sh_mobile_lcdc_chan_cfg {
  68. int chan;
  69. int bpp;
  70. int interface_type; /* selects RGBn or SYSn I/F, see above */
  71. int clock_divider;
  72. unsigned long flags; /* LCDC_FLAGS_... */
  73. const struct fb_videomode *lcd_cfg;
  74. int num_cfg;
  75. struct sh_mobile_lcdc_lcd_size_cfg lcd_size_cfg;
  76. struct sh_mobile_lcdc_board_cfg board_cfg;
  77. struct sh_mobile_lcdc_bl_info bl_info;
  78. struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */
  79. int nonstd;
  80. struct sh_mobile_meram_cfg *meram_cfg;
  81. };
  82. struct sh_mobile_lcdc_info {
  83. int clock_source;
  84. struct sh_mobile_lcdc_chan_cfg ch[2];
  85. struct sh_mobile_meram_info *meram_dev;
  86. };
  87. #endif /* __ASM_SH_MOBILE_LCDC_H__ */