Commit | Line | Data |
---|---|---|
6de9edd5 GL |
1 | #ifndef SH_MOBILE_LCDCFB_H |
2 | #define SH_MOBILE_LCDCFB_H | |
3 | ||
4 | #include <linux/completion.h> | |
5 | #include <linux/fb.h> | |
dd210503 | 6 | #include <linux/mutex.h> |
6de9edd5 GL |
7 | #include <linux/wait.h> |
8 | ||
9 | /* per-channel registers */ | |
10 | enum { LDDCKPAT1R, LDDCKPAT2R, LDMT1R, LDMT2R, LDMT3R, LDDFR, LDSM1R, | |
53b50314 | 11 | LDSM2R, LDSA1R, LDSA2R, LDMLSR, LDHCNR, LDHSYNR, LDVLNR, LDVSYNR, LDPMR, |
6de9edd5 GL |
12 | LDHAJR, |
13 | NR_CH_REGS }; | |
14 | ||
15 | #define PALETTE_NR 16 | |
16 | ||
3b0fd9d7 | 17 | struct backlight_device; |
d2ccdc80 LP |
18 | struct fb_info; |
19 | struct module; | |
20 | struct sh_mobile_lcdc_entity; | |
21 | struct sh_mobile_lcdc_priv; | |
e34d0bbb | 22 | struct sh_mobile_lcdc_chan; |
d2ccdc80 | 23 | |
458981c3 LP |
24 | #define SH_MOBILE_LCDC_DISPLAY_DISCONNECTED 0 |
25 | #define SH_MOBILE_LCDC_DISPLAY_CONNECTED 1 | |
26 | ||
d2ccdc80 LP |
27 | struct sh_mobile_lcdc_entity_ops { |
28 | /* Display */ | |
5864ace1 | 29 | int (*display_on)(struct sh_mobile_lcdc_entity *entity); |
d2ccdc80 LP |
30 | void (*display_off)(struct sh_mobile_lcdc_entity *entity); |
31 | }; | |
32 | ||
ecd29947 LP |
33 | enum sh_mobile_lcdc_entity_event { |
34 | SH_MOBILE_LCDC_EVENT_DISPLAY_CONNECT, | |
35 | SH_MOBILE_LCDC_EVENT_DISPLAY_DISCONNECT, | |
36 | SH_MOBILE_LCDC_EVENT_DISPLAY_MODE, | |
37 | }; | |
38 | ||
d2ccdc80 LP |
39 | struct sh_mobile_lcdc_entity { |
40 | struct module *owner; | |
41 | const struct sh_mobile_lcdc_entity_ops *ops; | |
e34d0bbb | 42 | struct sh_mobile_lcdc_chan *lcdc; |
13f80eea | 43 | struct fb_videomode def_mode; |
d2ccdc80 | 44 | }; |
6de9edd5 | 45 | |
9a217e34 LP |
46 | /* |
47 | * struct sh_mobile_lcdc_chan - LCDC display channel | |
48 | * | |
49 | * @base_addr_y: Frame buffer viewport base address (luma component) | |
50 | * @base_addr_c: Frame buffer viewport base address (chroma component) | |
51 | * @pitch: Frame buffer line pitch | |
52 | */ | |
6de9edd5 GL |
53 | struct sh_mobile_lcdc_chan { |
54 | struct sh_mobile_lcdc_priv *lcdc; | |
9a2985e7 LP |
55 | struct sh_mobile_lcdc_entity *tx_dev; |
56 | ||
6de9edd5 GL |
57 | unsigned long *reg_offs; |
58 | unsigned long ldmt1r_value; | |
59 | unsigned long enabled; /* ME and SE in LDCNT2R */ | |
60 | struct sh_mobile_lcdc_chan_cfg cfg; | |
61 | u32 pseudo_palette[PALETTE_NR]; | |
6de9edd5 | 62 | struct fb_info *info; |
3b0fd9d7 | 63 | struct backlight_device *bl; |
6de9edd5 GL |
64 | dma_addr_t dma_handle; |
65 | struct fb_deferred_io defio; | |
66 | struct scatterlist *sglist; | |
67 | unsigned long frame_end; | |
68 | unsigned long pan_offset; | |
69 | wait_queue_head_t frame_end_wait; | |
70 | struct completion vsync_completion; | |
1c120deb | 71 | struct fb_var_screeninfo display_var; |
dd210503 | 72 | int use_count; |
8857b9aa | 73 | int blank_status; |
dd210503 | 74 | struct mutex open_lock; /* protects the use counter */ |
7caa4342 | 75 | int meram_enabled; |
9a217e34 LP |
76 | |
77 | unsigned long base_addr_y; | |
78 | unsigned long base_addr_c; | |
79 | unsigned int pitch; | |
ecd29947 LP |
80 | |
81 | int (*notify)(struct sh_mobile_lcdc_chan *ch, | |
82 | enum sh_mobile_lcdc_entity_event event, | |
e0c8601a LP |
83 | const struct fb_videomode *mode, |
84 | const struct fb_monspecs *monspec); | |
6de9edd5 GL |
85 | }; |
86 | ||
87 | #endif |