mipi_toshiba_video_wuxga.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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_toshiba.h"
  16. static struct msm_panel_info pinfo;
  17. static struct mipi_dsi_phy_ctrl dsi_video_mode_phy_db = {
  18. /* 1920*1200, RGB888, 4 Lane 60 fps video mode */
  19. /* regulator */
  20. {0x03, 0x0a, 0x04, 0x00, 0x20},
  21. /* timing */
  22. {0x66, 0x26, 0x1F, 0x00, 0x55, 0x9C, 0x16, 0x90,
  23. 0x23, 0x03, 0x04, 0xa0},
  24. /* phy ctrl */
  25. {0x5f, 0x00, 0x00, 0x10},
  26. /* strength */
  27. {0xff, 0x00, 0x06, 0x00},
  28. /* pll control */
  29. {0x0, 0xD7, 0x1, 0x19, 0x00, 0x50, 0x48, 0x63,
  30. 0x41, 0x0f, 0x01,
  31. 0x00, 0x14, 0x03, 0x00, 0x02, 0x00, 0x20, 0x00, 0x01 },
  32. };
  33. static int __init mipi_video_toshiba_wuxga_init(void)
  34. {
  35. int ret;
  36. if (msm_fb_detect_client("mipi_video_toshiba_wuxga"))
  37. return 0;
  38. pinfo.xres = 1920;
  39. pinfo.yres = 1200;
  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 = 50;
  45. pinfo.lcdc.h_front_porch = 50;
  46. pinfo.lcdc.h_pulse_width = 170;
  47. pinfo.lcdc.v_back_porch = 7;
  48. pinfo.lcdc.v_front_porch = 8;
  49. pinfo.lcdc.v_pulse_width = 30;
  50. pinfo.lcdc.border_clr = 0; /* blk */
  51. pinfo.lcdc.underflow_clr = 0xff; /* blue */
  52. pinfo.lcdc.hsync_skew = 0;
  53. pinfo.bl_max = MIPI_TOSHIBA_PWM_LEVEL;
  54. pinfo.bl_min = 1;
  55. pinfo.fb_num = 2;
  56. pinfo.clk_rate = 981560000;
  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.data_lane1 = TRUE;
  70. pinfo.mipi.data_lane2 = TRUE;
  71. pinfo.mipi.data_lane3 = TRUE;
  72. pinfo.mipi.tx_eot_append = TRUE;
  73. pinfo.mipi.t_clk_post = 0x04;
  74. pinfo.mipi.t_clk_pre = 0x1c;
  75. pinfo.mipi.stream = 0; /* dma_p */
  76. pinfo.mipi.mdp_trigger = DSI_CMD_TRIGGER_SW;
  77. pinfo.mipi.dma_trigger = DSI_CMD_TRIGGER_SW;
  78. pinfo.mipi.frame_rate = 60;
  79. pinfo.mipi.dsi_phy_db = &dsi_video_mode_phy_db;
  80. pinfo.mipi.esc_byte_ratio = 9;
  81. ret = mipi_toshiba_device_register(&pinfo, MIPI_DSI_PRIM,
  82. MIPI_DSI_PANEL_WUXGA);
  83. if (ret)
  84. printk(KERN_ERR "%s: failed to register device!\n", __func__);
  85. return ret;
  86. }
  87. module_init(mipi_video_toshiba_wuxga_init);