mipi_toshiba_video_wsvga_pt.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. */
  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. /* 600*1024, RGB888, 3 Lane 55 fps video mode */
  19. /* regulator */
  20. {0x09, 0x08, 0x05, 0x00, 0x20},
  21. /* timing */
  22. {0x73, 0x2e, 0x11, 0x00, 0x3c, 0x46, 0x14, 0x31,
  23. 0x1c, 0x03, 0x04, 0xa0},
  24. /* phy ctrl */
  25. {0x5f, 0x00, 0x00, 0x10},
  26. /* strength */
  27. {0xff, 0x00, 0x06, 0x00},
  28. /* pll control */
  29. {0x0, 0x49, 0x30, 0xc4, 0x00, 0x20, 0x07, 0x62,
  30. 0x41, 0x0f, 0x01,
  31. 0x00, 0x14, 0x03, 0x00, 0x02, 0x00, 0x20, 0x00, 0x01 },
  32. };
  33. static int __init mipi_video_toshiba_wsvga_pt_init(void)
  34. {
  35. int ret;
  36. if (msm_fb_detect_client("mipi_video_toshiba_wsvga"))
  37. return 0;
  38. pinfo.xres = 600;
  39. pinfo.yres = 1024;
  40. /*
  41. *
  42. * Panel's Horizontal input timing requirement is to
  43. * include dummy(pad) data of 200 clk in addition to
  44. * width and porch/sync width values
  45. */
  46. pinfo.lcdc.xres_pad = 200;
  47. pinfo.lcdc.yres_pad = 0;
  48. pinfo.type = MIPI_VIDEO_PANEL;
  49. pinfo.pdest = DISPLAY_1;
  50. pinfo.wait_cycle = 0;
  51. pinfo.bpp = 24;
  52. pinfo.lcdc.h_back_porch = 16;
  53. pinfo.lcdc.h_front_porch = 23;
  54. pinfo.lcdc.h_pulse_width = 8;
  55. pinfo.lcdc.v_back_porch = 3;
  56. pinfo.lcdc.v_front_porch = 45;
  57. pinfo.lcdc.v_pulse_width = 2;
  58. pinfo.lcdc.border_clr = 0; /* blk */
  59. pinfo.lcdc.underflow_clr = 0xff; /* blue */
  60. pinfo.lcdc.hsync_skew = 0;
  61. pinfo.bl_max = MIPI_TOSHIBA_PWM_LEVEL;
  62. pinfo.bl_min = 1;
  63. pinfo.fb_num = 2;
  64. pinfo.mipi.mode = DSI_VIDEO_MODE;
  65. pinfo.mipi.pulse_mode_hsa_he = FALSE;
  66. pinfo.mipi.hfp_power_stop = FALSE;
  67. pinfo.mipi.hbp_power_stop = FALSE;
  68. pinfo.mipi.hsa_power_stop = FALSE;
  69. pinfo.mipi.eof_bllp_power_stop = FALSE;
  70. pinfo.mipi.bllp_power_stop = FALSE;
  71. pinfo.mipi.traffic_mode = DSI_NON_BURST_SYNCH_EVENT;
  72. pinfo.mipi.dst_format = DSI_VIDEO_DST_FORMAT_RGB888;
  73. pinfo.mipi.vc = 0;
  74. pinfo.mipi.rgb_swap = DSI_RGB_SWAP_RGB;
  75. pinfo.mipi.data_lane0 = TRUE;
  76. pinfo.mipi.data_lane1 = TRUE;
  77. pinfo.mipi.data_lane2 = TRUE;
  78. pinfo.mipi.t_clk_post = 0x04;
  79. pinfo.mipi.t_clk_pre = 0x1a;
  80. pinfo.mipi.esc_byte_ratio = 4;
  81. pinfo.mipi.stream = 0; /* dma_p */
  82. pinfo.mipi.mdp_trigger = 0;
  83. pinfo.mipi.dma_trigger = DSI_CMD_TRIGGER_SW;
  84. pinfo.mipi.frame_rate = 55;
  85. pinfo.mipi.dsi_phy_db = &dsi_video_mode_phy_db;
  86. pinfo.mipi.tx_eot_append = TRUE;
  87. ret = mipi_toshiba_device_register(&pinfo, MIPI_DSI_PRIM,
  88. MIPI_DSI_PANEL_WSVGA_PT);
  89. if (ret)
  90. printk(KERN_ERR "%s: failed to register device!\n", __func__);
  91. return ret;
  92. }
  93. module_init(mipi_video_toshiba_wsvga_pt_init);