mipi_renesas_video_fwvga_pt.c 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /* Copyright (c) 2011-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. #include "msm_fb.h"
  13. #include "mipi_dsi.h"
  14. #include "mipi_renesas.h"
  15. static struct msm_panel_info pinfo;
  16. static struct mipi_dsi_phy_ctrl dsi_video_mode_phy_db = {
  17. #ifdef CONFIG_FB_MSM_MDP303
  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. #else
  33. /* DSI_BIT_CLK at 400MHz, 1 lane, RGB888 */
  34. /* regulator */
  35. {0x03, 0x01, 0x01, 0x00},
  36. /* timing */
  37. {0xaa, 0x3b, 0x1b, 0x00, 0x52, 0x58, 0x20, 0x3f,
  38. 0x2e, 0x03, 0x04},
  39. /* phy ctrl */
  40. {0x7f, 0x00, 0x00, 0x00},
  41. /* strength */
  42. {0xee, 0x00, 0x86, 0x00},
  43. /* pll control */
  44. {0x40, 0xc7, 0xb0, 0xda, 0x00, 0x50, 0x48, 0x63,
  45. #if defined(RENESAS_FWVGA_TWO_LANE)
  46. 0x30, 0x07, 0x03,
  47. #else
  48. /* default set to 1 lane */
  49. 0x30, 0x07, 0x07,
  50. #endif
  51. 0x05, 0x14, 0x03, 0x0, 0x0, 0x54, 0x06, 0x10, 0x04, 0x0},
  52. #endif
  53. };
  54. static int __init mipi_video_renesas_fwvga_pt_init(void)
  55. {
  56. int ret;
  57. if (msm_fb_detect_client("mipi_video_renesas_fwvga"))
  58. return 0;
  59. pinfo.xres = 480;
  60. pinfo.yres = 864;
  61. pinfo.type = MIPI_VIDEO_PANEL;
  62. pinfo.pdest = DISPLAY_1;
  63. pinfo.wait_cycle = 0;
  64. pinfo.bpp = 24;
  65. #ifdef CONFIG_FB_MSM_MDP303
  66. pinfo.lcdc.h_back_porch = 100;
  67. pinfo.lcdc.h_front_porch = 100;
  68. pinfo.lcdc.h_pulse_width = 8;
  69. pinfo.lcdc.v_back_porch = 20;
  70. pinfo.lcdc.v_front_porch = 20;
  71. pinfo.lcdc.v_pulse_width = 1;
  72. pinfo.clk_rate = 499000000;
  73. #else
  74. #if defined(RENESAS_FWVGA_TWO_LANE)
  75. pinfo.lcdc.h_back_porch = 400;
  76. #else
  77. pinfo.lcdc.h_back_porch = 50;
  78. #endif
  79. pinfo.lcdc.h_front_porch = 50;
  80. #if defined(RENESAS_FWVGA_TWO_LANE)
  81. pinfo.lcdc.h_pulse_width = 5;
  82. #else
  83. pinfo.lcdc.h_pulse_width = 20;
  84. #endif
  85. #if defined(RENESAS_FWVGA_TWO_LANE)
  86. pinfo.lcdc.v_back_porch = 75;
  87. pinfo.lcdc.v_front_porch = 5;
  88. pinfo.lcdc.v_pulse_width = 1;
  89. #else
  90. pinfo.lcdc.v_back_porch = 10;
  91. pinfo.lcdc.v_front_porch = 10;
  92. pinfo.lcdc.v_pulse_width = 5;
  93. #endif
  94. #endif
  95. pinfo.lcdc.border_clr = 0; /* blk */
  96. pinfo.lcdc.underflow_clr = 0xff; /* blue */
  97. pinfo.lcdc.hsync_skew = 0;
  98. pinfo.bl_max = 255;
  99. pinfo.bl_min = 1;
  100. pinfo.fb_num = 2;
  101. pinfo.mipi.mode = DSI_VIDEO_MODE;
  102. pinfo.mipi.pulse_mode_hsa_he = TRUE;
  103. pinfo.mipi.hfp_power_stop = TRUE;
  104. pinfo.mipi.hbp_power_stop = TRUE;
  105. pinfo.mipi.hsa_power_stop = TRUE;
  106. pinfo.mipi.eof_bllp_power_stop = TRUE;
  107. pinfo.mipi.bllp_power_stop = TRUE;
  108. #ifdef CONFIG_FB_MSM_MDP303
  109. pinfo.mipi.traffic_mode = DSI_BURST_MODE;
  110. pinfo.mipi.dst_format = DSI_VIDEO_DST_FORMAT_RGB888;
  111. pinfo.mipi.vc = 0;
  112. pinfo.mipi.rgb_swap = DSI_RGB_SWAP_RGB;
  113. pinfo.mipi.data_lane0 = TRUE;
  114. pinfo.mipi.data_lane1 = TRUE;
  115. pinfo.mipi.t_clk_post = 0x20;
  116. pinfo.mipi.t_clk_pre = 0x2F;
  117. pinfo.mipi.stream = 0; /* dma_p */
  118. pinfo.mipi.mdp_trigger = DSI_CMD_TRIGGER_NONE;
  119. pinfo.mipi.dma_trigger = DSI_CMD_TRIGGER_SW;
  120. pinfo.mipi.frame_rate = 60;
  121. pinfo.mipi.dsi_phy_db = &dsi_video_mode_phy_db;
  122. pinfo.mipi.dlane_swap = 0x01;
  123. pinfo.mipi.tx_eot_append = 0x01;
  124. #else
  125. pinfo.mipi.traffic_mode = DSI_NON_BURST_SYNCH_PULSE;
  126. pinfo.mipi.dst_format = DSI_VIDEO_DST_FORMAT_RGB888;
  127. pinfo.mipi.vc = 0;
  128. pinfo.mipi.rgb_swap = DSI_RGB_SWAP_BGR;
  129. pinfo.mipi.data_lane0 = TRUE;
  130. #if defined(RENESAS_FWVGA_TWO_LANE)
  131. pinfo.mipi.data_lane1 = TRUE;
  132. #else
  133. pinfo.mipi.data_lane1 = FALSE;
  134. #endif
  135. pinfo.mipi.t_clk_post = 0x03;
  136. pinfo.mipi.t_clk_pre = 0x24;
  137. pinfo.mipi.stream = 0; /* dma_p */
  138. pinfo.mipi.mdp_trigger = DSI_CMD_TRIGGER_SW;
  139. pinfo.mipi.dma_trigger = DSI_CMD_TRIGGER_SW;
  140. pinfo.mipi.frame_rate = 60;
  141. pinfo.mipi.dsi_phy_db = &dsi_video_mode_phy_db;
  142. #endif
  143. ret = mipi_renesas_device_register(&pinfo, MIPI_DSI_PRIM,
  144. MIPI_DSI_PANEL_FWVGA_PT);
  145. if (ret)
  146. pr_err("%s: failed to register device!\n", __func__);
  147. return ret;
  148. }
  149. module_init(mipi_video_renesas_fwvga_pt_init);