sh_mobile_lcdc.h 2.3 KB

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