Vishnuvardhan Prodduturi | 4aa8dc4 | 2015-10-20 21:20:43 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. |
Kuogee Hsieh | ea3bed3 | 2015-07-07 13:33:15 -0700 | [diff] [blame] | 2 | * |
| 3 | * Redistribution and use in source and binary forms, with or without |
| 4 | * modification, are permitted provided that the following conditions |
| 5 | * are 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 copyright |
| 9 | * notice, this list of conditions and the following disclaimer in |
| 10 | * the documentation and/or other materials provided with the |
| 11 | * distribution. |
| 12 | * * Neither the name of The Linux Foundation 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 17 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 18 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 19 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 20 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 22 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS |
| 23 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
| 24 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 25 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
| 26 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 27 | * SUCH DAMAGE. |
| 28 | */ |
| 29 | |
| 30 | #ifndef _PANEL_NT35597_WQXGA_DSC_VIDEO_H_ |
| 31 | #define _PANEL_NT35597_WQXGA_DSC_VIDEO_H_ |
| 32 | /*---------------------------------------------------------------------------*/ |
| 33 | /* HEADER files */ |
| 34 | /*---------------------------------------------------------------------------*/ |
| 35 | #include "panel.h" |
| 36 | |
| 37 | /*---------------------------------------------------------------------------*/ |
| 38 | /* Panel configuration */ |
| 39 | /*---------------------------------------------------------------------------*/ |
| 40 | static struct panel_config nt35597_wqxga_dsc_video_panel_data = { |
| 41 | "qcom,mdss_dsi_nt35597_dsc_wqxga_video", "dsi:1:", "qcom,mdss-dsi-panel", |
| 42 | 10, 0, "DISPLAY_2", 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0 |
| 43 | }; |
| 44 | |
| 45 | /*---------------------------------------------------------------------------*/ |
| 46 | /* Panel resolution */ |
| 47 | /*---------------------------------------------------------------------------*/ |
| 48 | static struct panel_resolution nt35597_wqxga_dsc_video_panel_res = { |
| 49 | 1440, 2560, 100, 32, 16, 0, 8, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
| 50 | }; |
| 51 | |
| 52 | /*---------------------------------------------------------------------------*/ |
| 53 | /* Panel color information */ |
| 54 | /*---------------------------------------------------------------------------*/ |
| 55 | static struct color_info nt35597_wqxga_dsc_video_color = { |
| 56 | 24, 0, 0xff, 0, 0, 0 |
| 57 | }; |
| 58 | |
| 59 | /*---------------------------------------------------------------------------*/ |
| 60 | /* Panel on/off command information */ |
| 61 | /*---------------------------------------------------------------------------*/ |
| 62 | static char nt35597_wqxga_dsc_video_on_cmd0[] = { |
| 63 | 0xff, 0x10, 0x15, 0x80 |
| 64 | }; |
| 65 | |
| 66 | static char nt35597_wqxga_dsc_video_on_cmd1[] = { |
| 67 | 0xfb, 0x01, 0x15, 0x80 |
| 68 | }; |
| 69 | |
| 70 | static char nt35597_wqxga_dsc_video_on_cmd2[] = { |
| 71 | 0xba, 0x03, 0x15, 0x80 |
| 72 | }; |
| 73 | |
| 74 | static char nt35597_wqxga_dsc_video_on_cmd3[] = { |
| 75 | 0xe5, 0x01, 0x15, 0x80 |
| 76 | }; |
| 77 | |
| 78 | static char nt35597_wqxga_dsc_video_on_cmd4[] = { |
| 79 | 0xb0, 0x03, 0x15, 0x80 |
| 80 | }; |
| 81 | |
| 82 | |
| 83 | static char nt35597_wqxga_dsc_video_on_cmd5[] = { |
| 84 | 0x06, 0x00, 0x39, 0xC0, |
| 85 | 0x3B, 0x03, 0x08, 0x08, |
| 86 | 0x2e, 0x64, 0xff, 0xff, |
| 87 | }; |
| 88 | |
| 89 | static char nt35597_wqxga_dsc_video_on_cmd6[] = { |
| 90 | 0xff, 0x28, 0x15, 0x80 |
| 91 | }; |
| 92 | |
| 93 | static char nt35597_wqxga_dsc_video_on_cmd7[] = { |
| 94 | 0x7a, 0x02, 0x15, 0x80 |
| 95 | }; |
| 96 | |
| 97 | static char nt35597_wqxga_dsc_video_on_cmd8[] = { |
| 98 | 0xfb, 0x01, 0x15, 0x80 |
| 99 | }; |
| 100 | |
| 101 | static char nt35597_wqxga_dsc_video_on_cmd9[] = { |
| 102 | 0xff, 0x10, 0x15, 0x80 |
| 103 | }; |
| 104 | |
| 105 | #ifdef USE_MANUFACTUR_DSC_CMD |
| 106 | static char nt35597_wqxga_dsc_video_on_cmd10[] = { |
| 107 | 0x11, 0x00, 0x39, 0xC0, |
| 108 | 0xC1, 0x09, 0x20, 0x00, |
| 109 | 0x10, 0x02, 0x00, 0x02, |
| 110 | 0x68, 0x01, 0xBB, 0x00, |
| 111 | 0x0A, 0x06, 0x67, 0x04, |
| 112 | 0xC5, 0xff, 0xff, 0xff, |
| 113 | }; |
| 114 | |
| 115 | static char nt35597_wqxga_dsc_video_on_cmd11[] = { |
| 116 | 0x03, 0x00, 0x39, 0xC0, |
| 117 | 0xc2, 0x10, 0xf0, 0xff, |
| 118 | }; |
| 119 | #endif |
| 120 | |
| 121 | static char nt35597_wqxga_dsc_video_on_cmd12[] = { |
| 122 | 0xfb, 0x01, 0x15, 0x80 |
| 123 | }; |
| 124 | |
| 125 | static char nt35597_wqxga_dsc_video_on_cmd13[] = { |
| 126 | 0xc0, 0x03, 0x15, 0x80 |
| 127 | }; |
| 128 | |
| 129 | static char nt35597_wqxga_dsc_video_on_cmd14[] = { |
| 130 | 0xbb, 0x03, 0x15, 0x80 |
| 131 | }; |
| 132 | |
| 133 | static char nt35597_wqxga_dsc_video_on_cmd15[] = { |
| 134 | 0xff, 0xe0, 0x15, 0x80 |
| 135 | }; |
| 136 | |
| 137 | static char nt35597_wqxga_dsc_video_on_cmd16[] = { |
| 138 | 0xfb, 0x01, 0x15, 0x80 |
| 139 | }; |
| 140 | |
| 141 | static char nt35597_wqxga_dsc_video_on_cmd17[] = { |
| 142 | 0x6b, 0x3d, 0x15, 0x80 |
| 143 | }; |
| 144 | |
| 145 | static char nt35597_wqxga_dsc_video_on_cmd18[] = { |
| 146 | 0x6c, 0x3d, 0x15, 0x80 |
| 147 | }; |
| 148 | |
| 149 | static char nt35597_wqxga_dsc_video_on_cmd19[] = { |
| 150 | 0x6d, 0x3d, 0x15, 0x80 |
| 151 | }; |
| 152 | |
| 153 | static char nt35597_wqxga_dsc_video_on_cmd20[] = { |
| 154 | 0x6e, 0x3d, 0x15, 0x80 |
| 155 | }; |
| 156 | |
| 157 | static char nt35597_wqxga_dsc_video_on_cmd21[] = { |
| 158 | 0x6f, 0x3d, 0x15, 0x80 |
| 159 | }; |
| 160 | |
| 161 | static char nt35597_wqxga_dsc_video_on_cmd22[] = { |
| 162 | 0x35, 0x02, 0x15, 0x80 |
| 163 | }; |
| 164 | |
| 165 | static char nt35597_wqxga_dsc_video_on_cmd23[] = { |
| 166 | 0x36, 0x72, 0x15, 0x80 |
| 167 | }; |
| 168 | |
| 169 | static char nt35597_wqxga_dsc_video_on_cmd24[] = { |
| 170 | 0x37, 0x10, 0x15, 0x80 |
| 171 | }; |
| 172 | |
| 173 | static char nt35597_wqxga_dsc_video_on_cmd25[] = { |
| 174 | 0x08, 0xc0, 0x15, 0x80 |
| 175 | }; |
| 176 | |
| 177 | static char nt35597_wqxga_dsc_video_on_cmd26[] = { |
| 178 | 0xff, 0x10, 0x15, 0x80 |
| 179 | }; |
| 180 | |
| 181 | static char nt35597_wqxga_dsc_video_on_cmd27[] = { |
| 182 | 0x11, 0x00, 0x05, 0x80 |
| 183 | }; |
| 184 | |
| 185 | static char nt35597_wqxga_dsc_video_on_cmd28[] = { |
| 186 | 0x29, 0x00, 0x05, 0x80 |
| 187 | }; |
| 188 | |
| 189 | static char nt35597_wqxga_dsc_video_on_cmd29[] = { |
| 190 | 0x01, 0x00, 0x07, 0x80 |
| 191 | }; |
| 192 | |
| 193 | static struct mipi_dsi_cmd nt35597_wqxga_dsc_video_on_command[] = { |
| 194 | {0x4, nt35597_wqxga_dsc_video_on_cmd0, 0x10}, |
| 195 | {0x4, nt35597_wqxga_dsc_video_on_cmd1, 0x10}, |
| 196 | {0x4, nt35597_wqxga_dsc_video_on_cmd2, 0x10}, |
| 197 | {0x4, nt35597_wqxga_dsc_video_on_cmd3, 0x10}, |
| 198 | {0x4, nt35597_wqxga_dsc_video_on_cmd4, 0x10}, |
| 199 | {0xc, nt35597_wqxga_dsc_video_on_cmd5, 0x10}, |
| 200 | {0x4, nt35597_wqxga_dsc_video_on_cmd6, 0x10}, |
| 201 | {0x4, nt35597_wqxga_dsc_video_on_cmd7, 0x10}, |
| 202 | {0x4, nt35597_wqxga_dsc_video_on_cmd8, 0x10}, |
| 203 | {0x4, nt35597_wqxga_dsc_video_on_cmd9, 0x10}, |
| 204 | #ifdef USE_MANUFACTUR_DSC_CMD |
| 205 | {0x18, nt35597_wqxga_dsc_video_on_cmd10, 0x10}, |
| 206 | {0x8, nt35597_wqxga_dsc_video_on_cmd11, 0x10}, |
| 207 | #endif |
| 208 | {0x4, nt35597_wqxga_dsc_video_on_cmd12, 0x10}, |
| 209 | {0x4, nt35597_wqxga_dsc_video_on_cmd13, 0x10}, |
| 210 | {0x4, nt35597_wqxga_dsc_video_on_cmd14, 0x10}, |
| 211 | {0x4, nt35597_wqxga_dsc_video_on_cmd15, 0x10}, |
| 212 | {0x4, nt35597_wqxga_dsc_video_on_cmd16, 0x10}, |
| 213 | {0x4, nt35597_wqxga_dsc_video_on_cmd17, 0x10}, |
| 214 | {0x4, nt35597_wqxga_dsc_video_on_cmd18, 0x10}, |
| 215 | {0x4, nt35597_wqxga_dsc_video_on_cmd19, 0x10}, |
| 216 | {0x4, nt35597_wqxga_dsc_video_on_cmd20, 0x10}, |
| 217 | {0x4, nt35597_wqxga_dsc_video_on_cmd21, 0x10}, |
| 218 | {0x4, nt35597_wqxga_dsc_video_on_cmd22, 0x10}, |
| 219 | {0x4, nt35597_wqxga_dsc_video_on_cmd23, 0x10}, |
| 220 | {0x4, nt35597_wqxga_dsc_video_on_cmd24, 0x10}, |
| 221 | {0x4, nt35597_wqxga_dsc_video_on_cmd25, 0x10}, |
| 222 | {0x4, nt35597_wqxga_dsc_video_on_cmd26, 0x10}, |
| 223 | {0x4, nt35597_wqxga_dsc_video_on_cmd27, 0x100}, |
| 224 | {0x4, nt35597_wqxga_dsc_video_on_cmd28, 0x100}, |
| 225 | {0x4, nt35597_wqxga_dsc_video_on_cmd29, 0x10}, |
| 226 | }; |
| 227 | |
| 228 | #ifdef USE_MANUFACTUR_DSC_CMD |
| 229 | #define NT35597_WQXGA_DSC_VIDEO_ON_COMMAND 30 |
| 230 | #else |
| 231 | #define NT35597_WQXGA_DSC_VIDEO_ON_COMMAND 28 |
| 232 | #endif |
| 233 | |
| 234 | |
| 235 | static char nt35597_wqxga_dsc_video_off_cmd0[] = { |
| 236 | 0x28, 0x00, 0x05, 0x80 |
| 237 | }; |
| 238 | |
| 239 | static char nt35597_wqxga_dsc_video_off_cmd1[] = { |
| 240 | 0x10, 0x00, 0x05, 0x80 |
| 241 | }; |
| 242 | |
| 243 | static struct mipi_dsi_cmd nt35597_wqxga_dsc_video_off_command[] = { |
| 244 | {0x4, nt35597_wqxga_dsc_video_off_cmd0, 0x32}, |
| 245 | {0x4, nt35597_wqxga_dsc_video_off_cmd1, 0x78} |
| 246 | }; |
| 247 | |
| 248 | #define NT35597_WQXGA_DSC_VIDEO_OFF_COMMAND 2 |
| 249 | |
| 250 | static struct command_state nt35597_wqxga_dsc_video_state = { |
| 251 | 0, 1 |
| 252 | }; |
| 253 | |
| 254 | /*---------------------------------------------------------------------------*/ |
| 255 | /* Command mode panel information */ |
| 256 | /*---------------------------------------------------------------------------*/ |
| 257 | static struct commandpanel_info nt35597_wqxga_dsc_video_command_panel = { |
| 258 | 1, 1, 1, 0, 0, 0x2c, 0, 0, 0, 1, 0, 0 |
| 259 | }; |
| 260 | |
| 261 | /*---------------------------------------------------------------------------*/ |
| 262 | /* Video mode panel information */ |
| 263 | /*---------------------------------------------------------------------------*/ |
| 264 | static struct videopanel_info nt35597_wqxga_dsc_video_video_panel = { |
| 265 | 0, 0, 0, 0, 1, 1, 1, 0, 0x9 |
| 266 | }; |
| 267 | |
| 268 | /*---------------------------------------------------------------------------*/ |
| 269 | /* Lane configuration */ |
| 270 | /*---------------------------------------------------------------------------*/ |
| 271 | static struct lane_configuration nt35597_wqxga_dsc_video_lane_config = { |
| 272 | 4, 0, 1, 1, 1, 1, 0 |
| 273 | }; |
| 274 | |
| 275 | /*---------------------------------------------------------------------------*/ |
| 276 | /* Panel timing */ |
| 277 | /*---------------------------------------------------------------------------*/ |
Sandeep Panda | 8c2e36b | 2015-08-03 12:12:46 +0530 | [diff] [blame] | 278 | static const uint32_t nt35597_wqxga_dsc_video_timings[] = { |
| 279 | 0xa4, 0x24, 0x18, 0x00, 0x4c, 0x50, 0x1c, 0x28, 0x1c, 0x03, 0x04, 0x00, |
| 280 | }; |
| 281 | |
Kuogee Hsieh | ea3bed3 | 2015-07-07 13:33:15 -0700 | [diff] [blame] | 282 | static const uint32_t nt35597_wqxga_dsc_thulium_video_timings[] = { |
| 283 | 0x20, 0x1d, 0x05, 0x07, 0x03, 0x03, 0x4, 0xa0, |
| 284 | 0x20, 0x1d, 0x05, 0x07, 0x03, 0x03, 0x4, 0xa0, |
| 285 | 0x20, 0x1d, 0x05, 0x07, 0x03, 0x03, 0x4, 0xa0, |
| 286 | 0x20, 0x1d, 0x05, 0x07, 0x03, 0x03, 0x4, 0xa0, |
| 287 | 0x20, 0x12, 0x05, 0x06, 0x03, 0x13, 0x4, 0xa0, |
| 288 | }; |
| 289 | |
| 290 | static struct panel_timing nt35597_wqxga_dsc_video_timing_info = { |
| 291 | 0x0, 0x04, 0x0b, 0x24 |
| 292 | }; |
| 293 | |
| 294 | /*---------------------------------------------------------------------------*/ |
| 295 | /* Panel reset sequence */ |
| 296 | /*---------------------------------------------------------------------------*/ |
| 297 | static struct panel_reset_sequence nt35597_wqxga_dsc_video_reset_seq = { |
| 298 | {1, 0, 1, }, {20, 20, 50, }, 2 |
| 299 | }; |
| 300 | |
| 301 | /*---------------------------------------------------------------------------*/ |
| 302 | /* Backlight setting */ |
| 303 | /*---------------------------------------------------------------------------*/ |
| 304 | static struct backlight nt35597_wqxga_dsc_video_backlight = { |
| 305 | 1, 1, 4095, 100, 1, "PMIC_8941" /* BL_WLED */ |
| 306 | }; |
| 307 | |
| 308 | static struct labibb_desc nt35597_wqxga_dsc_video_labibb = { |
Vishnuvardhan Prodduturi | 4aa8dc4 | 2015-10-20 21:20:43 +0530 | [diff] [blame] | 309 | 0, 1, 5500000, 5500000, 5500000, 5500000, 3, 3, 1, 0 |
Kuogee Hsieh | ea3bed3 | 2015-07-07 13:33:15 -0700 | [diff] [blame] | 310 | }; |
| 311 | |
| 312 | /*---------------------------------------------------------------------------*/ |
| 313 | /* Dynamic fps supported frequencies by panel */ |
| 314 | /*---------------------------------------------------------------------------*/ |
| 315 | static const struct dfps_panel_info nt35597_wqxga_dsc_video_dfps = { |
| 316 | 1, 8, {53, 54, 55, 56, 57, 58, 59, 60} |
| 317 | }; |
| 318 | |
| 319 | /*---------------------------------------------------------------------------*/ |
| 320 | /* DSC */ |
| 321 | /*---------------------------------------------------------------------------*/ |
Ujwal Patel | 41a665a | 2015-07-17 13:51:30 -0700 | [diff] [blame] | 322 | struct dsc_parameters nt35597_wqxga_dsc_video_params0 = { |
Dhaval Patel | e20f050 | 2016-03-30 17:41:09 -0700 | [diff] [blame] | 323 | 1, 1, 0, 16, 720, 8, 8, 2, 1, 0 |
Ujwal Patel | 41a665a | 2015-07-17 13:51:30 -0700 | [diff] [blame] | 324 | }; |
| 325 | |
| 326 | /* 1LM + 1 DSC_ENC */ |
| 327 | struct topology_config nt35597_wqxga_dsc_video_config0 = { |
Ujwal Patel | 5c3227b | 2015-08-12 14:48:02 -0700 | [diff] [blame] | 328 | "config0", {-1, -1}, 1, &nt35597_wqxga_dsc_video_params0, false |
Ujwal Patel | 41a665a | 2015-07-17 13:51:30 -0700 | [diff] [blame] | 329 | }; |
| 330 | |
| 331 | /* 2LM + 3D Mux + 1 DSC_ENC */ |
| 332 | struct topology_config nt35597_wqxga_dsc_video_config1 = { |
Ujwal Patel | 5c3227b | 2015-08-12 14:48:02 -0700 | [diff] [blame] | 333 | "config1", {720, 720}, 1, &nt35597_wqxga_dsc_video_params0, false |
Ujwal Patel | 41a665a | 2015-07-17 13:51:30 -0700 | [diff] [blame] | 334 | }; |
| 335 | |
| 336 | /* 2LM + 2 DSC_ENC + DSC_MERGE */ |
| 337 | struct topology_config nt35597_wqxga_dsc_video_config2 = { |
Ujwal Patel | 5c3227b | 2015-08-12 14:48:02 -0700 | [diff] [blame] | 338 | "config2", {720, 720}, 2, &nt35597_wqxga_dsc_video_params0, false |
Kuogee Hsieh | ea3bed3 | 2015-07-07 13:33:15 -0700 | [diff] [blame] | 339 | }; |
| 340 | |
| 341 | #endif |