sh_mobile_lcdc.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. unsigned long deferred_io_msec;
  35. };
  36. struct sh_mobile_lcdc_sys_bus_ops {
  37. void (*write_index)(void *handle, unsigned long data);
  38. void (*write_data)(void *handle, unsigned long data);
  39. unsigned long (*read_data)(void *handle);
  40. };
  41. struct sh_mobile_lcdc_board_cfg {
  42. void *board_data;
  43. int (*setup_sys)(void *board_data, void *sys_ops_handle,
  44. struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
  45. void (*display_on)(void *board_data);
  46. void (*display_off)(void *board_data);
  47. };
  48. struct sh_mobile_lcdc_lcd_size_cfg { /* width and height of panel in mm */
  49. unsigned long width;
  50. unsigned long height;
  51. };
  52. struct sh_mobile_lcdc_chan_cfg {
  53. int chan;
  54. int bpp;
  55. int interface_type; /* selects RGBn or SYSn I/F, see above */
  56. int clock_divider;
  57. unsigned long flags; /* LCDC_FLAGS_... */
  58. struct fb_videomode lcd_cfg;
  59. struct sh_mobile_lcdc_lcd_size_cfg lcd_size_cfg;
  60. struct sh_mobile_lcdc_board_cfg board_cfg;
  61. struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */
  62. };
  63. struct sh_mobile_lcdc_info {
  64. int clock_source;
  65. struct sh_mobile_lcdc_chan_cfg ch[2];
  66. };
  67. #endif /* __ASM_SH_MOBILE_LCDC_H__ */