sh_mobile_lcdcfb.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. struct sh_mobile_lcdc_entity_ops {
  20. /* Display */
  21. int (*display_on)(struct sh_mobile_lcdc_entity *entity,
  22. struct fb_info *info);
  23. void (*display_off)(struct sh_mobile_lcdc_entity *entity);
  24. };
  25. struct sh_mobile_lcdc_entity {
  26. struct module *owner;
  27. const struct sh_mobile_lcdc_entity_ops *ops;
  28. struct sh_mobile_lcdc_chan *lcdc;
  29. };
  30. /*
  31. * struct sh_mobile_lcdc_chan - LCDC display channel
  32. *
  33. * @base_addr_y: Frame buffer viewport base address (luma component)
  34. * @base_addr_c: Frame buffer viewport base address (chroma component)
  35. * @pitch: Frame buffer line pitch
  36. */
  37. struct sh_mobile_lcdc_chan {
  38. struct sh_mobile_lcdc_priv *lcdc;
  39. struct sh_mobile_lcdc_entity *tx_dev;
  40. unsigned long *reg_offs;
  41. unsigned long ldmt1r_value;
  42. unsigned long enabled; /* ME and SE in LDCNT2R */
  43. struct sh_mobile_lcdc_chan_cfg cfg;
  44. u32 pseudo_palette[PALETTE_NR];
  45. struct fb_info *info;
  46. struct backlight_device *bl;
  47. dma_addr_t dma_handle;
  48. struct fb_deferred_io defio;
  49. struct scatterlist *sglist;
  50. unsigned long frame_end;
  51. unsigned long pan_offset;
  52. wait_queue_head_t frame_end_wait;
  53. struct completion vsync_completion;
  54. struct fb_var_screeninfo display_var;
  55. int use_count;
  56. int blank_status;
  57. struct mutex open_lock; /* protects the use counter */
  58. int meram_enabled;
  59. unsigned long base_addr_y;
  60. unsigned long base_addr_c;
  61. unsigned int pitch;
  62. };
  63. #endif