mddi_ext_lcd.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* Copyright (c) 2008-2010, The Linux Foundation. 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. */
  13. #include "msm_fb.h"
  14. #include "mddihost.h"
  15. #include "mddihosti.h"
  16. static int mddi_ext_lcd_on(struct platform_device *pdev);
  17. static int mddi_ext_lcd_off(struct platform_device *pdev);
  18. static int mddi_ext_lcd_on(struct platform_device *pdev)
  19. {
  20. return 0;
  21. }
  22. static int mddi_ext_lcd_off(struct platform_device *pdev)
  23. {
  24. return 0;
  25. }
  26. static int __init mddi_ext_lcd_probe(struct platform_device *pdev)
  27. {
  28. msm_fb_add_device(pdev);
  29. return 0;
  30. }
  31. static struct platform_driver this_driver = {
  32. .probe = mddi_ext_lcd_probe,
  33. .driver = {
  34. .name = "extmddi_svga",
  35. },
  36. };
  37. static struct msm_fb_panel_data mddi_ext_lcd_panel_data = {
  38. .panel_info.xres = 800,
  39. .panel_info.yres = 600,
  40. .panel_info.mode2_xres = 0;
  41. .panel_info.mode2_yres = 0;
  42. .panel_info.mode2_bpp = 0;
  43. .panel_info.type = EXT_MDDI_PANEL,
  44. .panel_info.pdest = DISPLAY_1,
  45. .panel_info.wait_cycle = 0,
  46. .panel_info.bpp = 18,
  47. .panel_info.fb_num = 2,
  48. .panel_info.clk_rate = 122880000,
  49. .panel_info.clk_min = 120000000,
  50. .panel_info.clk_max = 125000000,
  51. .on = mddi_ext_lcd_on,
  52. .off = mddi_ext_lcd_off,
  53. };
  54. static struct platform_device this_device = {
  55. .name = "extmddi_svga",
  56. .id = 0,
  57. .dev = {
  58. .platform_data = &mddi_ext_lcd_panel_data,
  59. }
  60. };
  61. static int __init mddi_ext_lcd_init(void)
  62. {
  63. int ret;
  64. struct msm_panel_info *pinfo;
  65. ret = platform_driver_register(&this_driver);
  66. if (!ret) {
  67. pinfo = &mddi_ext_lcd_panel_data.panel_info;
  68. pinfo->lcd.vsync_enable = FALSE;
  69. pinfo->mddi.vdopkt = MDDI_DEFAULT_PRIM_PIX_ATTR;
  70. ret = platform_device_register(&this_device);
  71. if (ret)
  72. platform_driver_unregister(&this_driver);
  73. }
  74. return ret;
  75. }
  76. module_init(mddi_ext_lcd_init);