jdi_dsi_panel.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /* Copyright (c) 2012, Samsung Electronics. All rights reserved.
  2. *
  3. * Redistribution and use in source and binary forms, with or without
  4. * modification, are permitted provided that the following conditions are
  5. * met:
  6. * * Redistributions of source code must retain the above copyright
  7. * notice, this list of conditions and the following disclaimer.
  8. * * Redistributions in binary form must reproduce the above
  9. * copyright notice, this list of conditions and the following
  10. * disclaimer in the documentation and/or other materials provided
  11. * with the distribution.
  12. * * Neither the name of Code Aurora Forum, Inc. nor the names of its
  13. * contributors may be used to endorse or promote products derived
  14. * from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
  17. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  18. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
  19. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
  20. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  21. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  22. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  23. * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  24. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
  25. * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  26. * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. *
  28. */
  29. #ifndef JDI_DSI_PANEL_H
  30. #define JDI_DSI_PANEL_H
  31. #define MAX_PANEL_NAME_SIZE 100
  32. #define RECOVERY_BRIGHTNESS 180
  33. #define LCD_DEBUG(X, ...) pr_info("[LCD]%s:"X, __func__, ## __VA_ARGS__);
  34. #define AUTO_BRIGHTNESS_CABC_FUNCTION
  35. #include "smart_dimming.h"
  36. enum mipi_samsung_cmd_list {
  37. PANEL_READY_TO_ON, // 0
  38. PANEL_DISP_OFF, // 1
  39. PANEL_DISPLAY_ON, // 2
  40. PANEL_DISPLAY_OFF, // 3
  41. PANEL_DISPLAY_UNBLANK, // 4
  42. PANEL_DISPLAY_BLANK, // 5
  43. PANEL_ALL_PIXEL_OFF, // 6
  44. PANEL_BRIGHT_CTRL, // 7
  45. PANEL_MTP_ENABLE, // 8
  46. PANEL_MTP_DISABLE, // 9
  47. PANEL_NEED_FLIP, // 10
  48. #if defined(AUTO_BRIGHTNESS_CABC_FUNCTION)
  49. PANEL_CABC_ENABLE,//11
  50. PANEL_CABC_DISABLE,//12
  51. #endif
  52. PANEL_LATE_ON, // 13
  53. PANEL_EARLY_OFF, // 14
  54. PANEL_TOUCHSENSING_ON, // 15
  55. PANEL_TOUCHSENSING_OFF, // 16
  56. PANEL_TEAR_ON, // 17
  57. PANEL_TEAR_OFF, //18
  58. PANEL_HSYNC_ON, // 19
  59. PANEL_HSYNC_OFF, // 20
  60. };
  61. enum {
  62. MIPI_RESUME_STATE,
  63. MIPI_SUSPEND_STATE,
  64. };
  65. struct cmd_map {
  66. int *bl_level;
  67. int *cmd_idx;
  68. int size;
  69. };
  70. struct candella_lux_map {
  71. int *lux_tab;
  72. char *pwm_tab;
  73. char *cabc_pwm_tab;
  74. int *cmd_idx;
  75. int lux_tab_size;
  76. int bkl[256];
  77. };
  78. struct display_status {
  79. unsigned char cabc_on;
  80. unsigned char is_smart_dim_loaded;
  81. unsigned char is_mdnie_loaded;
  82. unsigned char auto_brightness;
  83. unsigned char recovery_boot_mode;
  84. unsigned char on;
  85. unsigned char wait_disp_on;
  86. int curr_elvss_idx;
  87. int curr_cabc_idx;
  88. int curr_aid_idx;
  89. int curr_gamma_idx;
  90. int bright_level;
  91. int temperature;
  92. char temperature_value;
  93. int temper_need_update;
  94. int siop_status;
  95. int hbm_mode;
  96. };
  97. struct mipi_samsung_driver_data {
  98. struct display_status dstat;
  99. struct msm_fb_data_type *mfd;
  100. struct mdss_panel_data *pdata;
  101. struct mdss_dsi_ctrl_pdata *ctrl_pdata;
  102. struct mutex lock;
  103. #if defined(CONFIG_HAS_EARLYSUSPEND)
  104. struct early_suspend early_suspend;
  105. #endif
  106. char panel_name[MAX_PANEL_NAME_SIZE];
  107. int panel;
  108. unsigned int manufacture_id;
  109. struct smartdim_conf *sdimconf;
  110. };
  111. enum {
  112. PANEL_TFT_FHD_S6D6FA0,
  113. };
  114. struct panel_hrev {
  115. char *name;
  116. int panel_code;
  117. };
  118. #endif
  119. void mdss_dsi_cmds_send(struct mdss_dsi_ctrl_pdata *ctrl, struct dsi_cmd_desc *cmds, int cnt, int flag);