sh_mobile_lcdc.h 2.5 KB

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