1 #ifndef SH_MOBILE_LCDCFB_H
2 #define SH_MOBILE_LCDCFB_H
4 #include <linux/completion.h>
6 #include <linux/mutex.h>
7 #include <linux/wait.h>
9 /* per-channel registers */
10 enum { LDDCKPAT1R, LDDCKPAT2R, LDMT1R, LDMT2R, LDMT3R, LDDFR, LDSM1R,
11 LDSM2R, LDSA1R, LDSA2R, LDMLSR, LDHCNR, LDHSYNR, LDVLNR, LDVSYNR, LDPMR,
17 struct backlight_device;
20 struct sh_mobile_lcdc_chan;
21 struct sh_mobile_lcdc_entity;
22 struct sh_mobile_lcdc_format_info;
23 struct sh_mobile_lcdc_priv;
25 #define SH_MOBILE_LCDC_DISPLAY_DISCONNECTED 0
26 #define SH_MOBILE_LCDC_DISPLAY_CONNECTED 1
28 struct sh_mobile_lcdc_entity_ops {
30 int (*display_on)(struct sh_mobile_lcdc_entity *entity);
31 void (*display_off)(struct sh_mobile_lcdc_entity *entity);
34 enum sh_mobile_lcdc_entity_event {
35 SH_MOBILE_LCDC_EVENT_DISPLAY_CONNECT,
36 SH_MOBILE_LCDC_EVENT_DISPLAY_DISCONNECT,
37 SH_MOBILE_LCDC_EVENT_DISPLAY_MODE,
40 struct sh_mobile_lcdc_entity {
42 const struct sh_mobile_lcdc_entity_ops *ops;
43 struct sh_mobile_lcdc_chan *lcdc;
44 struct fb_videomode def_mode;
48 * struct sh_mobile_lcdc_chan - LCDC display channel
50 * @pan_y_offset: Panning linear offset in bytes (luma component)
51 * @base_addr_y: Frame buffer viewport base address (luma component)
52 * @base_addr_c: Frame buffer viewport base address (chroma component)
53 * @pitch: Frame buffer line pitch
55 struct sh_mobile_lcdc_chan {
56 struct sh_mobile_lcdc_priv *lcdc;
57 struct sh_mobile_lcdc_entity *tx_dev;
58 const struct sh_mobile_lcdc_chan_cfg *cfg;
60 unsigned long *reg_offs;
61 unsigned long ldmt1r_value;
62 unsigned long enabled; /* ME and SE in LDCNT2R */
65 struct mutex open_lock; /* protects the use counter */
69 unsigned long fb_size;
71 dma_addr_t dma_handle;
72 unsigned long pan_y_offset;
74 unsigned long frame_end;
75 wait_queue_head_t frame_end_wait;
76 struct completion vsync_completion;
78 const struct sh_mobile_lcdc_format_info *format;
81 unsigned int xres_virtual;
83 unsigned int yres_virtual;
86 unsigned long base_addr_y;
87 unsigned long base_addr_c;
88 unsigned int line_size;
90 int (*notify)(struct sh_mobile_lcdc_chan *ch,
91 enum sh_mobile_lcdc_entity_event event,
92 const struct fb_videomode *mode,
93 const struct fb_monspecs *monspec);
96 struct backlight_device *bl;
97 unsigned int bl_brightness;
100 struct fb_info *info;
101 u32 pseudo_palette[PALETTE_NR];
105 struct fb_videomode mode;
107 struct fb_deferred_io defio;
108 struct scatterlist *sglist;