blob: aeed6687e6a737b9d51852380c48bea7e5ab0e6d [file] [log] [blame]
Guennadi Liakhovetski6de9edd2010-09-03 07:20:23 +00001#ifndef SH_MOBILE_LCDCFB_H
2#define SH_MOBILE_LCDCFB_H
3
4#include <linux/completion.h>
5#include <linux/fb.h>
Guennadi Liakhovetskidd210502010-09-14 14:48:54 +00006#include <linux/mutex.h>
Guennadi Liakhovetski6de9edd2010-09-03 07:20:23 +00007#include <linux/wait.h>
8
9/* per-channel registers */
10enum { LDDCKPAT1R, LDDCKPAT2R, LDMT1R, LDMT2R, LDMT3R, LDDFR, LDSM1R,
Damian Hobson-Garcia53b50312011-02-24 05:47:13 +000011 LDSM2R, LDSA1R, LDSA2R, LDMLSR, LDHCNR, LDHSYNR, LDVLNR, LDVSYNR, LDPMR,
Guennadi Liakhovetski6de9edd2010-09-03 07:20:23 +000012 LDHAJR,
13 NR_CH_REGS };
14
15#define PALETTE_NR 16
16
17struct sh_mobile_lcdc_priv;
18struct fb_info;
Alexandre Courbot3b0fd9d2011-02-16 03:49:01 +000019struct backlight_device;
Guennadi Liakhovetski6de9edd2010-09-03 07:20:23 +000020
21struct sh_mobile_lcdc_chan {
22 struct sh_mobile_lcdc_priv *lcdc;
23 unsigned long *reg_offs;
24 unsigned long ldmt1r_value;
25 unsigned long enabled; /* ME and SE in LDCNT2R */
26 struct sh_mobile_lcdc_chan_cfg cfg;
27 u32 pseudo_palette[PALETTE_NR];
28 unsigned long saved_ch_regs[NR_CH_REGS];
29 struct fb_info *info;
Alexandre Courbot3b0fd9d2011-02-16 03:49:01 +000030 struct backlight_device *bl;
Guennadi Liakhovetski6de9edd2010-09-03 07:20:23 +000031 dma_addr_t dma_handle;
32 struct fb_deferred_io defio;
33 struct scatterlist *sglist;
34 unsigned long frame_end;
35 unsigned long pan_offset;
36 wait_queue_head_t frame_end_wait;
37 struct completion vsync_completion;
Guennadi Liakhovetski1c120de2010-09-03 07:20:27 +000038 struct fb_var_screeninfo display_var;
Guennadi Liakhovetskidd210502010-09-14 14:48:54 +000039 int use_count;
Alexandre Courbot8857b9a2011-02-23 08:36:30 +000040 int blank_status;
Guennadi Liakhovetskidd210502010-09-14 14:48:54 +000041 struct mutex open_lock; /* protects the use counter */
Damian7caa4342011-05-18 11:10:07 +000042 int meram_enabled;
Guennadi Liakhovetski6de9edd2010-09-03 07:20:23 +000043};
44
45#endif