mipi_novatek_video_qhd_pt.c 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* Copyright (c) 2010-2011, 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_novatek.h"
  16. static struct msm_panel_info pinfo;
  17. static struct mipi_dsi_phy_ctrl dsi_video_mode_phy_db = {
  18. /* DSI_BIT_CLK at 500MHz, 2 lane, RGB888 */
  19. {0x03, 0x01, 0x01, 0x00}, /* regulator */
  20. /* timing */
  21. {0x82, 0x31, 0x13, 0x0, 0x42, 0x4D, 0x18,
  22. 0x35, 0x21, 0x03, 0x04},
  23. {0x7f, 0x00, 0x00, 0x00}, /* phy ctrl */
  24. {0xee, 0x02, 0x86, 0x00}, /* strength */
  25. /* pll control */
  26. {0x40, 0xf9, 0xb0, 0xda, 0x00, 0x50, 0x48, 0x63,
  27. #if defined(NOVATEK_TWO_LANE)
  28. 0x30, 0x07, 0x03,
  29. #else /* default set to 1 lane */
  30. 0x30, 0x07, 0x07,
  31. #endif
  32. 0x05, 0x14, 0x03, 0x0, 0x0, 0x54, 0x06, 0x10, 0x04, 0x0},
  33. };
  34. static int __init mipi_video_novatek_qhd_pt_init(void)
  35. {
  36. int ret;
  37. if (msm_fb_detect_client("mipi_video_novatek_qhd"))
  38. return 0;
  39. pinfo.xres = 540;
  40. pinfo.yres = 960;
  41. pinfo.type = MIPI_VIDEO_PANEL;
  42. pinfo.pdest = DISPLAY_1;
  43. pinfo.wait_cycle = 0;
  44. pinfo.bpp = 24;
  45. pinfo.lcdc.h_back_porch = 80;
  46. pinfo.lcdc.h_front_porch = 24;
  47. pinfo.lcdc.h_pulse_width = 8;
  48. pinfo.lcdc.v_back_porch = 16;
  49. pinfo.lcdc.v_front_porch = 8;
  50. pinfo.lcdc.v_pulse_width = 1;
  51. pinfo.lcdc.border_clr = 0; /* blk */
  52. pinfo.lcdc.underflow_clr = 0xff; /* blue */
  53. pinfo.lcdc.hsync_skew = 0;
  54. pinfo.bl_max = 15;
  55. pinfo.bl_min = 1;
  56. pinfo.fb_num = 2;
  57. pinfo.mipi.mode = DSI_VIDEO_MODE;
  58. pinfo.mipi.pulse_mode_hsa_he = TRUE;
  59. pinfo.mipi.hfp_power_stop = FALSE;
  60. pinfo.mipi.hbp_power_stop = FALSE;
  61. pinfo.mipi.hsa_power_stop = FALSE;
  62. pinfo.mipi.eof_bllp_power_stop = TRUE;
  63. pinfo.mipi.bllp_power_stop = TRUE;
  64. pinfo.mipi.traffic_mode = DSI_NON_BURST_SYNCH_PULSE;
  65. pinfo.mipi.dst_format = DSI_VIDEO_DST_FORMAT_RGB888;
  66. pinfo.mipi.vc = 0;
  67. pinfo.mipi.rgb_swap = DSI_RGB_SWAP_BGR;
  68. pinfo.mipi.data_lane0 = TRUE;
  69. pinfo.mipi.esc_byte_ratio = 4;
  70. #if defined(NOVATEK_TWO_LANE)
  71. pinfo.mipi.data_lane1 = TRUE;
  72. #endif
  73. pinfo.mipi.tx_eot_append = TRUE;
  74. pinfo.mipi.t_clk_post = 0x04;
  75. pinfo.mipi.t_clk_pre = 0x1c;
  76. pinfo.mipi.stream = 0; /* dma_p */
  77. pinfo.mipi.mdp_trigger = DSI_CMD_TRIGGER_SW;
  78. pinfo.mipi.dma_trigger = DSI_CMD_TRIGGER_SW;
  79. pinfo.mipi.frame_rate = 60;
  80. pinfo.mipi.dsi_phy_db = &dsi_video_mode_phy_db;
  81. ret = mipi_novatek_device_register(&pinfo, MIPI_DSI_PRIM,
  82. MIPI_DSI_PANEL_QHD_PT);
  83. if (ret)
  84. pr_err("%s: failed to register device!\n", __func__);
  85. return ret;
  86. }
  87. module_init(mipi_video_novatek_qhd_pt_init);