sh_mobile_lcdc.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 sh_mobile_lcdc_board_cfg {
  45. void *board_data;
  46. int (*setup_sys)(void *board_data, void *sys_ops_handle,
  47. struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
  48. void (*start_transfer)(void *board_data, void *sys_ops_handle,
  49. struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
  50. void (*display_on)(void *board_data, struct fb_info *info);
  51. void (*display_off)(void *board_data);
  52. };
  53. struct sh_mobile_lcdc_lcd_size_cfg { /* width and height of panel in mm */
  54. unsigned long width;
  55. unsigned long height;
  56. };
  57. struct sh_mobile_lcdc_chan_cfg {
  58. int chan;
  59. int bpp;
  60. int interface_type; /* selects RGBn or SYSn I/F, see above */
  61. int clock_divider;
  62. unsigned long flags; /* LCDC_FLAGS_... */
  63. struct fb_videomode lcd_cfg;
  64. struct sh_mobile_lcdc_lcd_size_cfg lcd_size_cfg;
  65. struct sh_mobile_lcdc_board_cfg board_cfg;
  66. struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */
  67. };
  68. struct sh_mobile_lcdc_info {
  69. int clock_source;
  70. struct sh_mobile_lcdc_chan_cfg ch[2];
  71. };
  72. #endif /* __ASM_SH_MOBILE_LCDC_H__ */