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