mddi_toshiba_wvga_pt.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* Copyright (c) 2009-2012, 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. #include "mddi_toshiba.h"
  17. static struct msm_panel_info pinfo;
  18. static int __init mddi_toshiba_wvga_pt_init(void)
  19. {
  20. int ret;
  21. #ifdef CONFIG_FB_MSM_MDDI_AUTO_DETECT
  22. uint id;
  23. ret = msm_fb_detect_client("mddi_toshiba_wvga_pt");
  24. if (ret == -ENODEV)
  25. return 0;
  26. if (ret) {
  27. id = mddi_get_client_id();
  28. if (id != 0xd2638722)
  29. return 0;
  30. }
  31. #endif
  32. pinfo.xres = 480;
  33. pinfo.yres = 800;
  34. MSM_FB_SINGLE_MODE_PANEL(&pinfo);
  35. pinfo.type = MDDI_PANEL;
  36. pinfo.pdest = DISPLAY_1;
  37. pinfo.mddi.vdopkt = MDDI_DEFAULT_PRIM_PIX_ATTR;
  38. pinfo.wait_cycle = 0;
  39. pinfo.bpp = 18;
  40. pinfo.lcd.vsync_enable = TRUE;
  41. pinfo.lcd.refx100 = 6102; /* adjust refx100 to prevent tearing */
  42. pinfo.mddi.is_type1 = TRUE;
  43. pinfo.lcd.v_back_porch = 8; /* vsw=10 + vbp = 8 */
  44. pinfo.lcd.v_front_porch = 2;
  45. pinfo.lcd.v_pulse_width = 10;
  46. pinfo.lcd.hw_vsync_mode = FALSE;
  47. pinfo.lcd.vsync_notifier_period = (1 * HZ);
  48. pinfo.bl_max = 15;
  49. pinfo.bl_min = 1;
  50. pinfo.clk_rate = 222750000;
  51. pinfo.clk_min = 200000000;
  52. pinfo.clk_max = 240000000;
  53. pinfo.fb_num = 2;
  54. ret = mddi_toshiba_device_register(&pinfo, TOSHIBA_VGA_PRIM,
  55. LCD_TOSHIBA_2P4_WVGA_PT);
  56. if (ret)
  57. printk(KERN_ERR "%s: failed to register device!\n", __func__);
  58. return ret;
  59. }
  60. module_init(mddi_toshiba_wvga_pt_init);