sh_mobile_lcdc.h 2.7 KB

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