2008-07-23 22:31:24 -06:00
|
|
|
#ifndef __ASM_SH_MOBILE_LCDC_H__
|
|
|
|
#define __ASM_SH_MOBILE_LCDC_H__
|
|
|
|
|
|
|
|
#include <linux/fb.h>
|
2011-05-18 05:10:07 -06:00
|
|
|
#include <video/sh_mobile_meram.h>
|
2008-07-23 22:31:24 -06:00
|
|
|
|
2010-05-21 09:15:41 -06:00
|
|
|
enum {
|
|
|
|
RGB8, /* 24bpp, 8:8:8 */
|
|
|
|
RGB9, /* 18bpp, 9:9 */
|
|
|
|
RGB12A, /* 24bpp, 12:12 */
|
|
|
|
RGB12B, /* 12bpp */
|
|
|
|
RGB16, /* 16bpp */
|
|
|
|
RGB18, /* 18bpp */
|
|
|
|
RGB24, /* 24bpp */
|
|
|
|
YUV422, /* 16bpp */
|
|
|
|
SYS8A, /* 24bpp, 8:8:8 */
|
|
|
|
SYS8B, /* 18bpp, 8:8:2 */
|
|
|
|
SYS8C, /* 18bpp, 2:8:8 */
|
|
|
|
SYS8D, /* 16bpp, 8:8 */
|
|
|
|
SYS9, /* 18bpp, 9:9 */
|
|
|
|
SYS12, /* 24bpp, 12:12 */
|
|
|
|
SYS16A, /* 16bpp */
|
|
|
|
SYS16B, /* 18bpp, 16:2 */
|
|
|
|
SYS16C, /* 18bpp, 2:16 */
|
|
|
|
SYS18, /* 18bpp */
|
|
|
|
SYS24, /* 24bpp */
|
|
|
|
};
|
2008-07-23 22:31:24 -06:00
|
|
|
|
|
|
|
enum { LCDC_CHAN_DISABLED = 0,
|
|
|
|
LCDC_CHAN_MAINLCD,
|
|
|
|
LCDC_CHAN_SUBLCD };
|
|
|
|
|
|
|
|
enum { LCDC_CLK_BUS, LCDC_CLK_PERIPHERAL, LCDC_CLK_EXTERNAL };
|
|
|
|
|
2008-10-09 03:48:16 -06:00
|
|
|
#define LCDC_FLAGS_DWPOL (1 << 0) /* Rising edge dot clock data latch */
|
|
|
|
#define LCDC_FLAGS_DIPOL (1 << 1) /* Active low display enable polarity */
|
|
|
|
#define LCDC_FLAGS_DAPOL (1 << 2) /* Active low display data polarity */
|
|
|
|
#define LCDC_FLAGS_HSCNT (1 << 3) /* Disable HSYNC during VBLANK */
|
|
|
|
#define LCDC_FLAGS_DWCNT (1 << 4) /* Disable dotclock during blanking */
|
|
|
|
|
2008-07-23 22:31:24 -06:00
|
|
|
struct sh_mobile_lcdc_sys_bus_cfg {
|
|
|
|
unsigned long ldmt2r;
|
|
|
|
unsigned long ldmt3r;
|
2008-12-18 23:34:41 -07:00
|
|
|
unsigned long deferred_io_msec;
|
2008-07-23 22:31:24 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
struct sh_mobile_lcdc_sys_bus_ops {
|
|
|
|
void (*write_index)(void *handle, unsigned long data);
|
|
|
|
void (*write_data)(void *handle, unsigned long data);
|
|
|
|
unsigned long (*read_data)(void *handle);
|
|
|
|
};
|
|
|
|
|
2010-09-03 01:20:23 -06:00
|
|
|
struct module;
|
2008-07-23 22:31:24 -06:00
|
|
|
struct sh_mobile_lcdc_board_cfg {
|
2010-09-03 01:20:23 -06:00
|
|
|
struct module *owner;
|
2008-07-23 22:31:24 -06:00
|
|
|
void *board_data;
|
|
|
|
int (*setup_sys)(void *board_data, void *sys_ops_handle,
|
|
|
|
struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
|
2009-12-07 07:20:06 -07:00
|
|
|
void (*start_transfer)(void *board_data, void *sys_ops_handle,
|
|
|
|
struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
|
2010-07-21 04:13:17 -06:00
|
|
|
void (*display_on)(void *board_data, struct fb_info *info);
|
2008-07-23 22:31:24 -06:00
|
|
|
void (*display_off)(void *board_data);
|
2011-02-15 20:49:01 -07:00
|
|
|
int (*set_brightness)(void *board_data, int brightness);
|
|
|
|
int (*get_brightness)(void *board_data);
|
2008-07-23 22:31:24 -06:00
|
|
|
};
|
|
|
|
|
2008-08-11 00:26:00 -06:00
|
|
|
struct sh_mobile_lcdc_lcd_size_cfg { /* width and height of panel in mm */
|
|
|
|
unsigned long width;
|
|
|
|
unsigned long height;
|
|
|
|
};
|
|
|
|
|
2011-02-15 20:49:01 -07:00
|
|
|
/* backlight info */
|
|
|
|
struct sh_mobile_lcdc_bl_info {
|
|
|
|
const char *name;
|
|
|
|
int max_brightness;
|
|
|
|
};
|
|
|
|
|
2008-07-23 22:31:24 -06:00
|
|
|
struct sh_mobile_lcdc_chan_cfg {
|
|
|
|
int chan;
|
|
|
|
int bpp;
|
|
|
|
int interface_type; /* selects RGBn or SYSn I/F, see above */
|
|
|
|
int clock_divider;
|
2008-10-09 03:48:16 -06:00
|
|
|
unsigned long flags; /* LCDC_FLAGS_... */
|
2010-09-03 01:20:04 -06:00
|
|
|
const struct fb_videomode *lcd_cfg;
|
|
|
|
int num_cfg;
|
2008-08-11 00:26:00 -06:00
|
|
|
struct sh_mobile_lcdc_lcd_size_cfg lcd_size_cfg;
|
2008-07-23 22:31:24 -06:00
|
|
|
struct sh_mobile_lcdc_board_cfg board_cfg;
|
2011-02-15 20:49:01 -07:00
|
|
|
struct sh_mobile_lcdc_bl_info bl_info;
|
2008-07-23 22:31:24 -06:00
|
|
|
struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */
|
2011-02-23 22:47:13 -07:00
|
|
|
int nonstd;
|
2011-05-18 05:10:07 -06:00
|
|
|
struct sh_mobile_meram_cfg *meram_cfg;
|
2008-07-23 22:31:24 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
struct sh_mobile_lcdc_info {
|
|
|
|
int clock_source;
|
|
|
|
struct sh_mobile_lcdc_chan_cfg ch[2];
|
2011-05-18 05:10:07 -06:00
|
|
|
struct sh_mobile_meram_info *meram_dev;
|
2008-07-23 22:31:24 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __ASM_SH_MOBILE_LCDC_H__ */
|