Dhaval Patel | b95039c | 2015-03-16 11:14:06 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2013-2015, The Linux Foundation. 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 |
| 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 | #include <debug.h> |
| 31 | #include <string.h> |
| 32 | #include <err.h> |
| 33 | #include <smem.h> |
| 34 | #include <msm_panel.h> |
| 35 | #include <board.h> |
| 36 | #include <mipi_dsi.h> |
| 37 | #include <qtimer.h> |
| 38 | #include <platform.h> |
| 39 | |
| 40 | #include "include/panel.h" |
| 41 | #include "target/display.h" |
| 42 | #include "panel_display.h" |
| 43 | #include <mipi_dsi.h> |
Kuogee Hsieh | 0b492c9 | 2015-07-08 13:02:36 -0700 | [diff] [blame] | 44 | #include <mdp5.h> |
Dhaval Patel | b95039c | 2015-03-16 11:14:06 -0700 | [diff] [blame] | 45 | |
| 46 | /*---------------------------------------------------------------------------*/ |
| 47 | /* GCDB Panel Database */ |
| 48 | /*---------------------------------------------------------------------------*/ |
Dhaval Patel | 989d4fc | 2015-04-01 19:04:46 -0700 | [diff] [blame] | 49 | #include "include/panel_nt35597_wqxga_dualdsi_video.h" |
Kuogee Hsieh | 9d7e714 | 2015-06-16 10:36:19 -0700 | [diff] [blame] | 50 | #include "include/panel_nt35597_wqxga_dualdsi_cmd.h" |
Kuogee Hsieh | 0b492c9 | 2015-07-08 13:02:36 -0700 | [diff] [blame] | 51 | #include "include/panel_nt35597_wqxga_dsc_video.h" |
| 52 | #include "include/panel_nt35597_wqxga_dsc_cmd.h" |
Dhaval Patel | b95039c | 2015-03-16 11:14:06 -0700 | [diff] [blame] | 53 | #include "include/panel_sharp_wqxga_dualdsi_video.h" |
| 54 | #include "include/panel_jdi_qhd_dualdsi_video.h" |
| 55 | #include "include/panel_jdi_qhd_dualdsi_cmd.h" |
feifanz | 76fe648 | 2015-09-02 15:25:16 +0800 | [diff] [blame^] | 56 | #include "include/panel_r69007_wqxga_cmd.h" |
Dhaval Patel | b95039c | 2015-03-16 11:14:06 -0700 | [diff] [blame] | 57 | |
| 58 | /*---------------------------------------------------------------------------*/ |
| 59 | /* static panel selection variable */ |
| 60 | /*---------------------------------------------------------------------------*/ |
| 61 | enum { |
Kuogee Hsieh | 0b492c9 | 2015-07-08 13:02:36 -0700 | [diff] [blame] | 62 | SHARP_WQXGA_DUALDSI_VIDEO_PANEL, |
Dhaval Patel | 989d4fc | 2015-04-01 19:04:46 -0700 | [diff] [blame] | 63 | NT35597_WQXGA_DUALDSI_VIDEO_PANEL, |
Kuogee Hsieh | 9d7e714 | 2015-06-16 10:36:19 -0700 | [diff] [blame] | 64 | NT35597_WQXGA_DUALDSI_CMD_PANEL, |
Kuogee Hsieh | 0b492c9 | 2015-07-08 13:02:36 -0700 | [diff] [blame] | 65 | NT35597_WQXGA_DSC_VIDEO_PANEL, |
| 66 | NT35597_WQXGA_DSC_CMD_PANEL, |
Dhaval Patel | b95039c | 2015-03-16 11:14:06 -0700 | [diff] [blame] | 67 | JDI_QHD_DUALDSI_VIDEO_PANEL, |
| 68 | JDI_QHD_DUALDSI_CMD_PANEL, |
feifanz | 76fe648 | 2015-09-02 15:25:16 +0800 | [diff] [blame^] | 69 | R69007_WQXGA_CMD_PANEL, |
Dhaval Patel | b95039c | 2015-03-16 11:14:06 -0700 | [diff] [blame] | 70 | UNKNOWN_PANEL |
| 71 | }; |
| 72 | |
| 73 | /* |
| 74 | * The list of panels that are supported on this target. |
| 75 | * Any panel in this list can be selected using fastboot oem command. |
| 76 | */ |
| 77 | static struct panel_list supp_panels[] = { |
Kuogee Hsieh | 0b492c9 | 2015-07-08 13:02:36 -0700 | [diff] [blame] | 78 | {"sharp_wqxga_dualdsi_video", SHARP_WQXGA_DUALDSI_VIDEO_PANEL}, |
Dhaval Patel | 989d4fc | 2015-04-01 19:04:46 -0700 | [diff] [blame] | 79 | {"nt35597_wqxga_dualdsi_video", NT35597_WQXGA_DUALDSI_VIDEO_PANEL}, |
Kuogee Hsieh | 9d7e714 | 2015-06-16 10:36:19 -0700 | [diff] [blame] | 80 | {"nt35597_wqxga_dualdsi_cmd", NT35597_WQXGA_DUALDSI_CMD_PANEL}, |
Kuogee Hsieh | 0b492c9 | 2015-07-08 13:02:36 -0700 | [diff] [blame] | 81 | {"nt35597_wqxga_dsc_video", NT35597_WQXGA_DSC_VIDEO_PANEL}, |
| 82 | {"nt35597_wqxga_dsc_cmd", NT35597_WQXGA_DSC_CMD_PANEL}, |
Dhaval Patel | b95039c | 2015-03-16 11:14:06 -0700 | [diff] [blame] | 83 | {"jdi_qhd_dualdsi_video", JDI_QHD_DUALDSI_VIDEO_PANEL}, |
| 84 | {"jdi_qhd_dualdsi_cmd", JDI_QHD_DUALDSI_CMD_PANEL}, |
feifanz | 76fe648 | 2015-09-02 15:25:16 +0800 | [diff] [blame^] | 85 | {"r69007_wqxga_cmd", R69007_WQXGA_CMD_PANEL}, |
Dhaval Patel | b95039c | 2015-03-16 11:14:06 -0700 | [diff] [blame] | 86 | }; |
| 87 | |
| 88 | static uint32_t panel_id; |
| 89 | |
| 90 | int oem_panel_rotation() |
| 91 | { |
| 92 | return NO_ERROR; |
| 93 | } |
| 94 | |
| 95 | int oem_panel_on() |
| 96 | { |
| 97 | if (panel_id == JDI_QHD_DUALDSI_CMD_PANEL) { |
| 98 | /* needs extra delay to avoid unexpected artifacts */ |
| 99 | mdelay(JDI_QHD_DUALDSI_CMD_PANEL_ON_DELAY); |
| 100 | |
| 101 | } |
| 102 | return NO_ERROR; |
| 103 | } |
| 104 | |
| 105 | int oem_panel_off() |
| 106 | { |
| 107 | return NO_ERROR; |
| 108 | } |
| 109 | |
| 110 | static bool init_panel_data(struct panel_struct *panelstruct, |
| 111 | struct msm_panel_info *pinfo, |
| 112 | struct mdss_dsi_phy_ctrl *phy_db) |
| 113 | { |
| 114 | int pan_type; |
| 115 | |
| 116 | switch (panel_id) { |
| 117 | case SHARP_WQXGA_DUALDSI_VIDEO_PANEL: |
| 118 | pan_type = PANEL_TYPE_DSI; |
| 119 | pinfo->lcd_reg_en = 0; |
| 120 | panelstruct->paneldata = &sharp_wqxga_dualdsi_video_panel_data; |
Dhaval Patel | b95039c | 2015-03-16 11:14:06 -0700 | [diff] [blame] | 121 | panelstruct->paneldata->panel_operating_mode = 11; |
| 122 | panelstruct->paneldata->panel_with_enable_gpio = 0; |
| 123 | |
| 124 | panelstruct->panelres = &sharp_wqxga_dualdsi_video_panel_res; |
| 125 | panelstruct->color = &sharp_wqxga_dualdsi_video_color; |
| 126 | panelstruct->videopanel = &sharp_wqxga_dualdsi_video_video_panel; |
| 127 | panelstruct->commandpanel = &sharp_wqxga_dualdsi_video_command_panel; |
| 128 | panelstruct->state = &sharp_wqxga_dualdsi_video_state; |
| 129 | panelstruct->laneconfig = &sharp_wqxga_dualdsi_video_lane_config; |
| 130 | panelstruct->paneltiminginfo |
| 131 | = &sharp_wqxga_dualdsi_video_timing_info; |
| 132 | panelstruct->panelresetseq |
| 133 | = &sharp_wqxga_dualdsi_video_reset_seq; |
| 134 | panelstruct->backlightinfo = &sharp_wqxga_dualdsi_video_backlight; |
| 135 | |
| 136 | pinfo->labibb = &sharp_wqxga_dualdsi_video_labibb; |
| 137 | |
| 138 | pinfo->mipi.panel_on_cmds |
| 139 | = sharp_wqxga_dualdsi_video_on_command; |
| 140 | pinfo->mipi.num_of_panel_on_cmds |
| 141 | = SHARP_WQXGA_DUALDSI_VIDEO_ON_COMMAND; |
| 142 | pinfo->mipi.panel_off_cmds |
| 143 | = sharp_wqxga_dualdsi_video_off_command; |
| 144 | pinfo->mipi.num_of_panel_off_cmds |
| 145 | = SHARP_WQXGA_DUALDSI_VIDEO_OFF_COMMAND; |
| 146 | memcpy(phy_db->timing, |
| 147 | sharp_wqxga_dualdsi_thulium_video_timings, |
| 148 | MAX_TIMING_CONFIG * sizeof(uint32_t)); |
| 149 | pinfo->mipi.tx_eot_append = true; |
| 150 | break; |
Dhaval Patel | 989d4fc | 2015-04-01 19:04:46 -0700 | [diff] [blame] | 151 | case NT35597_WQXGA_DUALDSI_VIDEO_PANEL: |
| 152 | pan_type = PANEL_TYPE_DSI; |
| 153 | pinfo->lcd_reg_en = 0; |
| 154 | panelstruct->paneldata = &nt35597_wqxga_dualdsi_video_panel_data; |
Dhaval Patel | 989d4fc | 2015-04-01 19:04:46 -0700 | [diff] [blame] | 155 | panelstruct->panelres = &nt35597_wqxga_dualdsi_video_panel_res; |
| 156 | panelstruct->color = &nt35597_wqxga_dualdsi_video_color; |
| 157 | panelstruct->videopanel = &nt35597_wqxga_dualdsi_video_video_panel; |
| 158 | panelstruct->commandpanel = &nt35597_wqxga_dualdsi_video_command_panel; |
| 159 | panelstruct->state = &nt35597_wqxga_dualdsi_video_state; |
| 160 | panelstruct->laneconfig = &nt35597_wqxga_dualdsi_video_lane_config; |
| 161 | panelstruct->paneltiminginfo |
| 162 | = &nt35597_wqxga_dualdsi_video_timing_info; |
| 163 | panelstruct->panelresetseq |
| 164 | = &nt35597_wqxga_dualdsi_video_reset_seq; |
| 165 | panelstruct->backlightinfo = &nt35597_wqxga_dualdsi_video_backlight; |
| 166 | |
| 167 | pinfo->labibb = &nt35597_wqxga_dualdsi_video_labibb; |
| 168 | |
| 169 | pinfo->mipi.panel_on_cmds |
| 170 | = nt35597_wqxga_dualdsi_video_on_command; |
| 171 | pinfo->mipi.num_of_panel_on_cmds |
| 172 | = NT35597_WQXGA_DUALDSI_VIDEO_ON_COMMAND; |
| 173 | pinfo->mipi.panel_off_cmds |
| 174 | = nt35597_wqxga_dualdsi_video_off_command; |
| 175 | pinfo->mipi.num_of_panel_off_cmds |
| 176 | = NT35597_WQXGA_DUALDSI_VIDEO_OFF_COMMAND; |
| 177 | memcpy(phy_db->timing, |
| 178 | nt35597_wqxga_dualdsi_thulium_video_timings, |
| 179 | MAX_TIMING_CONFIG * sizeof(uint32_t)); |
| 180 | pinfo->mipi.tx_eot_append = true; |
| 181 | break; |
Kuogee Hsieh | 9d7e714 | 2015-06-16 10:36:19 -0700 | [diff] [blame] | 182 | case NT35597_WQXGA_DUALDSI_CMD_PANEL: |
| 183 | pan_type = PANEL_TYPE_DSI; |
| 184 | pinfo->lcd_reg_en = 0; |
| 185 | panelstruct->paneldata = &nt35597_wqxga_dualdsi_cmd_panel_data; |
| 186 | panelstruct->panelres = &nt35597_wqxga_dualdsi_cmd_panel_res; |
| 187 | panelstruct->color = &nt35597_wqxga_dualdsi_cmd_color; |
| 188 | panelstruct->videopanel = &nt35597_wqxga_dualdsi_cmd_video_panel; |
| 189 | panelstruct->commandpanel = &nt35597_wqxga_dualdsi_cmd_command_panel; |
| 190 | panelstruct->state = &nt35597_wqxga_dualdsi_cmd_state; |
| 191 | panelstruct->laneconfig = &nt35597_wqxga_dualdsi_cmd_lane_config; |
| 192 | panelstruct->paneltiminginfo |
| 193 | = &nt35597_wqxga_dualdsi_cmd_timing_info; |
| 194 | panelstruct->panelresetseq |
| 195 | = &nt35597_wqxga_dualdsi_cmd_reset_seq; |
| 196 | panelstruct->backlightinfo = &nt35597_wqxga_dualdsi_cmd_backlight; |
| 197 | |
| 198 | pinfo->labibb = &nt35597_wqxga_dualdsi_cmd_labibb; |
| 199 | |
| 200 | pinfo->mipi.panel_on_cmds |
| 201 | = nt35597_wqxga_dualdsi_cmd_on_command; |
| 202 | pinfo->mipi.num_of_panel_on_cmds |
| 203 | = NT35597_WQXGA_DUALDSI_CMD_ON_COMMAND; |
| 204 | pinfo->mipi.panel_off_cmds |
| 205 | = nt35597_wqxga_dualdsi_cmd_off_command; |
| 206 | pinfo->mipi.num_of_panel_off_cmds |
| 207 | = NT35597_WQXGA_DUALDSI_CMD_OFF_COMMAND; |
| 208 | memcpy(phy_db->timing, |
| 209 | nt35597_wqxga_dualdsi_thulium_cmd_timings, |
| 210 | MAX_TIMING_CONFIG * sizeof(uint32_t)); |
| 211 | pinfo->mipi.tx_eot_append = true; |
| 212 | break; |
Kuogee Hsieh | 0b492c9 | 2015-07-08 13:02:36 -0700 | [diff] [blame] | 213 | case NT35597_WQXGA_DSC_VIDEO_PANEL: |
| 214 | pan_type = PANEL_TYPE_DSI; |
| 215 | pinfo->lcd_reg_en = 0; |
| 216 | panelstruct->paneldata = &nt35597_wqxga_dsc_video_panel_data; |
| 217 | panelstruct->panelres = &nt35597_wqxga_dsc_video_panel_res; |
| 218 | panelstruct->color = &nt35597_wqxga_dsc_video_color; |
| 219 | panelstruct->videopanel = &nt35597_wqxga_dsc_video_video_panel; |
| 220 | panelstruct->commandpanel = &nt35597_wqxga_dsc_video_command_panel; |
| 221 | panelstruct->state = &nt35597_wqxga_dsc_video_state; |
| 222 | panelstruct->laneconfig = &nt35597_wqxga_dsc_video_lane_config; |
| 223 | panelstruct->paneltiminginfo |
| 224 | = &nt35597_wqxga_dsc_video_timing_info; |
| 225 | panelstruct->panelresetseq |
| 226 | = &nt35597_wqxga_dsc_video_reset_seq; |
| 227 | panelstruct->backlightinfo = &nt35597_wqxga_dsc_video_backlight; |
| 228 | |
| 229 | pinfo->labibb = &nt35597_wqxga_dsc_video_labibb; |
| 230 | |
| 231 | pinfo->mipi.panel_on_cmds |
| 232 | = nt35597_wqxga_dsc_video_on_command; |
| 233 | pinfo->mipi.num_of_panel_on_cmds |
| 234 | = NT35597_WQXGA_DSC_VIDEO_ON_COMMAND; |
| 235 | pinfo->mipi.panel_off_cmds |
| 236 | = nt35597_wqxga_dsc_video_off_command; |
| 237 | pinfo->mipi.num_of_panel_off_cmds |
| 238 | = NT35597_WQXGA_DSC_VIDEO_OFF_COMMAND; |
| 239 | memcpy(phy_db->timing, |
| 240 | nt35597_wqxga_dsc_thulium_video_timings, |
| 241 | MAX_TIMING_CONFIG * sizeof(uint32_t)); |
| 242 | pinfo->mipi.tx_eot_append = true; |
| 243 | |
| 244 | pinfo->compression_mode = COMPRESSION_DSC; |
| 245 | memcpy(&panelstruct->dsc_paras, &nt35597_wqxga_dsc_video_paras, |
| 246 | sizeof(struct dsc_parameters)); |
| 247 | pinfo->dsc.parameter_calc = mdss_dsc_parameters_calc; |
| 248 | pinfo->dsc.dsc2buf = mdss_dsc_to_buf; |
| 249 | pinfo->dsc.dsi_dsc_config = mdss_dsc_dsi_config; |
| 250 | pinfo->dsc.mdp_dsc_config = mdss_dsc_mdp_config; |
| 251 | break; |
| 252 | case NT35597_WQXGA_DSC_CMD_PANEL: |
| 253 | pan_type = PANEL_TYPE_DSI; |
| 254 | pinfo->lcd_reg_en = 0; |
| 255 | panelstruct->paneldata = &nt35597_wqxga_dsc_cmd_panel_data; |
| 256 | panelstruct->panelres = &nt35597_wqxga_dsc_cmd_panel_res; |
| 257 | panelstruct->color = &nt35597_wqxga_dsc_cmd_color; |
| 258 | panelstruct->videopanel = &nt35597_wqxga_dsc_cmd_video_panel; |
| 259 | panelstruct->commandpanel = &nt35597_wqxga_dsc_cmd_command_panel; |
| 260 | panelstruct->state = &nt35597_wqxga_dsc_cmd_state; |
| 261 | panelstruct->laneconfig = &nt35597_wqxga_dsc_cmd_lane_config; |
| 262 | panelstruct->paneltiminginfo |
| 263 | = &nt35597_wqxga_dsc_cmd_timing_info; |
| 264 | panelstruct->panelresetseq |
| 265 | = &nt35597_wqxga_dsc_cmd_reset_seq; |
| 266 | panelstruct->backlightinfo = &nt35597_wqxga_dsc_cmd_backlight; |
| 267 | |
| 268 | pinfo->labibb = &nt35597_wqxga_dsc_cmd_labibb; |
| 269 | |
| 270 | pinfo->mipi.panel_on_cmds |
| 271 | = nt35597_wqxga_dsc_cmd_on_command; |
| 272 | pinfo->mipi.num_of_panel_on_cmds |
| 273 | = NT35597_WQXGA_DSC_CMD_ON_COMMAND; |
| 274 | pinfo->mipi.panel_off_cmds |
| 275 | = nt35597_wqxga_dsc_cmd_off_command; |
| 276 | pinfo->mipi.num_of_panel_off_cmds |
| 277 | = NT35597_WQXGA_DSC_CMD_OFF_COMMAND; |
| 278 | memcpy(phy_db->timing, |
| 279 | nt35597_wqxga_dsc_thulium_cmd_timings, |
| 280 | MAX_TIMING_CONFIG * sizeof(uint32_t)); |
| 281 | pinfo->mipi.tx_eot_append = true; |
| 282 | |
| 283 | pinfo->compression_mode = COMPRESSION_DSC; |
| 284 | memcpy(&panelstruct->dsc_paras, &nt35597_wqxga_dsc_cmd_paras, |
| 285 | sizeof(struct dsc_parameters)); |
| 286 | pinfo->dsc.parameter_calc = mdss_dsc_parameters_calc; |
| 287 | pinfo->dsc.dsc2buf = mdss_dsc_to_buf; |
| 288 | pinfo->dsc.dsi_dsc_config = mdss_dsc_dsi_config; |
| 289 | pinfo->dsc.mdp_dsc_config = mdss_dsc_mdp_config; |
| 290 | break; |
Dhaval Patel | b95039c | 2015-03-16 11:14:06 -0700 | [diff] [blame] | 291 | case JDI_QHD_DUALDSI_VIDEO_PANEL: |
| 292 | pan_type = PANEL_TYPE_DSI; |
| 293 | pinfo->lcd_reg_en = 1; |
Dhaval Patel | b95039c | 2015-03-16 11:14:06 -0700 | [diff] [blame] | 294 | panelstruct->paneldata = &jdi_qhd_dualdsi_video_panel_data; |
| 295 | |
| 296 | panelstruct->panelres = &jdi_qhd_dualdsi_video_panel_res; |
| 297 | panelstruct->color = &jdi_qhd_dualdsi_video_color; |
| 298 | panelstruct->videopanel = &jdi_qhd_dualdsi_video_video_panel; |
| 299 | panelstruct->commandpanel = &jdi_qhd_dualdsi_video_command_panel; |
| 300 | panelstruct->state = &jdi_qhd_dualdsi_video_state; |
| 301 | panelstruct->laneconfig = &jdi_qhd_dualdsi_video_lane_config; |
| 302 | panelstruct->paneltiminginfo |
| 303 | = &jdi_qhd_dualdsi_video_timing_info; |
| 304 | panelstruct->panelresetseq |
| 305 | = &jdi_qhd_dualdsi_video_reset_seq; |
| 306 | panelstruct->backlightinfo = &jdi_qhd_dualdsi_video_backlight; |
| 307 | pinfo->mipi.panel_on_cmds |
| 308 | = jdi_qhd_dualdsi_video_on_command; |
| 309 | pinfo->mipi.num_of_panel_on_cmds |
| 310 | = JDI_QHD_DUALDSI_VIDEO_ON_COMMAND; |
| 311 | pinfo->mipi.panel_off_cmds |
| 312 | = jdi_qhd_dualdsi_video_off_command; |
| 313 | pinfo->mipi.num_of_panel_off_cmds |
| 314 | = JDI_QHD_DUALDSI_VIDEO_OFF_COMMAND; |
| 315 | memcpy(phy_db->timing, |
| 316 | jdi_qhd_dualdsi_thulium_cmd_timings, |
| 317 | MAX_TIMING_CONFIG * sizeof(uint32_t)); |
| 318 | break; |
| 319 | case JDI_QHD_DUALDSI_CMD_PANEL: |
| 320 | pan_type = PANEL_TYPE_DSI; |
| 321 | pinfo->lcd_reg_en = 1; |
| 322 | panelstruct->paneldata = &jdi_qhd_dualdsi_cmd_panel_data; |
Dhaval Patel | b95039c | 2015-03-16 11:14:06 -0700 | [diff] [blame] | 323 | |
| 324 | panelstruct->panelres = &jdi_qhd_dualdsi_cmd_panel_res; |
| 325 | panelstruct->color = &jdi_qhd_dualdsi_cmd_color; |
| 326 | panelstruct->videopanel = &jdi_qhd_dualdsi_cmd_video_panel; |
| 327 | panelstruct->commandpanel = &jdi_qhd_dualdsi_cmd_command_panel; |
| 328 | panelstruct->state = &jdi_qhd_dualdsi_cmd_state; |
| 329 | panelstruct->laneconfig = &jdi_qhd_dualdsi_cmd_lane_config; |
| 330 | panelstruct->paneltiminginfo |
| 331 | = &jdi_qhd_dualdsi_cmd_timing_info; |
| 332 | panelstruct->panelresetseq |
| 333 | = &jdi_qhd_dualdsi_cmd_reset_seq; |
| 334 | panelstruct->backlightinfo = &jdi_qhd_dualdsi_cmd_backlight; |
| 335 | pinfo->mipi.panel_on_cmds |
| 336 | = jdi_qhd_dualdsi_cmd_on_command; |
| 337 | pinfo->mipi.num_of_panel_on_cmds |
| 338 | = JDI_QHD_DUALDSI_CMD_ON_COMMAND; |
| 339 | pinfo->mipi.panel_off_cmds |
| 340 | = jdi_qhd_dualdsi_cmd_off_command; |
| 341 | pinfo->mipi.num_of_panel_off_cmds |
| 342 | = JDI_QHD_DUALDSI_CMD_OFF_COMMAND; |
| 343 | memcpy(phy_db->timing, |
| 344 | jdi_qhd_dualdsi_thulium_video_timings, |
| 345 | MAX_TIMING_CONFIG * sizeof(uint32_t)); |
| 346 | break; |
feifanz | 76fe648 | 2015-09-02 15:25:16 +0800 | [diff] [blame^] | 347 | case R69007_WQXGA_CMD_PANEL: |
| 348 | pan_type = PANEL_TYPE_DSI; |
| 349 | pinfo->lcd_reg_en = 0; |
| 350 | panelstruct->paneldata = &r69007_wqxga_cmd_panel_data; |
| 351 | panelstruct->panelres = &r69007_wqxga_cmd_panel_res; |
| 352 | panelstruct->color = &r69007_wqxga_cmd_color; |
| 353 | panelstruct->videopanel = &r69007_wqxga_cmd_video_panel; |
| 354 | panelstruct->commandpanel = &r69007_wqxga_cmd_command_panel; |
| 355 | panelstruct->state = &r69007_wqxga_cmd_state; |
| 356 | panelstruct->laneconfig = &r69007_wqxga_cmd_lane_config; |
| 357 | panelstruct->paneltiminginfo |
| 358 | = &r69007_wqxga_cmd_timing_info; |
| 359 | panelstruct->panelresetseq |
| 360 | = &r69007_wqxga_cmd_reset_seq; |
| 361 | panelstruct->backlightinfo = &r69007_wqxga_cmd_backlight; |
| 362 | |
| 363 | pinfo->labibb = &r69007_wqxga_cmd_labibb; |
| 364 | |
| 365 | pinfo->mipi.panel_on_cmds |
| 366 | = r69007_wqxga_cmd_on_command; |
| 367 | pinfo->mipi.num_of_panel_on_cmds |
| 368 | = R69007_WQXGA_CMD_ON_COMMAND; |
| 369 | pinfo->mipi.panel_off_cmds |
| 370 | = r69007_wqxga_cmd_off_command; |
| 371 | pinfo->mipi.num_of_panel_off_cmds |
| 372 | = R69007_WQXGA_CMD_OFF_COMMAND; |
| 373 | memcpy(phy_db->timing, |
| 374 | r69007_wqxga_thulium_cmd_timings, |
| 375 | MAX_TIMING_CONFIG * sizeof(uint32_t)); |
| 376 | break; |
Dhaval Patel | b95039c | 2015-03-16 11:14:06 -0700 | [diff] [blame] | 377 | default: |
| 378 | case UNKNOWN_PANEL: |
| 379 | pan_type = PANEL_TYPE_UNKNOWN; |
| 380 | break; |
| 381 | } |
| 382 | return pan_type; |
| 383 | } |
| 384 | |
| 385 | int oem_panel_select(const char *panel_name, struct panel_struct *panelstruct, |
| 386 | struct msm_panel_info *pinfo, |
| 387 | struct mdss_dsi_phy_ctrl *phy_db) |
| 388 | { |
| 389 | uint32_t hw_id = board_hardware_id(); |
| 390 | int32_t panel_override_id; |
| 391 | |
| 392 | phy_db->pll_type = DSI_PLL_TYPE_THULIUM; |
| 393 | |
| 394 | if (panel_name) { |
| 395 | panel_override_id = panel_name_to_id(supp_panels, |
| 396 | ARRAY_SIZE(supp_panels), panel_name); |
| 397 | |
| 398 | if (panel_override_id < 0) { |
| 399 | dprintf(CRITICAL, "Not able to search the panel:%s\n", |
Padmanabhan Komanduru | bccbcdc | 2015-06-30 16:19:24 +0530 | [diff] [blame] | 400 | panel_name); |
Dhaval Patel | b95039c | 2015-03-16 11:14:06 -0700 | [diff] [blame] | 401 | } else if (panel_override_id < UNKNOWN_PANEL) { |
| 402 | /* panel override using fastboot oem command */ |
| 403 | panel_id = panel_override_id; |
| 404 | |
| 405 | dprintf(INFO, "OEM panel override:%s\n", |
Padmanabhan Komanduru | bccbcdc | 2015-06-30 16:19:24 +0530 | [diff] [blame] | 406 | panel_name); |
Dhaval Patel | b95039c | 2015-03-16 11:14:06 -0700 | [diff] [blame] | 407 | goto panel_init; |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | switch (hw_id) { |
| 412 | case HW_PLATFORM_MTP: |
| 413 | case HW_PLATFORM_FLUID: |
| 414 | case HW_PLATFORM_SURF: |
| 415 | panel_id = SHARP_WQXGA_DUALDSI_VIDEO_PANEL; |
| 416 | break; |
feifanz | 76fe648 | 2015-09-02 15:25:16 +0800 | [diff] [blame^] | 417 | case HW_PLATFORM_QRD: |
| 418 | panel_id = R69007_WQXGA_CMD_PANEL; |
| 419 | break; |
Dhaval Patel | b95039c | 2015-03-16 11:14:06 -0700 | [diff] [blame] | 420 | default: |
| 421 | dprintf(CRITICAL, "Display not enabled for %d HW type\n" |
| 422 | , hw_id); |
| 423 | return PANEL_TYPE_UNKNOWN; |
| 424 | } |
| 425 | |
| 426 | panel_init: |
| 427 | return init_panel_data(panelstruct, pinfo, phy_db); |
| 428 | } |