Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
[pandora-kernel.git] / drivers / staging / msm / mddi_toshiba_wvga_pt.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 "mddihosti.h"
21 #include "mddi_toshiba.h"
22
23 static int __init mddi_toshiba_wvga_pt_init(void)
24 {
25         int ret;
26         struct msm_panel_info pinfo;
27 #ifdef CONFIG_FB_MSM_MDDI_AUTO_DETECT
28         uint id;
29
30         ret = msm_fb_detect_client("mddi_toshiba_wvga_pt");
31         if (ret == -ENODEV)
32                 return 0;
33
34         if (ret) {
35                 id = mddi_get_client_id();
36                 if (id != 0xd2638722)
37                         return 0;
38         }
39 #endif
40
41         pinfo.xres = 480;
42         pinfo.yres = 800;
43         pinfo.type = MDDI_PANEL;
44         pinfo.pdest = DISPLAY_1;
45         pinfo.mddi.vdopkt = MDDI_DEFAULT_PRIM_PIX_ATTR;
46         pinfo.wait_cycle = 0;
47         pinfo.bpp = 18;
48         pinfo.lcd.vsync_enable = FALSE;
49         pinfo.bl_max = 15;
50         pinfo.bl_min = 1;
51         pinfo.clk_rate = 192000000;
52         pinfo.clk_min =  190000000;
53         pinfo.clk_max =  200000000;
54         pinfo.fb_num = 2;
55
56         ret = mddi_toshiba_device_register(&pinfo, TOSHIBA_VGA_PRIM,
57                                                 LCD_TOSHIBA_2P4_WVGA_PT);
58         if (ret)
59                 printk(KERN_ERR "%s: failed to register device!\n", __func__);
60
61         return ret;
62 }
63
64 module_init(mddi_toshiba_wvga_pt_init);