Sachin Bhayare | 3068e6e | 2017-02-15 15:05:44 +0530 | [diff] [blame^] | 1 | /* Copyright (c) 2014-2015, 2017, 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" |
Yang | e194df9 | 2015-06-09 15:41:01 +0800 | [diff] [blame] | 47 | #include "include/panel_fl10802_fwvga_video.h" |
Sachin Bhayare | 3068e6e | 2017-02-15 15:05:44 +0530 | [diff] [blame^] | 48 | #include "include/panel_auo_qvga_cmd.h" |
| 49 | #include "include/panel_auo_cx_qvga_cmd.h" |
| 50 | #include "include/panel_auo_400p_cmd.h" |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 51 | |
| 52 | #define DISPLAY_MAX_PANEL_DETECTION 0 |
Sandeep Panda | 419bfbb | 2015-01-09 19:29:20 +0530 | [diff] [blame] | 53 | #define ILI9806E_FWVGA_VIDEO_PANEL_POST_INIT_DELAY 68 |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 54 | |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 55 | enum { |
| 56 | QRD_SKUA = 0x00, |
| 57 | QRD_SKUC = 0x08, |
| 58 | QRD_SKUE = 0x09, |
Yang | e194df9 | 2015-06-09 15:41:01 +0800 | [diff] [blame] | 59 | QRD_SKUT = 0x0A, |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 60 | }; |
| 61 | |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 62 | /*---------------------------------------------------------------------------*/ |
| 63 | /* static panel selection variable */ |
| 64 | /*---------------------------------------------------------------------------*/ |
| 65 | static uint32_t auto_pan_loop = 0; |
| 66 | |
| 67 | enum { |
| 68 | HX8394D_720P_VIDEO_PANEL, |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 69 | HX8379A_FWVGA_SKUA_VIDEO_PANEL, |
Shivaraj Shetty | f9daa72 | 2014-11-17 17:29:49 +0530 | [diff] [blame] | 70 | SHARP_QHD_VIDEO_PANEL, |
Sandeep Panda | 9d9079f | 2014-11-24 18:46:25 +0530 | [diff] [blame] | 71 | TRULY_WVGA_CMD_PANEL, |
Ray Zhang | afc8666 | 2014-11-07 11:23:57 +0800 | [diff] [blame] | 72 | ILI9806E_FWVGA_VIDEO_PANEL, |
Ray Zhang | 6da38ca | 2014-11-18 16:02:11 +0800 | [diff] [blame] | 73 | HX8379C_FWVGA_VIDEO_PANEL, |
Shivaraj Shetty | cecaa0f | 2014-11-21 14:51:38 +0530 | [diff] [blame] | 74 | HX8394D_QHD_VIDEO_PANEL, |
Yang | e194df9 | 2015-06-09 15:41:01 +0800 | [diff] [blame] | 75 | FL10802_FWVGA_VIDEO_PANEL, |
Sachin Bhayare | 3068e6e | 2017-02-15 15:05:44 +0530 | [diff] [blame^] | 76 | AUO_QVGA_CMD_PANEL, |
| 77 | AUO_CX_QVGA_CMD_PANEL, |
| 78 | AUO_400P_CMD_PANEL, |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 79 | UNKNOWN_PANEL |
| 80 | }; |
| 81 | |
| 82 | /* |
| 83 | * The list of panels that are supported on this target. |
| 84 | * Any panel in this list can be selected using fastboot oem command. |
| 85 | */ |
| 86 | static struct panel_list supp_panels[] = { |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 87 | {"hx8394d_720p_video", HX8394D_720P_VIDEO_PANEL}, |
| 88 | {"hx8379a_fwvga_skua_video", HX8379A_FWVGA_SKUA_VIDEO_PANEL}, |
Ray Zhang | afc8666 | 2014-11-07 11:23:57 +0800 | [diff] [blame] | 89 | {"sharp_qhd_video", SHARP_QHD_VIDEO_PANEL}, |
Sandeep Panda | 9d9079f | 2014-11-24 18:46:25 +0530 | [diff] [blame] | 90 | {"truly_wvga_cmd", TRULY_WVGA_CMD_PANEL}, |
Ray Zhang | afc8666 | 2014-11-07 11:23:57 +0800 | [diff] [blame] | 91 | {"ili9806e_fwvga_video",ILI9806E_FWVGA_VIDEO_PANEL}, |
Ray Zhang | 6da38ca | 2014-11-18 16:02:11 +0800 | [diff] [blame] | 92 | {"hx8379c_fwvga_video",HX8379C_FWVGA_VIDEO_PANEL}, |
Yang | e194df9 | 2015-06-09 15:41:01 +0800 | [diff] [blame] | 93 | {"hx8394d_qhd_video", HX8394D_QHD_VIDEO_PANEL}, |
Sachin Bhayare | 3068e6e | 2017-02-15 15:05:44 +0530 | [diff] [blame^] | 94 | {"fl10802_fwvga_video", FL10802_FWVGA_VIDEO_PANEL}, |
| 95 | {"auo_qvga_cmd", AUO_QVGA_CMD_PANEL}, |
| 96 | {"auo_cx_qvga_cmd", AUO_CX_QVGA_CMD_PANEL}, |
| 97 | {"auo_400p_cmd", AUO_400P_CMD_PANEL}, |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 98 | }; |
| 99 | |
| 100 | static uint32_t panel_id; |
| 101 | |
| 102 | int oem_panel_rotation() |
| 103 | { |
| 104 | return NO_ERROR; |
| 105 | } |
| 106 | |
| 107 | int oem_panel_on() |
| 108 | { |
| 109 | /* |
| 110 | * OEM can keep there panel specific on instructions in this |
| 111 | * function |
| 112 | */ |
Sandeep Panda | 419bfbb | 2015-01-09 19:29:20 +0530 | [diff] [blame] | 113 | if (panel_id == ILI9806E_FWVGA_VIDEO_PANEL) |
| 114 | mdelay(ILI9806E_FWVGA_VIDEO_PANEL_POST_INIT_DELAY); |
| 115 | |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 116 | return NO_ERROR; |
| 117 | } |
| 118 | |
| 119 | int oem_panel_off() |
| 120 | { |
| 121 | /* |
| 122 | * OEM can keep their panel specific off instructions |
| 123 | * in this function |
| 124 | */ |
| 125 | return NO_ERROR; |
| 126 | } |
| 127 | |
| 128 | static int init_panel_data(struct panel_struct *panelstruct, |
| 129 | struct msm_panel_info *pinfo, |
| 130 | struct mdss_dsi_phy_ctrl *phy_db) |
| 131 | { |
| 132 | int pan_type = PANEL_TYPE_DSI; |
| 133 | |
| 134 | switch (panel_id) { |
| 135 | case HX8394D_720P_VIDEO_PANEL: |
| 136 | panelstruct->paneldata = &hx8394d_720p_video_panel_data; |
| 137 | panelstruct->panelres = &hx8394d_720p_video_panel_res; |
| 138 | panelstruct->color = &hx8394d_720p_video_color; |
| 139 | panelstruct->videopanel = &hx8394d_720p_video_video_panel; |
| 140 | panelstruct->commandpanel = &hx8394d_720p_video_command_panel; |
| 141 | panelstruct->state = &hx8394d_720p_video_state; |
| 142 | panelstruct->laneconfig = &hx8394d_720p_video_lane_config; |
| 143 | panelstruct->paneltiminginfo |
| 144 | = &hx8394d_720p_video_timing_info; |
| 145 | panelstruct->panelresetseq |
| 146 | = &hx8394d_720p_video_panel_reset_seq; |
| 147 | panelstruct->backlightinfo = &hx8394d_720p_video_backlight; |
Padmanabhan Komanduru | b3d3184 | 2014-11-04 15:47:53 +0530 | [diff] [blame] | 148 | pinfo->mipi.panel_on_cmds |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 149 | = hx8394d_720p_video_on_command; |
Padmanabhan Komanduru | b3d3184 | 2014-11-04 15:47:53 +0530 | [diff] [blame] | 150 | pinfo->mipi.num_of_panel_on_cmds |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 151 | = HX8394D_720P_VIDEO_ON_COMMAND; |
Padmanabhan Komanduru | b3d3184 | 2014-11-04 15:47:53 +0530 | [diff] [blame] | 152 | pinfo->mipi.panel_off_cmds |
| 153 | = hx8394d_720p_video_off_command; |
| 154 | pinfo->mipi.num_of_panel_off_cmds |
| 155 | = HX8394D_720P_VIDEO_OFF_COMMAND; |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 156 | memcpy(phy_db->timing, |
| 157 | hx8394d_720p_video_timings, TIMING_SIZE); |
| 158 | pinfo->mipi.signature = HX8394D_720P_VIDEO_SIGNATURE; |
| 159 | break; |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 160 | case HX8379A_FWVGA_SKUA_VIDEO_PANEL: |
| 161 | panelstruct->paneldata = &hx8379a_fwvga_skua_video_panel_data; |
| 162 | panelstruct->panelres = &hx8379a_fwvga_skua_video_panel_res; |
| 163 | panelstruct->color = &hx8379a_fwvga_skua_video_color; |
| 164 | panelstruct->videopanel = &hx8379a_fwvga_skua_video_video_panel; |
| 165 | panelstruct->commandpanel = &hx8379a_fwvga_skua_video_command_panel; |
| 166 | panelstruct->state = &hx8379a_fwvga_skua_video_state; |
| 167 | panelstruct->laneconfig = &hx8379a_fwvga_skua_video_lane_config; |
| 168 | panelstruct->paneltiminginfo |
| 169 | = &hx8379a_fwvga_skua_video_timing_info; |
| 170 | panelstruct->panelresetseq |
| 171 | = &hx8379a_fwvga_skua_video_reset_seq; |
| 172 | panelstruct->backlightinfo = &hx8379a_fwvga_skua_video_backlight; |
Ray Zhang | 790af75 | 2014-11-14 18:39:10 +0800 | [diff] [blame] | 173 | pinfo->mipi.panel_on_cmds |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 174 | = hx8379a_fwvga_skua_video_on_command; |
Ray Zhang | 790af75 | 2014-11-14 18:39:10 +0800 | [diff] [blame] | 175 | pinfo->mipi.num_of_panel_on_cmds |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 176 | = HX8379A_FWVGA_SKUA_VIDEO_ON_COMMAND; |
Ray Zhang | 790af75 | 2014-11-14 18:39:10 +0800 | [diff] [blame] | 177 | pinfo->mipi.panel_off_cmds |
| 178 | = hx8379a_fwvga_skua_video_off_command; |
| 179 | pinfo->mipi.num_of_panel_off_cmds |
| 180 | = HX8379A_FWVGA_SKUA_VIDEO_OFF_COMMAND; |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 181 | memcpy(phy_db->timing, |
| 182 | hx8379a_fwvga_skua_video_timings, TIMING_SIZE); |
| 183 | pinfo->mipi.signature = HX8379A_FWVGA_SKUA_VIDEO_SIGNATURE; |
| 184 | break; |
Shivaraj Shetty | f9daa72 | 2014-11-17 17:29:49 +0530 | [diff] [blame] | 185 | case SHARP_QHD_VIDEO_PANEL: |
| 186 | panelstruct->paneldata = &sharp_qhd_video_panel_data; |
| 187 | panelstruct->panelres = &sharp_qhd_video_panel_res; |
| 188 | panelstruct->color = &sharp_qhd_video_color; |
| 189 | panelstruct->videopanel = &sharp_qhd_video_video_panel; |
| 190 | panelstruct->commandpanel = &sharp_qhd_video_command_panel; |
| 191 | panelstruct->state = &sharp_qhd_video_state; |
| 192 | panelstruct->laneconfig = &sharp_qhd_video_lane_config; |
| 193 | panelstruct->paneltiminginfo |
| 194 | = &sharp_qhd_video_timing_info; |
| 195 | panelstruct->panelresetseq |
| 196 | = &sharp_qhd_video_panel_reset_seq; |
| 197 | panelstruct->backlightinfo = &sharp_qhd_video_backlight; |
| 198 | pinfo->mipi.panel_on_cmds |
| 199 | = sharp_qhd_video_on_command; |
| 200 | pinfo->mipi.num_of_panel_on_cmds |
| 201 | = SHARP_QHD_VIDEO_ON_COMMAND; |
| 202 | pinfo->mipi.panel_off_cmds |
| 203 | = sharp_qhd_video_off_command; |
| 204 | pinfo->mipi.num_of_panel_off_cmds |
| 205 | = SHARP_QHD_VIDEO_OFF_COMMAND; |
| 206 | memcpy(phy_db->timing, sharp_qhd_video_timings, TIMING_SIZE); |
| 207 | break; |
Sandeep Panda | 9d9079f | 2014-11-24 18:46:25 +0530 | [diff] [blame] | 208 | case TRULY_WVGA_CMD_PANEL: |
| 209 | panelstruct->paneldata = &truly_wvga_cmd_panel_data; |
| 210 | panelstruct->panelres = &truly_wvga_cmd_panel_res; |
| 211 | panelstruct->color = &truly_wvga_cmd_color; |
| 212 | panelstruct->videopanel = &truly_wvga_cmd_video_panel; |
| 213 | panelstruct->commandpanel = &truly_wvga_cmd_command_panel; |
| 214 | panelstruct->state = &truly_wvga_cmd_state; |
| 215 | panelstruct->laneconfig = &truly_wvga_cmd_lane_config; |
| 216 | panelstruct->paneltiminginfo |
| 217 | = &truly_wvga_cmd_timing_info; |
| 218 | panelstruct->panelresetseq |
| 219 | = &truly_wvga_cmd_reset_seq; |
| 220 | panelstruct->backlightinfo = &truly_wvga_cmd_backlight; |
Shivaraj Shetty | 0dc27c4 | 2015-02-18 12:35:23 +0530 | [diff] [blame] | 221 | pinfo->mipi.panel_on_cmds |
Sandeep Panda | 9d9079f | 2014-11-24 18:46:25 +0530 | [diff] [blame] | 222 | = truly_wvga_cmd_on_command; |
Shivaraj Shetty | 0dc27c4 | 2015-02-18 12:35:23 +0530 | [diff] [blame] | 223 | pinfo->mipi.num_of_panel_on_cmds |
Sandeep Panda | 9d9079f | 2014-11-24 18:46:25 +0530 | [diff] [blame] | 224 | = TRULY_WVGA_CMD_ON_COMMAND; |
Shivaraj Shetty | 0dc27c4 | 2015-02-18 12:35:23 +0530 | [diff] [blame] | 225 | pinfo->mipi.panel_off_cmds |
| 226 | = truly_wvga_cmd_off_command; |
| 227 | pinfo->mipi.num_of_panel_off_cmds |
| 228 | = TRULY_WVGA_CMD_OFF_COMMAND; |
Sandeep Panda | 9d9079f | 2014-11-24 18:46:25 +0530 | [diff] [blame] | 229 | memcpy(phy_db->timing, |
| 230 | truly_wvga_cmd_timings, TIMING_SIZE); |
| 231 | break; |
Ray Zhang | afc8666 | 2014-11-07 11:23:57 +0800 | [diff] [blame] | 232 | case ILI9806E_FWVGA_VIDEO_PANEL: |
| 233 | panelstruct->paneldata = &ili9806e_fwvga_video_panel_data; |
| 234 | panelstruct->panelres = &ili9806e_fwvga_video_panel_res; |
| 235 | panelstruct->color = &ili9806e_fwvga_video_color; |
| 236 | panelstruct->videopanel = &ili9806e_fwvga_video_video_panel; |
| 237 | panelstruct->commandpanel = &ili9806e_fwvga_video_command_panel; |
| 238 | panelstruct->state = &ili9806e_fwvga_video_state; |
| 239 | panelstruct->laneconfig = &ili9806e_fwvga_video_lane_config; |
| 240 | panelstruct->paneltiminginfo |
| 241 | = &ili9806e_fwvga_video_timing_info; |
| 242 | panelstruct->panelresetseq |
| 243 | = &ili9806e_fwvga_video_reset_seq; |
| 244 | panelstruct->backlightinfo = &ili9806e_fwvga_video_backlight; |
| 245 | pinfo->mipi.panel_on_cmds |
| 246 | = ili9806e_fwvga_video_on_command; |
| 247 | pinfo->mipi.num_of_panel_on_cmds |
| 248 | = ILI9806E_FWVGA_VIDEO_ON_COMMAND; |
| 249 | pinfo->mipi.panel_off_cmds |
| 250 | = ili9806e_fwvga_video_off_command; |
| 251 | pinfo->mipi.num_of_panel_off_cmds |
| 252 | = ILI9806E_FWVGA_VIDEO_OFF_COMMAND; |
| 253 | memcpy(phy_db->timing, |
| 254 | ili9806e_fwvga_video_timings, TIMING_SIZE); |
| 255 | pinfo->mipi.signature = ILI9806E_FWVGA_VIDEO_SIGNATURE; |
| 256 | break; |
Ray Zhang | 6da38ca | 2014-11-18 16:02:11 +0800 | [diff] [blame] | 257 | case HX8379C_FWVGA_VIDEO_PANEL: |
| 258 | panelstruct->paneldata = &hx8379c_fwvga_video_panel_data; |
| 259 | panelstruct->panelres = &hx8379c_fwvga_video_panel_res; |
| 260 | panelstruct->color = &hx8379c_fwvga_video_color; |
| 261 | panelstruct->videopanel = &hx8379c_fwvga_video_video_panel; |
| 262 | panelstruct->commandpanel = &hx8379c_fwvga_video_command_panel; |
| 263 | panelstruct->state = &hx8379c_fwvga_video_state; |
| 264 | panelstruct->laneconfig = &hx8379c_fwvga_video_lane_config; |
| 265 | panelstruct->paneltiminginfo |
| 266 | = &hx8379c_fwvga_video_timing_info; |
| 267 | panelstruct->panelresetseq |
| 268 | = &hx8379c_fwvga_video_reset_seq; |
| 269 | panelstruct->backlightinfo = &hx8379c_fwvga_video_backlight; |
| 270 | pinfo->mipi.panel_on_cmds |
| 271 | = hx8379c_fwvga_video_on_command; |
| 272 | pinfo->mipi.num_of_panel_on_cmds |
| 273 | = HX8379C_FWVGA_VIDEO_ON_COMMAND; |
| 274 | pinfo->mipi.panel_off_cmds |
| 275 | = hx8379c_fwvga_video_off_command; |
| 276 | pinfo->mipi.num_of_panel_off_cmds |
| 277 | = HX8379C_FWVGA_VIDEO_OFF_COMMAND; |
| 278 | memcpy(phy_db->timing, |
| 279 | hx8379c_fwvga_video_timings, TIMING_SIZE); |
| 280 | pinfo->mipi.signature = HX8379C_FWVGA_VIDEO_SIGNATURE; |
| 281 | break; |
Shivaraj Shetty | cecaa0f | 2014-11-21 14:51:38 +0530 | [diff] [blame] | 282 | case HX8394D_QHD_VIDEO_PANEL: |
| 283 | panelstruct->paneldata = &hx8394d_qhd_video_panel_data; |
| 284 | panelstruct->panelres = &hx8394d_qhd_video_panel_res; |
| 285 | panelstruct->color = &hx8394d_qhd_video_color; |
| 286 | panelstruct->videopanel = &hx8394d_qhd_video_video_panel; |
| 287 | panelstruct->commandpanel = &hx8394d_qhd_video_command_panel; |
| 288 | panelstruct->state = &hx8394d_qhd_video_state; |
| 289 | panelstruct->laneconfig = &hx8394d_qhd_video_lane_config; |
| 290 | panelstruct->paneltiminginfo |
| 291 | = &hx8394d_qhd_video_timing_info; |
| 292 | panelstruct->panelresetseq |
| 293 | = &hx8394d_qhd_video_panel_reset_seq; |
| 294 | panelstruct->backlightinfo = &hx8394d_qhd_video_backlight; |
Shivaraj Shetty | 0dc27c4 | 2015-02-18 12:35:23 +0530 | [diff] [blame] | 295 | pinfo->mipi.panel_on_cmds |
Shivaraj Shetty | cecaa0f | 2014-11-21 14:51:38 +0530 | [diff] [blame] | 296 | = hx8394d_qhd_video_on_command; |
Shivaraj Shetty | 0dc27c4 | 2015-02-18 12:35:23 +0530 | [diff] [blame] | 297 | pinfo->mipi.num_of_panel_on_cmds |
Shivaraj Shetty | cecaa0f | 2014-11-21 14:51:38 +0530 | [diff] [blame] | 298 | = HX8394D_QHD_VIDEO_ON_COMMAND; |
Shivaraj Shetty | 0dc27c4 | 2015-02-18 12:35:23 +0530 | [diff] [blame] | 299 | pinfo->mipi.panel_off_cmds |
| 300 | = hx8394d_qhd_video_off_command; |
| 301 | pinfo->mipi.num_of_panel_off_cmds |
| 302 | = HX8394D_QHD_VIDEO_OFF_COMMAND; |
Shivaraj Shetty | cecaa0f | 2014-11-21 14:51:38 +0530 | [diff] [blame] | 303 | memcpy(phy_db->timing, |
| 304 | hx8394d_qhd_video_timings, TIMING_SIZE); |
| 305 | pinfo->mipi.signature = HX8394D_QHD_VIDEO_SIGNATURE; |
| 306 | break; |
Yang | e194df9 | 2015-06-09 15:41:01 +0800 | [diff] [blame] | 307 | case FL10802_FWVGA_VIDEO_PANEL: |
| 308 | panelstruct->paneldata = &fl10802_fwvga_video_panel_data; |
| 309 | panelstruct->panelres = &fl10802_fwvga_video_panel_res; |
| 310 | panelstruct->color = &fl10802_fwvga_video_color; |
| 311 | panelstruct->videopanel = &fl10802_fwvga_video_video_panel; |
| 312 | panelstruct->commandpanel = &fl10802_fwvga_video_command_panel; |
| 313 | panelstruct->state = &fl10802_fwvga_video_state; |
| 314 | panelstruct->laneconfig = &fl10802_fwvga_video_lane_config; |
| 315 | panelstruct->paneltiminginfo |
| 316 | = &fl10802_fwvga_video_timing_info; |
| 317 | panelstruct->panelresetseq |
| 318 | = &fl10802_fwvga_video_reset_seq; |
| 319 | panelstruct->backlightinfo = &fl10802_fwvga_video_backlight; |
| 320 | pinfo->mipi.panel_on_cmds |
| 321 | = fl10802_fwvga_video_on_command; |
| 322 | pinfo->mipi.num_of_panel_on_cmds |
| 323 | = FL10802_FWVGA_VIDEO_ON_COMMAND; |
| 324 | pinfo->mipi.panel_off_cmds |
| 325 | = fl10802_fwvga_video_off_command; |
| 326 | pinfo->mipi.num_of_panel_off_cmds |
| 327 | = FL10802_FWVGA_VIDEO_OFF_COMMAND; |
| 328 | memcpy(phy_db->timing, |
| 329 | fl10802_fwvga_video_timings, TIMING_SIZE); |
| 330 | pinfo->mipi.signature = FL10802_FWVGA_VIDEO_SIGNATURE; |
Yang Xu | fbca05e | 2015-08-04 16:19:51 +0800 | [diff] [blame] | 331 | pinfo->mipi.cmds_post_tg = 1; |
Yang | e194df9 | 2015-06-09 15:41:01 +0800 | [diff] [blame] | 332 | break; |
Sachin Bhayare | 3068e6e | 2017-02-15 15:05:44 +0530 | [diff] [blame^] | 333 | case AUO_QVGA_CMD_PANEL: |
| 334 | panelstruct->paneldata = &auo_qvga_cmd_panel_data; |
| 335 | panelstruct->panelres = &auo_qvga_cmd_panel_res; |
| 336 | panelstruct->color = &auo_qvga_cmd_color; |
| 337 | panelstruct->videopanel = &auo_qvga_cmd_video_panel; |
| 338 | panelstruct->commandpanel = &auo_qvga_cmd_command_panel; |
| 339 | panelstruct->state = &auo_qvga_cmd_state; |
| 340 | panelstruct->laneconfig = &auo_qvga_cmd_lane_config; |
| 341 | panelstruct->paneltiminginfo |
| 342 | = &auo_qvga_cmd_timing_info; |
| 343 | panelstruct->panelresetseq |
| 344 | = &auo_qvga_cmd_panel_reset_seq; |
| 345 | panelstruct->backlightinfo |
| 346 | = &auo_qvga_cmd_backlight; |
| 347 | pinfo->mipi.panel_on_cmds |
| 348 | = auo_qvga_cmd_on_command; |
| 349 | pinfo->mipi.num_of_panel_on_cmds |
| 350 | = auo_QVGA_CMD_ON_COMMAND; |
| 351 | pinfo->mipi.panel_off_cmds |
| 352 | = auo_qvga_cmd_off_command; |
| 353 | pinfo->mipi.num_of_panel_off_cmds |
| 354 | = auo_QVGA_CMD_OFF_COMMAND; |
| 355 | memcpy(phy_db->timing, auo_qvga_cmd_timings, TIMING_SIZE); |
| 356 | break; |
| 357 | case AUO_CX_QVGA_CMD_PANEL: |
| 358 | panelstruct->paneldata = &auo_cx_qvga_cmd_panel_data; |
| 359 | panelstruct->panelres = &auo_cx_qvga_cmd_panel_res; |
| 360 | panelstruct->color = &auo_cx_qvga_cmd_color; |
| 361 | panelstruct->videopanel = &auo_cx_qvga_cmd_video_panel; |
| 362 | panelstruct->commandpanel = &auo_cx_qvga_cmd_command_panel; |
| 363 | panelstruct->state = &auo_cx_qvga_cmd_state; |
| 364 | panelstruct->laneconfig = &auo_cx_qvga_cmd_lane_config; |
| 365 | panelstruct->paneltiminginfo |
| 366 | = &auo_cx_qvga_cmd_timing_info; |
| 367 | panelstruct->panelresetseq |
| 368 | = &auo_cx_qvga_cmd_panel_reset_seq; |
| 369 | panelstruct->backlightinfo |
| 370 | = &auo_cx_qvga_cmd_backlight; |
| 371 | pinfo->mipi.panel_on_cmds |
| 372 | = auo_cx_qvga_cmd_on_command; |
| 373 | pinfo->mipi.num_of_panel_on_cmds |
| 374 | = auo_cx_QVGA_CMD_ON_COMMAND; |
| 375 | pinfo->mipi.panel_off_cmds |
| 376 | = auo_cx_qvga_cmd_off_command; |
| 377 | pinfo->mipi.num_of_panel_off_cmds |
| 378 | = auo_cx_QVGA_CMD_OFF_COMMAND; |
| 379 | memcpy(phy_db->timing, auo_cx_qvga_cmd_timings, TIMING_SIZE); |
| 380 | break; |
| 381 | case AUO_400P_CMD_PANEL: |
| 382 | panelstruct->paneldata = &auo_400p_cmd_panel_data; |
| 383 | panelstruct->panelres = &auo_400p_cmd_panel_res; |
| 384 | panelstruct->color = &auo_400p_cmd_color; |
| 385 | panelstruct->videopanel = &auo_400p_cmd_video_panel; |
| 386 | panelstruct->commandpanel = &auo_400p_cmd_command_panel; |
| 387 | panelstruct->state = &auo_400p_cmd_state; |
| 388 | panelstruct->laneconfig = &auo_400p_cmd_lane_config; |
| 389 | panelstruct->paneltiminginfo |
| 390 | = &auo_400p_cmd_timing_info; |
| 391 | panelstruct->panelresetseq |
| 392 | = &auo_400p_cmd_panel_reset_seq; |
| 393 | panelstruct->backlightinfo |
| 394 | = &auo_400p_cmd_backlight; |
| 395 | pinfo->mipi.panel_on_cmds |
| 396 | = auo_400p_cmd_on_command; |
| 397 | pinfo->mipi.num_of_panel_on_cmds |
| 398 | = auo_400P_CMD_ON_COMMAND; |
| 399 | pinfo->mipi.panel_off_cmds |
| 400 | = auo_400p_cmd_off_command; |
| 401 | pinfo->mipi.num_of_panel_off_cmds |
| 402 | = auo_400P_CMD_OFF_COMMAND; |
| 403 | memcpy(phy_db->timing, auo_400p_cmd_timings, TIMING_SIZE); |
| 404 | break; |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 405 | case UNKNOWN_PANEL: |
| 406 | default: |
| 407 | memset(panelstruct, 0, sizeof(struct panel_struct)); |
Padmanabhan Komanduru | b3d3184 | 2014-11-04 15:47:53 +0530 | [diff] [blame] | 408 | memset(pinfo->mipi.panel_on_cmds, 0, |
| 409 | sizeof(struct mipi_dsi_cmd)); |
| 410 | pinfo->mipi.num_of_panel_on_cmds = 0; |
| 411 | memset(pinfo->mipi.panel_off_cmds, 0, |
| 412 | sizeof(struct mipi_dsi_cmd)); |
| 413 | pinfo->mipi.num_of_panel_off_cmds = 0; |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 414 | memset(phy_db->timing, 0, TIMING_SIZE); |
| 415 | pan_type = PANEL_TYPE_UNKNOWN; |
| 416 | break; |
| 417 | } |
| 418 | return pan_type; |
| 419 | } |
| 420 | |
| 421 | uint32_t oem_panel_max_auto_detect_panels() |
| 422 | { |
| 423 | return target_panel_auto_detect_enabled() ? |
| 424 | DISPLAY_MAX_PANEL_DETECTION : 0; |
| 425 | } |
| 426 | |
| 427 | int oem_panel_select(const char *panel_name, struct panel_struct *panelstruct, |
| 428 | struct msm_panel_info *pinfo, |
| 429 | struct mdss_dsi_phy_ctrl *phy_db) |
| 430 | { |
| 431 | uint32_t hw_id = board_hardware_id(); |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 432 | uint32_t platform_subtype = board_hardware_subtype(); |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 433 | int32_t panel_override_id; |
| 434 | |
| 435 | if (panel_name) { |
| 436 | panel_override_id = panel_name_to_id(supp_panels, |
| 437 | ARRAY_SIZE(supp_panels), panel_name); |
| 438 | |
| 439 | if (panel_override_id < 0) { |
| 440 | dprintf(CRITICAL, "Not able to search the panel:%s\n", |
Padmanabhan Komanduru | bccbcdc | 2015-06-30 16:19:24 +0530 | [diff] [blame] | 441 | panel_name); |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 442 | } else if (panel_override_id < UNKNOWN_PANEL) { |
| 443 | /* panel override using fastboot oem command */ |
| 444 | panel_id = panel_override_id; |
| 445 | |
| 446 | dprintf(INFO, "OEM panel override:%s\n", |
Padmanabhan Komanduru | bccbcdc | 2015-06-30 16:19:24 +0530 | [diff] [blame] | 447 | panel_name); |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 448 | goto panel_init; |
| 449 | } |
| 450 | } |
| 451 | switch (hw_id) { |
| 452 | case HW_PLATFORM_SURF: |
Shivaraj Shetty | af4c607 | 2014-11-04 16:25:31 +0530 | [diff] [blame] | 453 | case HW_PLATFORM_MTP: |
Sandeep Panda | 8ede650 | 2014-12-02 10:56:16 +0530 | [diff] [blame] | 454 | case HW_PLATFORM_RCM: |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 455 | panel_id = HX8394D_720P_VIDEO_PANEL; |
| 456 | break; |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 457 | case HW_PLATFORM_QRD: |
| 458 | switch (platform_subtype) { |
| 459 | case QRD_SKUA: |
| 460 | panel_id = HX8379A_FWVGA_SKUA_VIDEO_PANEL; |
| 461 | break; |
| 462 | case QRD_SKUC: |
Ray Zhang | afc8666 | 2014-11-07 11:23:57 +0800 | [diff] [blame] | 463 | panel_id = ILI9806E_FWVGA_VIDEO_PANEL; |
| 464 | break; |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 465 | case QRD_SKUE: |
Ray Zhang | 6da38ca | 2014-11-18 16:02:11 +0800 | [diff] [blame] | 466 | panel_id = HX8379C_FWVGA_VIDEO_PANEL; |
| 467 | break; |
Yang | e194df9 | 2015-06-09 15:41:01 +0800 | [diff] [blame] | 468 | case QRD_SKUT: |
| 469 | panel_id = FL10802_FWVGA_VIDEO_PANEL; |
| 470 | break; |
Ray Zhang | a59d972 | 2014-10-23 16:19:07 +0800 | [diff] [blame] | 471 | default: |
| 472 | dprintf(CRITICAL, "QRD Display not enabled for %d type\n", |
| 473 | platform_subtype); |
| 474 | return PANEL_TYPE_UNKNOWN; |
| 475 | } |
| 476 | break; |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 477 | default: |
| 478 | dprintf(CRITICAL, "Display not enabled for %d HW type\n", |
| 479 | hw_id); |
| 480 | return PANEL_TYPE_UNKNOWN; |
| 481 | } |
| 482 | |
| 483 | panel_init: |
Shivaraj Shetty | af4c607 | 2014-11-04 16:25:31 +0530 | [diff] [blame] | 484 | phy_db->regulator_mode = DSI_PHY_REGULATOR_LDO_MODE; |
Shivaraj Shetty | f9e10c4 | 2014-09-17 04:21:15 +0530 | [diff] [blame] | 485 | return init_panel_data(panelstruct, pinfo, phy_db); |
| 486 | } |