1 /*
2  * Display setup code for the Merisc board
3  *
4  * Copyright (C) 2008 Martinsson Elektronik AB
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  */
10 #include <linux/init.h>
11 #include <linux/platform_device.h>
12 #include <linux/fb.h>
13 #include <video/atmel_lcdc.h>
14 #include <asm/setup.h>
15 #include <mach/board.h>
16 #include "merisc.h"
17 
18 static struct fb_videomode merisc_fb_videomode[] = {
19 	{
20 		.refresh	= 44,
21 		.xres		= 640,
22 		.yres		= 480,
23 		.left_margin	= 96,
24 		.right_margin	= 96,
25 		.upper_margin	= 34,
26 		.lower_margin	= 8,
27 		.hsync_len	= 64,
28 		.vsync_len	= 64,
29 		.name		= "640x480 @ 44",
30 		.pixclock	= KHZ2PICOS(25180),
31 		.sync		= 0,
32 		.vmode		= FB_VMODE_NONINTERLACED,
33 	},
34 };
35 
36 static struct fb_monspecs merisc_fb_monspecs = {
37 	.manufacturer	= "Kyo",
38 	.monitor	= "TCG075VG2AD",
39 	.modedb		= merisc_fb_videomode,
40 	.modedb_len	= ARRAY_SIZE(merisc_fb_videomode),
41 	.hfmin		= 30000,
42 	.hfmax		= 33333,
43 	.vfmin		= 60,
44 	.vfmax		= 90,
45 	.dclkmax	= 30000000,
46 };
47 
48 struct atmel_lcdfb_info merisc_lcdc_data = {
49 	.default_bpp		= 24,
50 	.default_dmacon		= ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN,
51 	.default_lcdcon2	= (ATMEL_LCDC_DISTYPE_TFT
52 				   | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE
53 				   | ATMEL_LCDC_MEMOR_BIG),
54 	.default_monspecs	= &merisc_fb_monspecs,
55 	.guard_time		= 2,
56 };
57 
merisc_display_init(void)58 static int __init merisc_display_init(void)
59 {
60 	at32_add_device_lcdc(0, &merisc_lcdc_data, fbmem_start,
61 			     fbmem_size, 0);
62 
63 	return 0;
64 }
65 device_initcall(merisc_display_init);
66