Merge tag 'v3.10.68' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / video / sh_mobile_lcdcfb.h
CommitLineData
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 */
10enum { 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 17struct backlight_device;
d2ccdc80
LP
18struct fb_info;
19struct module;
fc9e78e6 20struct sh_mobile_lcdc_chan;
d2ccdc80 21struct sh_mobile_lcdc_entity;
fc9e78e6 22struct sh_mobile_lcdc_format_info;
d2ccdc80
LP
23struct sh_mobile_lcdc_priv;
24
458981c3
LP
25#define SH_MOBILE_LCDC_DISPLAY_DISCONNECTED 0
26#define SH_MOBILE_LCDC_DISPLAY_CONNECTED 1
27
d2ccdc80
LP
28struct sh_mobile_lcdc_entity_ops {
29 /* Display */
5864ace1 30 int (*display_on)(struct sh_mobile_lcdc_entity *entity);
d2ccdc80
LP
31 void (*display_off)(struct sh_mobile_lcdc_entity *entity);
32};
33
ecd29947
LP
34enum 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,
38};
39
d2ccdc80
LP
40struct sh_mobile_lcdc_entity {
41 struct module *owner;
42 const struct sh_mobile_lcdc_entity_ops *ops;
e34d0bbb 43 struct sh_mobile_lcdc_chan *lcdc;
13f80eea 44 struct fb_videomode def_mode;
d2ccdc80 45};
6de9edd5 46
9a217e34
LP
47/*
48 * struct sh_mobile_lcdc_chan - LCDC display channel
49 *
a4aa25f6 50 * @pan_y_offset: Panning linear offset in bytes (luma component)
9a217e34
LP
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
54 */
6de9edd5
GL
55struct sh_mobile_lcdc_chan {
56 struct sh_mobile_lcdc_priv *lcdc;
9a2985e7 57 struct sh_mobile_lcdc_entity *tx_dev;
b5ef967d 58 const struct sh_mobile_lcdc_chan_cfg *cfg;
9a2985e7 59
6de9edd5
GL
60 unsigned long *reg_offs;
61 unsigned long ldmt1r_value;
62 unsigned long enabled; /* ME and SE in LDCNT2R */
4a237177 63 void *cache;
740f802a
LP
64
65 struct mutex open_lock; /* protects the use counter */
66 int use_count;
67
a67f379d
LP
68 void *fb_mem;
69 unsigned long fb_size;
b5ef967d 70
6de9edd5 71 dma_addr_t dma_handle;
a4aa25f6 72 unsigned long pan_y_offset;
740f802a
LP
73
74 unsigned long frame_end;
6de9edd5
GL
75 wait_queue_head_t frame_end_wait;
76 struct completion vsync_completion;
9a217e34 77
fc9e78e6 78 const struct sh_mobile_lcdc_format_info *format;
58f03d99
LP
79 u32 colorspace;
80 unsigned int xres;
81 unsigned int xres_virtual;
82 unsigned int yres;
83 unsigned int yres_virtual;
84 unsigned int pitch;
85
9a217e34
LP
86 unsigned long base_addr_y;
87 unsigned long base_addr_c;
72c04af9 88 unsigned int line_size;
ecd29947
LP
89
90 int (*notify)(struct sh_mobile_lcdc_chan *ch,
91 enum sh_mobile_lcdc_entity_event event,
e0c8601a
LP
92 const struct fb_videomode *mode,
93 const struct fb_monspecs *monspec);
740f802a
LP
94
95 /* Backlight */
96 struct backlight_device *bl;
656d4f33 97 unsigned int bl_brightness;
740f802a
LP
98
99 /* FB */
100 struct fb_info *info;
101 u32 pseudo_palette[PALETTE_NR];
102 struct {
103 unsigned int width;
104 unsigned int height;
105 struct fb_videomode mode;
106 } display;
107 struct fb_deferred_io defio;
108 struct scatterlist *sglist;
109 int blank_status;
6de9edd5
GL
110};
111
112#endif