Sandeep Panda | 9d9079f | 2014-11-24 18:46:25 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [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 | #include <debug.h> |
| 31 | #include <err.h> |
| 32 | #include <smem.h> |
| 33 | #include <msm_panel.h> |
| 34 | #include <board.h> |
| 35 | #include <mipi_dsi.h> |
| 36 | #include <target/display.h> |
| 37 | #include "include/panel.h" |
| 38 | #include "panel_display.h" |
| 39 | |
| 40 | #include "include/panel_hx8394d_720p_video.h" |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 41 | #include "include/panel_hx8379a_fwvga_skua_video.h" |
Shivaraj Shetty | f9daa72 | 2014-11-17 17:29:49 +0530 | [diff] [blame] | 42 | #include "include/panel_sharp_qhd_video.h" |
Sandeep Panda | 9d9079f | 2014-11-24 18:46:25 +0530 | [diff] [blame] | 43 | #include "include/panel_truly_wvga_cmd.h" |
Ray Zhang | afc8666 | 2014-11-07 11:23:57 +0800 | [diff] [blame] | 44 | #include "include/panel_ili9806e_fwvga_video.h" |
Ray Zhang | 6da38ca | 2014-11-18 16:02:11 +0800 | [diff] [blame] | 45 | #include "include/panel_hx8379c_fwvga_video.h" |
Shivaraj Shetty | cecaa0f | 2014-11-21 14:51:38 +0530 | [diff] [blame^] | 46 | #include "include/panel_hx8394d_qhd_video.h" |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 47 | |
| 48 | #define DISPLAY_MAX_PANEL_DETECTION 0 |
| 49 | |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 50 | enum { |
| 51 | QRD_SKUA = 0x00, |
| 52 | QRD_SKUC = 0x08, |
| 53 | QRD_SKUE = 0x09, |
| 54 | }; |
| 55 | |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 56 | /*---------------------------------------------------------------------------*/ |
| 57 | /* static panel selection variable */ |
| 58 | /*---------------------------------------------------------------------------*/ |
| 59 | static uint32_t auto_pan_loop = 0; |
| 60 | |
| 61 | enum { |
| 62 | HX8394D_720P_VIDEO_PANEL, |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 63 | HX8379A_FWVGA_SKUA_VIDEO_PANEL, |
Shivaraj Shetty | f9daa72 | 2014-11-17 17:29:49 +0530 | [diff] [blame] | 64 | SHARP_QHD_VIDEO_PANEL, |
Sandeep Panda | 9d9079f | 2014-11-24 18:46:25 +0530 | [diff] [blame] | 65 | TRULY_WVGA_CMD_PANEL, |
Ray Zhang | afc8666 | 2014-11-07 11:23:57 +0800 | [diff] [blame] | 66 | ILI9806E_FWVGA_VIDEO_PANEL, |
Ray Zhang | 6da38ca | 2014-11-18 16:02:11 +0800 | [diff] [blame] | 67 | HX8379C_FWVGA_VIDEO_PANEL, |
Shivaraj Shetty | cecaa0f | 2014-11-21 14:51:38 +0530 | [diff] [blame^] | 68 | HX8394D_QHD_VIDEO_PANEL, |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 69 | UNKNOWN_PANEL |
| 70 | }; |
| 71 | |
| 72 | /* |
| 73 | * The list of panels that are supported on this target. |
| 74 | * Any panel in this list can be selected using fastboot oem command. |
| 75 | */ |
| 76 | static struct panel_list supp_panels[] = { |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 77 | {"hx8394d_720p_video", HX8394D_720P_VIDEO_PANEL}, |
| 78 | {"hx8379a_fwvga_skua_video", HX8379A_FWVGA_SKUA_VIDEO_PANEL}, |
Ray Zhang | afc8666 | 2014-11-07 11:23:57 +0800 | [diff] [blame] | 79 | {"sharp_qhd_video", SHARP_QHD_VIDEO_PANEL}, |
Sandeep Panda | 9d9079f | 2014-11-24 18:46:25 +0530 | [diff] [blame] | 80 | {"truly_wvga_cmd", TRULY_WVGA_CMD_PANEL}, |
Ray Zhang | afc8666 | 2014-11-07 11:23:57 +0800 | [diff] [blame] | 81 | {"ili9806e_fwvga_video",ILI9806E_FWVGA_VIDEO_PANEL}, |
Ray Zhang | 6da38ca | 2014-11-18 16:02:11 +0800 | [diff] [blame] | 82 | {"hx8379c_fwvga_video",HX8379C_FWVGA_VIDEO_PANEL}, |
Shivaraj Shetty | cecaa0f | 2014-11-21 14:51:38 +0530 | [diff] [blame^] | 83 | {"hx8394d_qhd_video", HX8394D_QHD_VIDEO_PANEL} |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 84 | }; |
| 85 | |
| 86 | static uint32_t panel_id; |
| 87 | |
| 88 | int oem_panel_rotation() |
| 89 | { |
| 90 | return NO_ERROR; |
| 91 | } |
| 92 | |
| 93 | int oem_panel_on() |
| 94 | { |
| 95 | /* |
| 96 | * OEM can keep there panel specific on instructions in this |
| 97 | * function |
| 98 | */ |
| 99 | return NO_ERROR; |
| 100 | } |
| 101 | |
| 102 | int oem_panel_off() |
| 103 | { |
| 104 | /* |
| 105 | * OEM can keep their panel specific off instructions |
| 106 | * in this function |
| 107 | */ |
| 108 | return NO_ERROR; |
| 109 | } |
| 110 | |
| 111 | static int init_panel_data(struct panel_struct *panelstruct, |
| 112 | struct msm_panel_info *pinfo, |
| 113 | struct mdss_dsi_phy_ctrl *phy_db) |
| 114 | { |
| 115 | int pan_type = PANEL_TYPE_DSI; |
| 116 | |
| 117 | switch (panel_id) { |
| 118 | case HX8394D_720P_VIDEO_PANEL: |
| 119 | panelstruct->paneldata = &hx8394d_720p_video_panel_data; |
| 120 | panelstruct->panelres = &hx8394d_720p_video_panel_res; |
| 121 | panelstruct->color = &hx8394d_720p_video_color; |
| 122 | panelstruct->videopanel = &hx8394d_720p_video_video_panel; |
| 123 | panelstruct->commandpanel = &hx8394d_720p_video_command_panel; |
| 124 | panelstruct->state = &hx8394d_720p_video_state; |
| 125 | panelstruct->laneconfig = &hx8394d_720p_video_lane_config; |
| 126 | panelstruct->paneltiminginfo |
| 127 | = &hx8394d_720p_video_timing_info; |
| 128 | panelstruct->panelresetseq |
| 129 | = &hx8394d_720p_video_panel_reset_seq; |
| 130 | panelstruct->backlightinfo = &hx8394d_720p_video_backlight; |
Padmanabhan Komanduru | b3d3184 | 2014-11-04 15:47:53 +0530 | [diff] [blame] | 131 | pinfo->mipi.panel_on_cmds |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 132 | = hx8394d_720p_video_on_command; |
Padmanabhan Komanduru | b3d3184 | 2014-11-04 15:47:53 +0530 | [diff] [blame] | 133 | pinfo->mipi.num_of_panel_on_cmds |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 134 | = HX8394D_720P_VIDEO_ON_COMMAND; |
Padmanabhan Komanduru | b3d3184 | 2014-11-04 15:47:53 +0530 | [diff] [blame] | 135 | pinfo->mipi.panel_off_cmds |
| 136 | = hx8394d_720p_video_off_command; |
| 137 | pinfo->mipi.num_of_panel_off_cmds |
| 138 | = HX8394D_720P_VIDEO_OFF_COMMAND; |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 139 | memcpy(phy_db->timing, |
| 140 | hx8394d_720p_video_timings, TIMING_SIZE); |
| 141 | pinfo->mipi.signature = HX8394D_720P_VIDEO_SIGNATURE; |
| 142 | break; |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 143 | case HX8379A_FWVGA_SKUA_VIDEO_PANEL: |
| 144 | panelstruct->paneldata = &hx8379a_fwvga_skua_video_panel_data; |
| 145 | panelstruct->panelres = &hx8379a_fwvga_skua_video_panel_res; |
| 146 | panelstruct->color = &hx8379a_fwvga_skua_video_color; |
| 147 | panelstruct->videopanel = &hx8379a_fwvga_skua_video_video_panel; |
| 148 | panelstruct->commandpanel = &hx8379a_fwvga_skua_video_command_panel; |
| 149 | panelstruct->state = &hx8379a_fwvga_skua_video_state; |
| 150 | panelstruct->laneconfig = &hx8379a_fwvga_skua_video_lane_config; |
| 151 | panelstruct->paneltiminginfo |
| 152 | = &hx8379a_fwvga_skua_video_timing_info; |
| 153 | panelstruct->panelresetseq |
| 154 | = &hx8379a_fwvga_skua_video_reset_seq; |
| 155 | panelstruct->backlightinfo = &hx8379a_fwvga_skua_video_backlight; |
Ray Zhang | 790af75 | 2014-11-14 18:39:10 +0800 | [diff] [blame] | 156 | pinfo->mipi.panel_on_cmds |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 157 | = hx8379a_fwvga_skua_video_on_command; |
Ray Zhang | 790af75 | 2014-11-14 18:39:10 +0800 | [diff] [blame] | 158 | pinfo->mipi.num_of_panel_on_cmds |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 159 | = HX8379A_FWVGA_SKUA_VIDEO_ON_COMMAND; |
Ray Zhang | 790af75 | 2014-11-14 18:39:10 +0800 | [diff] [blame] | 160 | pinfo->mipi.panel_off_cmds |
| 161 | = hx8379a_fwvga_skua_video_off_command; |
| 162 | pinfo->mipi.num_of_panel_off_cmds |
| 163 | = HX8379A_FWVGA_SKUA_VIDEO_OFF_COMMAND; |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 164 | memcpy(phy_db->timing, |
| 165 | hx8379a_fwvga_skua_video_timings, TIMING_SIZE); |
| 166 | pinfo->mipi.signature = HX8379A_FWVGA_SKUA_VIDEO_SIGNATURE; |
| 167 | break; |
Shivaraj Shetty | f9daa72 | 2014-11-17 17:29:49 +0530 | [diff] [blame] | 168 | case SHARP_QHD_VIDEO_PANEL: |
| 169 | panelstruct->paneldata = &sharp_qhd_video_panel_data; |
| 170 | panelstruct->panelres = &sharp_qhd_video_panel_res; |
| 171 | panelstruct->color = &sharp_qhd_video_color; |
| 172 | panelstruct->videopanel = &sharp_qhd_video_video_panel; |
| 173 | panelstruct->commandpanel = &sharp_qhd_video_command_panel; |
| 174 | panelstruct->state = &sharp_qhd_video_state; |
| 175 | panelstruct->laneconfig = &sharp_qhd_video_lane_config; |
| 176 | panelstruct->paneltiminginfo |
| 177 | = &sharp_qhd_video_timing_info; |
| 178 | panelstruct->panelresetseq |
| 179 | = &sharp_qhd_video_panel_reset_seq; |
| 180 | panelstruct->backlightinfo = &sharp_qhd_video_backlight; |
| 181 | pinfo->mipi.panel_on_cmds |
| 182 | = sharp_qhd_video_on_command; |
| 183 | pinfo->mipi.num_of_panel_on_cmds |
| 184 | = SHARP_QHD_VIDEO_ON_COMMAND; |
| 185 | pinfo->mipi.panel_off_cmds |
| 186 | = sharp_qhd_video_off_command; |
| 187 | pinfo->mipi.num_of_panel_off_cmds |
| 188 | = SHARP_QHD_VIDEO_OFF_COMMAND; |
| 189 | memcpy(phy_db->timing, sharp_qhd_video_timings, TIMING_SIZE); |
| 190 | break; |
Sandeep Panda | 9d9079f | 2014-11-24 18:46:25 +0530 | [diff] [blame] | 191 | case TRULY_WVGA_CMD_PANEL: |
| 192 | panelstruct->paneldata = &truly_wvga_cmd_panel_data; |
| 193 | panelstruct->panelres = &truly_wvga_cmd_panel_res; |
| 194 | panelstruct->color = &truly_wvga_cmd_color; |
| 195 | panelstruct->videopanel = &truly_wvga_cmd_video_panel; |
| 196 | panelstruct->commandpanel = &truly_wvga_cmd_command_panel; |
| 197 | panelstruct->state = &truly_wvga_cmd_state; |
| 198 | panelstruct->laneconfig = &truly_wvga_cmd_lane_config; |
| 199 | panelstruct->paneltiminginfo |
| 200 | = &truly_wvga_cmd_timing_info; |
| 201 | panelstruct->panelresetseq |
| 202 | = &truly_wvga_cmd_reset_seq; |
| 203 | panelstruct->backlightinfo = &truly_wvga_cmd_backlight; |
| 204 | pinfo->mipi.panel_cmds |
| 205 | = truly_wvga_cmd_on_command; |
| 206 | pinfo->mipi.num_of_panel_cmds |
| 207 | = TRULY_WVGA_CMD_ON_COMMAND; |
| 208 | memcpy(phy_db->timing, |
| 209 | truly_wvga_cmd_timings, TIMING_SIZE); |
| 210 | break; |
Ray Zhang | afc8666 | 2014-11-07 11:23:57 +0800 | [diff] [blame] | 211 | case ILI9806E_FWVGA_VIDEO_PANEL: |
| 212 | panelstruct->paneldata = &ili9806e_fwvga_video_panel_data; |
| 213 | panelstruct->panelres = &ili9806e_fwvga_video_panel_res; |
| 214 | panelstruct->color = &ili9806e_fwvga_video_color; |
| 215 | panelstruct->videopanel = &ili9806e_fwvga_video_video_panel; |
| 216 | panelstruct->commandpanel = &ili9806e_fwvga_video_command_panel; |
| 217 | panelstruct->state = &ili9806e_fwvga_video_state; |
| 218 | panelstruct->laneconfig = &ili9806e_fwvga_video_lane_config; |
| 219 | panelstruct->paneltiminginfo |
| 220 | = &ili9806e_fwvga_video_timing_info; |
| 221 | panelstruct->panelresetseq |
| 222 | = &ili9806e_fwvga_video_reset_seq; |
| 223 | panelstruct->backlightinfo = &ili9806e_fwvga_video_backlight; |
| 224 | pinfo->mipi.panel_on_cmds |
| 225 | = ili9806e_fwvga_video_on_command; |
| 226 | pinfo->mipi.num_of_panel_on_cmds |
| 227 | = ILI9806E_FWVGA_VIDEO_ON_COMMAND; |
| 228 | pinfo->mipi.panel_off_cmds |
| 229 | = ili9806e_fwvga_video_off_command; |
| 230 | pinfo->mipi.num_of_panel_off_cmds |
| 231 | = ILI9806E_FWVGA_VIDEO_OFF_COMMAND; |
| 232 | memcpy(phy_db->timing, |
| 233 | ili9806e_fwvga_video_timings, TIMING_SIZE); |
| 234 | pinfo->mipi.signature = ILI9806E_FWVGA_VIDEO_SIGNATURE; |
| 235 | break; |
Ray Zhang | 6da38ca | 2014-11-18 16:02:11 +0800 | [diff] [blame] | 236 | case HX8379C_FWVGA_VIDEO_PANEL: |
| 237 | panelstruct->paneldata = &hx8379c_fwvga_video_panel_data; |
| 238 | panelstruct->panelres = &hx8379c_fwvga_video_panel_res; |
| 239 | panelstruct->color = &hx8379c_fwvga_video_color; |
| 240 | panelstruct->videopanel = &hx8379c_fwvga_video_video_panel; |
| 241 | panelstruct->commandpanel = &hx8379c_fwvga_video_command_panel; |
| 242 | panelstruct->state = &hx8379c_fwvga_video_state; |
| 243 | panelstruct->laneconfig = &hx8379c_fwvga_video_lane_config; |
| 244 | panelstruct->paneltiminginfo |
| 245 | = &hx8379c_fwvga_video_timing_info; |
| 246 | panelstruct->panelresetseq |
| 247 | = &hx8379c_fwvga_video_reset_seq; |
| 248 | panelstruct->backlightinfo = &hx8379c_fwvga_video_backlight; |
| 249 | pinfo->mipi.panel_on_cmds |
| 250 | = hx8379c_fwvga_video_on_command; |
| 251 | pinfo->mipi.num_of_panel_on_cmds |
| 252 | = HX8379C_FWVGA_VIDEO_ON_COMMAND; |
| 253 | pinfo->mipi.panel_off_cmds |
| 254 | = hx8379c_fwvga_video_off_command; |
| 255 | pinfo->mipi.num_of_panel_off_cmds |
| 256 | = HX8379C_FWVGA_VIDEO_OFF_COMMAND; |
| 257 | memcpy(phy_db->timing, |
| 258 | hx8379c_fwvga_video_timings, TIMING_SIZE); |
| 259 | pinfo->mipi.signature = HX8379C_FWVGA_VIDEO_SIGNATURE; |
| 260 | break; |
Shivaraj Shetty | cecaa0f | 2014-11-21 14:51:38 +0530 | [diff] [blame^] | 261 | case HX8394D_QHD_VIDEO_PANEL: |
| 262 | panelstruct->paneldata = &hx8394d_qhd_video_panel_data; |
| 263 | panelstruct->panelres = &hx8394d_qhd_video_panel_res; |
| 264 | panelstruct->color = &hx8394d_qhd_video_color; |
| 265 | panelstruct->videopanel = &hx8394d_qhd_video_video_panel; |
| 266 | panelstruct->commandpanel = &hx8394d_qhd_video_command_panel; |
| 267 | panelstruct->state = &hx8394d_qhd_video_state; |
| 268 | panelstruct->laneconfig = &hx8394d_qhd_video_lane_config; |
| 269 | panelstruct->paneltiminginfo |
| 270 | = &hx8394d_qhd_video_timing_info; |
| 271 | panelstruct->panelresetseq |
| 272 | = &hx8394d_qhd_video_panel_reset_seq; |
| 273 | panelstruct->backlightinfo = &hx8394d_qhd_video_backlight; |
| 274 | pinfo->mipi.panel_cmds |
| 275 | = hx8394d_qhd_video_on_command; |
| 276 | pinfo->mipi.num_of_panel_cmds |
| 277 | = HX8394D_QHD_VIDEO_ON_COMMAND; |
| 278 | memcpy(phy_db->timing, |
| 279 | hx8394d_qhd_video_timings, TIMING_SIZE); |
| 280 | pinfo->mipi.signature = HX8394D_QHD_VIDEO_SIGNATURE; |
| 281 | break; |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 282 | case UNKNOWN_PANEL: |
| 283 | default: |
| 284 | memset(panelstruct, 0, sizeof(struct panel_struct)); |
Padmanabhan Komanduru | b3d3184 | 2014-11-04 15:47:53 +0530 | [diff] [blame] | 285 | memset(pinfo->mipi.panel_on_cmds, 0, |
| 286 | sizeof(struct mipi_dsi_cmd)); |
| 287 | pinfo->mipi.num_of_panel_on_cmds = 0; |
| 288 | memset(pinfo->mipi.panel_off_cmds, 0, |
| 289 | sizeof(struct mipi_dsi_cmd)); |
| 290 | pinfo->mipi.num_of_panel_off_cmds = 0; |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 291 | memset(phy_db->timing, 0, TIMING_SIZE); |
| 292 | pan_type = PANEL_TYPE_UNKNOWN; |
| 293 | break; |
| 294 | } |
| 295 | return pan_type; |
| 296 | } |
| 297 | |
| 298 | uint32_t oem_panel_max_auto_detect_panels() |
| 299 | { |
| 300 | return target_panel_auto_detect_enabled() ? |
| 301 | DISPLAY_MAX_PANEL_DETECTION : 0; |
| 302 | } |
| 303 | |
| 304 | int oem_panel_select(const char *panel_name, struct panel_struct *panelstruct, |
| 305 | struct msm_panel_info *pinfo, |
| 306 | struct mdss_dsi_phy_ctrl *phy_db) |
| 307 | { |
| 308 | uint32_t hw_id = board_hardware_id(); |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 309 | uint32_t platform_subtype = board_hardware_subtype(); |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 310 | int32_t panel_override_id; |
| 311 | |
| 312 | if (panel_name) { |
| 313 | panel_override_id = panel_name_to_id(supp_panels, |
| 314 | ARRAY_SIZE(supp_panels), panel_name); |
| 315 | |
| 316 | if (panel_override_id < 0) { |
| 317 | dprintf(CRITICAL, "Not able to search the panel:%s\n", |
| 318 | panel_name + strspn(panel_name, " ")); |
| 319 | } else if (panel_override_id < UNKNOWN_PANEL) { |
| 320 | /* panel override using fastboot oem command */ |
| 321 | panel_id = panel_override_id; |
| 322 | |
| 323 | dprintf(INFO, "OEM panel override:%s\n", |
| 324 | panel_name + strspn(panel_name, " ")); |
| 325 | goto panel_init; |
| 326 | } |
| 327 | } |
| 328 | switch (hw_id) { |
| 329 | case HW_PLATFORM_SURF: |
Shivaraj Shetty | af4c607 | 2014-11-04 16:25:31 +0530 | [diff] [blame] | 330 | case HW_PLATFORM_MTP: |
Sandeep Panda | 8ede650 | 2014-12-02 10:56:16 +0530 | [diff] [blame] | 331 | case HW_PLATFORM_RCM: |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 332 | panel_id = HX8394D_720P_VIDEO_PANEL; |
| 333 | break; |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 334 | case HW_PLATFORM_QRD: |
| 335 | switch (platform_subtype) { |
| 336 | case QRD_SKUA: |
| 337 | panel_id = HX8379A_FWVGA_SKUA_VIDEO_PANEL; |
| 338 | break; |
| 339 | case QRD_SKUC: |
Ray Zhang | afc8666 | 2014-11-07 11:23:57 +0800 | [diff] [blame] | 340 | panel_id = ILI9806E_FWVGA_VIDEO_PANEL; |
| 341 | break; |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 342 | case QRD_SKUE: |
Ray Zhang | 6da38ca | 2014-11-18 16:02:11 +0800 | [diff] [blame] | 343 | panel_id = HX8379C_FWVGA_VIDEO_PANEL; |
| 344 | break; |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 345 | default: |
| 346 | dprintf(CRITICAL, "QRD Display not enabled for %d type\n", |
| 347 | platform_subtype); |
| 348 | return PANEL_TYPE_UNKNOWN; |
| 349 | } |
| 350 | break; |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 351 | default: |
| 352 | dprintf(CRITICAL, "Display not enabled for %d HW type\n", |
| 353 | hw_id); |
| 354 | return PANEL_TYPE_UNKNOWN; |
| 355 | } |
| 356 | |
| 357 | panel_init: |
Shivaraj Shetty | af4c607 | 2014-11-04 16:25:31 +0530 | [diff] [blame] | 358 | phy_db->regulator_mode = DSI_PHY_REGULATOR_LDO_MODE; |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 359 | return init_panel_data(panelstruct, pinfo, phy_db); |
| 360 | } |