1*225c9a8dSPaul Mundt #ifndef __ASM_SH_MOBILE_LCDC_H__ 2*225c9a8dSPaul Mundt #define __ASM_SH_MOBILE_LCDC_H__ 3*225c9a8dSPaul Mundt 4*225c9a8dSPaul Mundt #include <linux/fb.h> 5*225c9a8dSPaul Mundt 6*225c9a8dSPaul Mundt enum { RGB8, /* 24bpp, 8:8:8 */ 7*225c9a8dSPaul Mundt RGB9, /* 18bpp, 9:9 */ 8*225c9a8dSPaul Mundt RGB12A, /* 24bpp, 12:12 */ 9*225c9a8dSPaul Mundt RGB12B, /* 12bpp */ 10*225c9a8dSPaul Mundt RGB16, /* 16bpp */ 11*225c9a8dSPaul Mundt RGB18, /* 18bpp */ 12*225c9a8dSPaul Mundt RGB24, /* 24bpp */ 13*225c9a8dSPaul Mundt SYS8A, /* 24bpp, 8:8:8 */ 14*225c9a8dSPaul Mundt SYS8B, /* 18bpp, 8:8:2 */ 15*225c9a8dSPaul Mundt SYS8C, /* 18bpp, 2:8:8 */ 16*225c9a8dSPaul Mundt SYS8D, /* 16bpp, 8:8 */ 17*225c9a8dSPaul Mundt SYS9, /* 18bpp, 9:9 */ 18*225c9a8dSPaul Mundt SYS12, /* 24bpp, 12:12 */ 19*225c9a8dSPaul Mundt SYS16A, /* 16bpp */ 20*225c9a8dSPaul Mundt SYS16B, /* 18bpp, 16:2 */ 21*225c9a8dSPaul Mundt SYS16C, /* 18bpp, 2:16 */ 22*225c9a8dSPaul Mundt SYS18, /* 18bpp */ 23*225c9a8dSPaul Mundt SYS24 };/* 24bpp */ 24*225c9a8dSPaul Mundt 25*225c9a8dSPaul Mundt enum { LCDC_CHAN_DISABLED = 0, 26*225c9a8dSPaul Mundt LCDC_CHAN_MAINLCD, 27*225c9a8dSPaul Mundt LCDC_CHAN_SUBLCD }; 28*225c9a8dSPaul Mundt 29*225c9a8dSPaul Mundt enum { LCDC_CLK_BUS, LCDC_CLK_PERIPHERAL, LCDC_CLK_EXTERNAL }; 30*225c9a8dSPaul Mundt 31*225c9a8dSPaul Mundt struct sh_mobile_lcdc_sys_bus_cfg { 32*225c9a8dSPaul Mundt unsigned long ldmt2r; 33*225c9a8dSPaul Mundt unsigned long ldmt3r; 34*225c9a8dSPaul Mundt }; 35*225c9a8dSPaul Mundt 36*225c9a8dSPaul Mundt struct sh_mobile_lcdc_sys_bus_ops { 37*225c9a8dSPaul Mundt void (*write_index)(void *handle, unsigned long data); 38*225c9a8dSPaul Mundt void (*write_data)(void *handle, unsigned long data); 39*225c9a8dSPaul Mundt unsigned long (*read_data)(void *handle); 40*225c9a8dSPaul Mundt }; 41*225c9a8dSPaul Mundt 42*225c9a8dSPaul Mundt struct sh_mobile_lcdc_board_cfg { 43*225c9a8dSPaul Mundt void *board_data; 44*225c9a8dSPaul Mundt int (*setup_sys)(void *board_data, void *sys_ops_handle, 45*225c9a8dSPaul Mundt struct sh_mobile_lcdc_sys_bus_ops *sys_ops); 46*225c9a8dSPaul Mundt void (*display_on)(void *board_data); 47*225c9a8dSPaul Mundt void (*display_off)(void *board_data); 48*225c9a8dSPaul Mundt }; 49*225c9a8dSPaul Mundt 50*225c9a8dSPaul Mundt struct sh_mobile_lcdc_lcd_size_cfg { /* width and height of panel in mm */ 51*225c9a8dSPaul Mundt unsigned long width; 52*225c9a8dSPaul Mundt unsigned long height; 53*225c9a8dSPaul Mundt }; 54*225c9a8dSPaul Mundt 55*225c9a8dSPaul Mundt struct sh_mobile_lcdc_chan_cfg { 56*225c9a8dSPaul Mundt int chan; 57*225c9a8dSPaul Mundt int bpp; 58*225c9a8dSPaul Mundt int interface_type; /* selects RGBn or SYSn I/F, see above */ 59*225c9a8dSPaul Mundt int clock_divider; 60*225c9a8dSPaul Mundt struct fb_videomode lcd_cfg; 61*225c9a8dSPaul Mundt struct sh_mobile_lcdc_lcd_size_cfg lcd_size_cfg; 62*225c9a8dSPaul Mundt struct sh_mobile_lcdc_board_cfg board_cfg; 63*225c9a8dSPaul Mundt struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */ 64*225c9a8dSPaul Mundt }; 65*225c9a8dSPaul Mundt 66*225c9a8dSPaul Mundt struct sh_mobile_lcdc_info { 67*225c9a8dSPaul Mundt unsigned long lddckr; 68*225c9a8dSPaul Mundt int clock_source; 69*225c9a8dSPaul Mundt struct sh_mobile_lcdc_chan_cfg ch[2]; 70*225c9a8dSPaul Mundt }; 71*225c9a8dSPaul Mundt 72*225c9a8dSPaul Mundt #endif /* __ASM_SH_MOBILE_LCDC_H__ */ 73