sh_mobile_lcdcfb.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef SH_MOBILE_LCDCFB_H
  2. #define SH_MOBILE_LCDCFB_H
  3. #include <linux/completion.h>
  4. #include <linux/fb.h>
  5. #include <linux/mutex.h>
  6. #include <linux/wait.h>
  7. /* per-channel registers */
  8. enum { LDDCKPAT1R, LDDCKPAT2R, LDMT1R, LDMT2R, LDMT3R, LDDFR, LDSM1R,
  9. LDSM2R, LDSA1R, LDSA2R, LDMLSR, LDHCNR, LDHSYNR, LDVLNR, LDVSYNR, LDPMR,
  10. LDHAJR,
  11. NR_CH_REGS };
  12. #define PALETTE_NR 16
  13. struct backlight_device;
  14. struct fb_info;
  15. struct module;
  16. struct sh_mobile_lcdc_entity;
  17. struct sh_mobile_lcdc_priv;
  18. struct sh_mobile_lcdc_chan;
  19. #define SH_MOBILE_LCDC_DISPLAY_DISCONNECTED 0
  20. #define SH_MOBILE_LCDC_DISPLAY_CONNECTED 1
  21. struct sh_mobile_lcdc_entity_ops {
  22. /* Display */
  23. int (*display_on)(struct sh_mobile_lcdc_entity *entity);
  24. void (*display_off)(struct sh_mobile_lcdc_entity *entity);
  25. };
  26. struct sh_mobile_lcdc_entity {
  27. struct module *owner;
  28. const struct sh_mobile_lcdc_entity_ops *ops;
  29. struct sh_mobile_lcdc_chan *lcdc;
  30. };
  31. /*
  32. * struct sh_mobile_lcdc_chan - LCDC display channel
  33. *
  34. * @base_addr_y: Frame buffer viewport base address (luma component)
  35. * @base_addr_c: Frame buffer viewport base address (chroma component)
  36. * @pitch: Frame buffer line pitch
  37. */
  38. struct sh_mobile_lcdc_chan {
  39. struct sh_mobile_lcdc_priv *lcdc;
  40. struct sh_mobile_lcdc_entity *tx_dev;
  41. unsigned long *reg_offs;
  42. unsigned long ldmt1r_value;
  43. unsigned long enabled; /* ME and SE in LDCNT2R */
  44. struct sh_mobile_lcdc_chan_cfg cfg;
  45. u32 pseudo_palette[PALETTE_NR];
  46. struct fb_info *info;
  47. struct backlight_device *bl;
  48. dma_addr_t dma_handle;
  49. struct fb_deferred_io defio;
  50. struct scatterlist *sglist;
  51. unsigned long frame_end;
  52. unsigned long pan_offset;
  53. wait_queue_head_t frame_end_wait;
  54. struct completion vsync_completion;
  55. struct fb_var_screeninfo display_var;
  56. int use_count;
  57. int blank_status;
  58. struct mutex open_lock; /* protects the use counter */
  59. int meram_enabled;
  60. unsigned long base_addr_y;
  61. unsigned long base_addr_c;
  62. unsigned int pitch;
  63. };
  64. #endif