Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
[pandora-kernel.git] / drivers / staging / msm / mddi_toshiba_wvga.c
1 /* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
2  *
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License version 2 and
5  * only version 2 as published by the Free Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17
18 #include "msm_fb.h"
19 #include "mddihost.h"
20 #include "mddi_toshiba.h"
21
22 static int __init mddi_toshiba_wvga_init(void)
23 {
24         int ret;
25         struct msm_panel_info pinfo;
26
27 #ifdef CONFIG_FB_MSM_MDDI_AUTO_DETECT
28         if (msm_fb_detect_client("mddi_toshiba_wvga"))
29                 return 0;
30 #endif
31
32         pinfo.xres = 800;
33         pinfo.yres = 480;
34         pinfo.pdest = DISPLAY_2;
35         pinfo.type = MDDI_PANEL;
36         pinfo.mddi.vdopkt = MDDI_DEFAULT_PRIM_PIX_ATTR;
37         pinfo.wait_cycle = 0;
38         pinfo.bpp = 18;
39         pinfo.lcd.vsync_enable = TRUE;
40         pinfo.lcd.refx100 = 6118;
41         pinfo.lcd.v_back_porch = 6;
42         pinfo.lcd.v_front_porch = 0;
43         pinfo.lcd.v_pulse_width = 0;
44         pinfo.lcd.hw_vsync_mode = FALSE;
45         pinfo.lcd.vsync_notifier_period = (1 * HZ);
46         pinfo.bl_max = 4;
47         pinfo.bl_min = 1;
48         pinfo.clk_rate = 192000000;
49         pinfo.clk_min =  190000000;
50         pinfo.clk_max =  200000000;
51         pinfo.fb_num = 2;
52
53         ret = mddi_toshiba_device_register(&pinfo, TOSHIBA_VGA_PRIM,
54                                            LCD_TOSHIBA_2P4_WVGA);
55         if (ret) {
56                 printk(KERN_ERR "%s: failed to register device!\n", __func__);
57                 return ret;
58         }
59
60         return ret;
61 }
62
63 module_init(mddi_toshiba_wvga_init);