linux/drivers/staging/msm/mddi_ext_lcd.c
<<
>>
Prefs
   1/* Copyright (c) 2008-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
  22static int mddi_ext_lcd_on(struct platform_device *pdev);
  23static int mddi_ext_lcd_off(struct platform_device *pdev);
  24
  25static int mddi_ext_lcd_on(struct platform_device *pdev)
  26{
  27        return 0;
  28}
  29
  30static int mddi_ext_lcd_off(struct platform_device *pdev)
  31{
  32        return 0;
  33}
  34
  35static int __init mddi_ext_lcd_probe(struct platform_device *pdev)
  36{
  37        msm_fb_add_device(pdev);
  38
  39        return 0;
  40}
  41
  42static struct platform_driver this_driver = {
  43        .probe  = mddi_ext_lcd_probe,
  44        .driver = {
  45                .name   = "extmddi_svga",
  46        },
  47};
  48
  49static struct msm_fb_panel_data mddi_ext_lcd_panel_data = {
  50        .panel_info.xres = 800,
  51        .panel_info.yres = 600,
  52        .panel_info.type = EXT_MDDI_PANEL,
  53        .panel_info.pdest = DISPLAY_1,
  54        .panel_info.wait_cycle = 0,
  55        .panel_info.bpp = 18,
  56        .panel_info.fb_num = 2,
  57        .panel_info.clk_rate = 122880000,
  58        .panel_info.clk_min  = 120000000,
  59        .panel_info.clk_max  = 125000000,
  60        .on = mddi_ext_lcd_on,
  61        .off = mddi_ext_lcd_off,
  62};
  63
  64static struct platform_device this_device = {
  65        .name   = "extmddi_svga",
  66        .id     = 0,
  67        .dev    = {
  68                .platform_data = &mddi_ext_lcd_panel_data,
  69        }
  70};
  71
  72static int __init mddi_ext_lcd_init(void)
  73{
  74        int ret;
  75        struct msm_panel_info *pinfo;
  76
  77        ret = platform_driver_register(&this_driver);
  78        if (!ret) {
  79                pinfo = &mddi_ext_lcd_panel_data.panel_info;
  80                pinfo->lcd.vsync_enable = FALSE;
  81                pinfo->mddi.vdopkt = MDDI_DEFAULT_PRIM_PIX_ATTR;
  82
  83                ret = platform_device_register(&this_device);
  84                if (ret)
  85                        platform_driver_unregister(&this_driver);
  86        }
  87
  88        return ret;
  89}
  90
  91module_init(mddi_ext_lcd_init);
  92