mipi_NT35510_video_wvga_pt.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /* Copyright (c) 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 "mipi_dsi.h"
  15. #include "mipi_NT35510.h"
  16. static struct msm_panel_info pinfo;
  17. static struct mipi_dsi_phy_ctrl dsi_video_mode_phy_db = {
  18. /* DSI Bit Clock at 500 MHz, 2 lane, RGB888 */
  19. /* regulator */
  20. {0x03, 0x01, 0x01, 0x00},
  21. /* timing */
  22. {0xb9, 0x8e, 0x1f, 0x00, 0x98, 0x9c, 0x22, 0x90,
  23. 0x18, 0x03, 0x04},
  24. /* phy ctrl */
  25. {0x7f, 0x00, 0x00, 0x00},
  26. /* strength */
  27. {0xbb, 0x02, 0x06, 0x00},
  28. /* pll control */
  29. {0x00, 0xec, 0x31, 0xd2, 0x00, 0x40, 0x37, 0x62,
  30. 0x01, 0x0f, 0x07,
  31. 0x05, 0x14, 0x03, 0x0, 0x0, 0x0, 0x20, 0x0, 0x02, 0x0},
  32. };
  33. static int mipi_video_nt35510_wvga_pt_init(void)
  34. {
  35. int ret;
  36. if (msm_fb_detect_client("mipi_video_nt35510_wvga"))
  37. return 0;
  38. pinfo.xres = 480;
  39. pinfo.yres = 800;
  40. pinfo.type = MIPI_VIDEO_PANEL;
  41. pinfo.pdest = DISPLAY_1;
  42. pinfo.wait_cycle = 0;
  43. pinfo.bpp = 24;
  44. pinfo.lcdc.h_back_porch = 100;
  45. pinfo.lcdc.h_front_porch = 100;
  46. pinfo.lcdc.h_pulse_width = 8;
  47. pinfo.lcdc.v_back_porch = 20;
  48. pinfo.lcdc.v_front_porch = 20;
  49. pinfo.lcdc.v_pulse_width = 1;
  50. pinfo.lcdc.border_clr = 0; /* blk */
  51. pinfo.lcdc.underflow_clr = 0xff; /* blue */
  52. /* number of dot_clk cycles HSYNC active edge is
  53. delayed from VSYNC active edge */
  54. pinfo.lcdc.hsync_skew = 0;
  55. pinfo.clk_rate = 499000000;
  56. pinfo.bl_max = 255;
  57. pinfo.bl_min = 1;
  58. pinfo.fb_num = 2;
  59. pinfo.mipi.mode = DSI_VIDEO_MODE;
  60. /* send HSA and HE following VS/VE packet */
  61. pinfo.mipi.pulse_mode_hsa_he = TRUE;
  62. pinfo.mipi.hfp_power_stop = TRUE; /* LP-11 during the HFP period */
  63. pinfo.mipi.hbp_power_stop = TRUE; /* LP-11 during the HBP period */
  64. pinfo.mipi.hsa_power_stop = TRUE; /* LP-11 during the HSA period */
  65. /* LP-11 or let Command Mode Engine send packets in
  66. HS or LP mode for the BLLP of the last line of a frame */
  67. pinfo.mipi.eof_bllp_power_stop = TRUE;
  68. /* LP-11 or let Command Mode Engine send packets in
  69. HS or LP mode for packets sent during BLLP period */
  70. pinfo.mipi.bllp_power_stop = TRUE;
  71. pinfo.mipi.traffic_mode = DSI_BURST_MODE;
  72. pinfo.mipi.dst_format = DSI_VIDEO_DST_FORMAT_RGB888;
  73. pinfo.mipi.vc = 0;
  74. pinfo.mipi.rgb_swap = DSI_RGB_SWAP_RGB; /* RGB */
  75. pinfo.mipi.data_lane0 = TRUE;
  76. pinfo.mipi.data_lane1 = TRUE;
  77. pinfo.mipi.t_clk_post = 0x20;
  78. pinfo.mipi.t_clk_pre = 0x2f;
  79. pinfo.mipi.stream = 0; /* dma_p */
  80. pinfo.mipi.mdp_trigger = DSI_CMD_TRIGGER_NONE;
  81. pinfo.mipi.dma_trigger = DSI_CMD_TRIGGER_SW;
  82. pinfo.mipi.frame_rate = 60; /* FIXME */
  83. pinfo.mipi.dsi_phy_db = &dsi_video_mode_phy_db;
  84. pinfo.mipi.dlane_swap = 0x01;
  85. /* append EOT at the end of data burst */
  86. pinfo.mipi.tx_eot_append = 0x01;
  87. ret = mipi_nt35510_device_register(&pinfo, MIPI_DSI_PRIM,
  88. MIPI_DSI_PANEL_WVGA_PT);
  89. if (ret)
  90. pr_err("%s: failed to register device!\n", __func__);
  91. return ret;
  92. }
  93. module_init(mipi_video_nt35510_wvga_pt_init);