Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2013, 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 <err.h> |
| 32 | #include <smem.h> |
| 33 | #include <msm_panel.h> |
| 34 | #include <board.h> |
| 35 | #include <mipi_dsi.h> |
| 36 | |
| 37 | #include "include/panel.h" |
| 38 | #include "panel_display.h" |
| 39 | |
| 40 | /*---------------------------------------------------------------------------*/ |
| 41 | /* GCDB Panel Database */ |
| 42 | /*---------------------------------------------------------------------------*/ |
| 43 | #include "include/panel_toshiba_720p_video.h" |
| 44 | #include "include/panel_nt35590_720p_video.h" |
| 45 | #include "include/panel_nt35590_720p_cmd.h" |
Ray Zhang | 70abc54 | 2013-07-08 15:48:19 +0800 | [diff] [blame] | 46 | #include "include/panel_hx8394a_720p_video.h" |
Arpita Banerjee | f04ae4b | 2013-06-14 11:32:20 -0700 | [diff] [blame] | 47 | #include "include/panel_nt35596_1080p_video.h" |
Ray Zhang | 53b0dce | 2013-07-08 19:35:48 +0800 | [diff] [blame] | 48 | #include "include/panel_nt35521_720p_video.h" |
Ray Zhang | e100ab6 | 2013-09-03 19:17:07 +0800 | [diff] [blame] | 49 | #include "include/panel_ssd2080m_720p_video.h" |
Aravind Venkateswaran | af24121 | 2013-11-04 16:46:46 -0800 | [diff] [blame] | 50 | #include "include/panel_jdi_1080p_video.h" |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 51 | |
Pradeep Jilagam | feb1598 | 2013-10-29 13:08:51 +0530 | [diff] [blame] | 52 | #define DISPLAY_MAX_PANEL_DETECTION 2 |
| 53 | |
Ray Zhang | a6df18c | 2013-12-04 16:21:50 +0800 | [diff] [blame^] | 54 | #define SSD2080M_720P_VIDEO_PANEL_ON_DELAY 200 |
| 55 | |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 56 | /*---------------------------------------------------------------------------*/ |
| 57 | /* static panel selection variable */ |
| 58 | /*---------------------------------------------------------------------------*/ |
| 59 | enum { |
| 60 | TOSHIBA_720P_VIDEO_PANEL, |
| 61 | NT35590_720P_CMD_PANEL, |
Arpita Banerjee | f04ae4b | 2013-06-14 11:32:20 -0700 | [diff] [blame] | 62 | NT35590_720P_VIDEO_PANEL, |
Ray Zhang | 70abc54 | 2013-07-08 15:48:19 +0800 | [diff] [blame] | 63 | NT35596_1080P_VIDEO_PANEL, |
Ray Zhang | 53b0dce | 2013-07-08 19:35:48 +0800 | [diff] [blame] | 64 | HX8394A_720P_VIDEO_PANEL, |
Ray Zhang | e100ab6 | 2013-09-03 19:17:07 +0800 | [diff] [blame] | 65 | NT35521_720P_VIDEO_PANEL, |
Aravind Venkateswaran | af24121 | 2013-11-04 16:46:46 -0800 | [diff] [blame] | 66 | SSD2080M_720P_VIDEO_PANEL, |
Pradeep Jilagam | feb1598 | 2013-10-29 13:08:51 +0530 | [diff] [blame] | 67 | JDI_1080P_VIDEO_PANEL, |
| 68 | UNKNOWN_PANEL |
Aravind Venkateswaran | af24121 | 2013-11-04 16:46:46 -0800 | [diff] [blame] | 69 | }; |
| 70 | |
| 71 | enum target_subtype { |
| 72 | HW_PLATFORM_SUBTYPE_720P = 0, |
| 73 | HW_PLATFORM_SUBTYPE_SKUAA = 1, |
| 74 | HW_PLATFORM_SUBTYPE_SKUF = 2, |
| 75 | HW_PLATFORM_SUBTYPE_1080P = 2, |
| 76 | HW_PLATFORM_SUBTYPE_SKUAB = 3, |
| 77 | HW_PLATFORM_SUBTYPE_SKUG = 5, |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 78 | }; |
| 79 | |
| 80 | static uint32_t panel_id; |
| 81 | |
| 82 | int oem_panel_rotation() |
| 83 | { |
| 84 | int ret = NO_ERROR; |
| 85 | switch (panel_id) { |
| 86 | case TOSHIBA_720P_VIDEO_PANEL: |
| 87 | ret = mipi_dsi_cmds_tx(toshiba_720p_video_rotation, |
| 88 | TOSHIBA_720P_VIDEO_ROTATION); |
| 89 | break; |
| 90 | case NT35590_720P_CMD_PANEL: |
| 91 | ret = mipi_dsi_cmds_tx(nt35590_720p_cmd_rotation, |
| 92 | NT35590_720P_CMD_ROTATION); |
| 93 | break; |
| 94 | case NT35590_720P_VIDEO_PANEL: |
| 95 | ret = mipi_dsi_cmds_tx(nt35590_720p_video_rotation, |
| 96 | NT35590_720P_VIDEO_ROTATION); |
| 97 | break; |
| 98 | } |
| 99 | |
| 100 | return ret; |
| 101 | } |
| 102 | |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 103 | int oem_panel_on() |
| 104 | { |
| 105 | /* OEM can keep there panel spefic on instructions in this |
| 106 | function */ |
Ray Zhang | a6df18c | 2013-12-04 16:21:50 +0800 | [diff] [blame^] | 107 | if (panel_id == SSD2080M_720P_VIDEO_PANEL) { |
| 108 | /* SSD2080M needs extra delay to avoid unexpected artifacts */ |
| 109 | mdelay(SSD2080M_720P_VIDEO_PANEL_ON_DELAY); |
| 110 | } |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 111 | return NO_ERROR; |
| 112 | } |
| 113 | |
| 114 | int oem_panel_off() |
| 115 | { |
| 116 | /* OEM can keep there panel spefic off instructions in this |
| 117 | function */ |
| 118 | return NO_ERROR; |
| 119 | } |
| 120 | |
| 121 | static void init_panel_data(struct panel_struct *panelstruct, |
| 122 | struct msm_panel_info *pinfo, |
| 123 | struct mdss_dsi_phy_ctrl *phy_db) |
| 124 | { |
| 125 | switch (panel_id) { |
| 126 | case TOSHIBA_720P_VIDEO_PANEL: |
| 127 | panelstruct->paneldata = &toshiba_720p_video_panel_data; |
| 128 | panelstruct->panelres = &toshiba_720p_video_panel_res; |
| 129 | panelstruct->color = &toshiba_720p_video_color; |
| 130 | panelstruct->videopanel = &toshiba_720p_video_video_panel; |
| 131 | panelstruct->commandpanel = &toshiba_720p_video_command_panel; |
| 132 | panelstruct->state = &toshiba_720p_video_state; |
| 133 | panelstruct->laneconfig = &toshiba_720p_video_lane_config; |
| 134 | panelstruct->paneltiminginfo |
| 135 | = &toshiba_720p_video_timing_info; |
Casey Piper | 5197f93 | 2013-08-14 17:27:29 -0700 | [diff] [blame] | 136 | panelstruct->panelresetseq |
| 137 | = &toshiba_720p_video_panel_reset_seq; |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 138 | panelstruct->backlightinfo = &toshiba_720p_video_backlight; |
| 139 | pinfo->mipi.panel_cmds |
| 140 | = toshiba_720p_video_on_command; |
| 141 | pinfo->mipi.num_of_panel_cmds |
| 142 | = TOSHIBA_720P_VIDEO_ON_COMMAND; |
| 143 | memcpy(phy_db->timing, |
| 144 | toshiba_720p_video_timings, TIMING_SIZE); |
| 145 | break; |
| 146 | case NT35590_720P_VIDEO_PANEL: |
| 147 | panelstruct->paneldata = &nt35590_720p_video_panel_data; |
| 148 | panelstruct->panelres = &nt35590_720p_video_panel_res; |
| 149 | panelstruct->color = &nt35590_720p_video_color; |
| 150 | panelstruct->videopanel = &nt35590_720p_video_video_panel; |
| 151 | panelstruct->commandpanel = &nt35590_720p_video_command_panel; |
| 152 | panelstruct->state = &nt35590_720p_video_state; |
| 153 | panelstruct->laneconfig = &nt35590_720p_video_lane_config; |
| 154 | panelstruct->paneltiminginfo |
| 155 | = &nt35590_720p_video_timing_info; |
Casey Piper | 5197f93 | 2013-08-14 17:27:29 -0700 | [diff] [blame] | 156 | panelstruct->panelresetseq |
| 157 | = &nt35590_720p_video_panel_reset_seq; |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 158 | panelstruct->backlightinfo = &nt35590_720p_video_backlight; |
| 159 | pinfo->mipi.panel_cmds |
| 160 | = nt35590_720p_video_on_command; |
| 161 | pinfo->mipi.num_of_panel_cmds |
| 162 | = NT35590_720P_VIDEO_ON_COMMAND; |
| 163 | memcpy(phy_db->timing, |
| 164 | nt35590_720p_video_timings, TIMING_SIZE); |
| 165 | break; |
Ray Zhang | 53b0dce | 2013-07-08 19:35:48 +0800 | [diff] [blame] | 166 | case NT35521_720P_VIDEO_PANEL: |
| 167 | panelstruct->paneldata = &nt35521_720p_video_panel_data; |
| 168 | panelstruct->panelres = &nt35521_720p_video_panel_res; |
| 169 | panelstruct->color = &nt35521_720p_video_color; |
| 170 | panelstruct->videopanel = &nt35521_720p_video_video_panel; |
| 171 | panelstruct->commandpanel = &nt35521_720p_video_command_panel; |
| 172 | panelstruct->state = &nt35521_720p_video_state; |
| 173 | panelstruct->laneconfig = &nt35521_720p_video_lane_config; |
| 174 | panelstruct->paneltiminginfo |
| 175 | = &nt35521_720p_video_timing_info; |
Casey Piper | 5197f93 | 2013-08-14 17:27:29 -0700 | [diff] [blame] | 176 | panelstruct->panelresetseq |
| 177 | = &nt35521_720p_video_panel_reset_seq; |
Ray Zhang | 53b0dce | 2013-07-08 19:35:48 +0800 | [diff] [blame] | 178 | panelstruct->backlightinfo = &nt35521_720p_video_backlight; |
| 179 | pinfo->mipi.panel_cmds |
| 180 | = nt35521_720p_video_on_command; |
| 181 | pinfo->mipi.num_of_panel_cmds |
| 182 | = NT35521_720P_VIDEO_ON_COMMAND; |
| 183 | memcpy(phy_db->timing, |
| 184 | nt35521_720p_video_timings, TIMING_SIZE); |
| 185 | break; |
Ray Zhang | e100ab6 | 2013-09-03 19:17:07 +0800 | [diff] [blame] | 186 | case SSD2080M_720P_VIDEO_PANEL: |
| 187 | panelstruct->paneldata = &ssd2080m_720p_video_panel_data; |
| 188 | panelstruct->panelres = &ssd2080m_720p_video_panel_res; |
| 189 | panelstruct->color = &ssd2080m_720p_video_color; |
| 190 | panelstruct->videopanel = &ssd2080m_720p_video_video_panel; |
| 191 | panelstruct->commandpanel = &ssd2080m_720p_video_command_panel; |
| 192 | panelstruct->state = &ssd2080m_720p_video_state; |
| 193 | panelstruct->laneconfig = &ssd2080m_720p_video_lane_config; |
| 194 | panelstruct->paneltiminginfo |
| 195 | = &ssd2080m_720p_video_timing_info; |
| 196 | panelstruct->panelresetseq |
| 197 | = &ssd2080m_720p_video_panel_reset_seq; |
| 198 | panelstruct->backlightinfo = &ssd2080m_720p_video_backlight; |
| 199 | pinfo->mipi.panel_cmds |
| 200 | = ssd2080m_720p_video_on_command; |
| 201 | pinfo->mipi.num_of_panel_cmds |
| 202 | = SSD2080M_720P_VIDEO_ON_COMMAND; |
| 203 | memcpy(phy_db->timing, |
| 204 | ssd2080m_720p_video_timings, TIMING_SIZE); |
| 205 | break; |
Ray Zhang | 70abc54 | 2013-07-08 15:48:19 +0800 | [diff] [blame] | 206 | case HX8394A_720P_VIDEO_PANEL: |
| 207 | panelstruct->paneldata = &hx8394a_720p_video_panel_data; |
| 208 | panelstruct->panelres = &hx8394a_720p_video_panel_res; |
| 209 | panelstruct->color = &hx8394a_720p_video_color; |
| 210 | panelstruct->videopanel = &hx8394a_720p_video_video_panel; |
| 211 | panelstruct->commandpanel = &hx8394a_720p_video_command_panel; |
| 212 | panelstruct->state = &hx8394a_720p_video_state; |
| 213 | panelstruct->laneconfig = &hx8394a_720p_video_lane_config; |
| 214 | panelstruct->paneltiminginfo |
| 215 | = &hx8394a_720p_video_timing_info; |
Casey Piper | 5197f93 | 2013-08-14 17:27:29 -0700 | [diff] [blame] | 216 | panelstruct->panelresetseq |
| 217 | = &hx8394a_720p_video_panel_reset_seq; |
Ray Zhang | 70abc54 | 2013-07-08 15:48:19 +0800 | [diff] [blame] | 218 | panelstruct->backlightinfo = &hx8394a_720p_video_backlight; |
| 219 | pinfo->mipi.panel_cmds |
| 220 | = hx8394a_720p_video_on_command; |
| 221 | pinfo->mipi.num_of_panel_cmds |
| 222 | = HX8394A_720P_VIDEO_ON_COMMAND; |
| 223 | memcpy(phy_db->timing, |
| 224 | hx8394a_720p_video_timings, TIMING_SIZE); |
Pradeep Jilagam | feb1598 | 2013-10-29 13:08:51 +0530 | [diff] [blame] | 225 | pinfo->mipi.signature = HX8394A_720P_VIDEO_SIGNATURE; |
Ray Zhang | 70abc54 | 2013-07-08 15:48:19 +0800 | [diff] [blame] | 226 | break; |
| 227 | |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 228 | case NT35590_720P_CMD_PANEL: |
| 229 | panelstruct->paneldata = &nt35590_720p_cmd_panel_data; |
| 230 | panelstruct->panelres = &nt35590_720p_cmd_panel_res; |
| 231 | panelstruct->color = &nt35590_720p_cmd_color; |
| 232 | panelstruct->videopanel = &nt35590_720p_cmd_video_panel; |
| 233 | panelstruct->commandpanel = &nt35590_720p_cmd_command_panel; |
| 234 | panelstruct->state = &nt35590_720p_cmd_state; |
| 235 | panelstruct->laneconfig = &nt35590_720p_cmd_lane_config; |
| 236 | panelstruct->paneltiminginfo = &nt35590_720p_cmd_timing_info; |
Casey Piper | 5197f93 | 2013-08-14 17:27:29 -0700 | [diff] [blame] | 237 | panelstruct->panelresetseq |
| 238 | = &nt35590_720p_cmd_panel_reset_seq; |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 239 | panelstruct->backlightinfo = &nt35590_720p_cmd_backlight; |
| 240 | pinfo->mipi.panel_cmds |
| 241 | = nt35590_720p_cmd_on_command; |
| 242 | pinfo->mipi.num_of_panel_cmds |
| 243 | = NT35590_720P_CMD_ON_COMMAND; |
| 244 | memcpy(phy_db->timing, |
| 245 | nt35590_720p_cmd_timings, TIMING_SIZE); |
| 246 | break; |
Arpita Banerjee | f04ae4b | 2013-06-14 11:32:20 -0700 | [diff] [blame] | 247 | case NT35596_1080P_VIDEO_PANEL: |
| 248 | panelstruct->paneldata = &nt35596_1080p_video_panel_data; |
| 249 | panelstruct->panelres = &nt35596_1080p_video_panel_res; |
| 250 | panelstruct->color = &nt35596_1080p_video_color; |
| 251 | panelstruct->videopanel = &nt35596_1080p_video_video_panel; |
| 252 | panelstruct->commandpanel = &nt35596_1080p_video_command_panel; |
| 253 | panelstruct->state = &nt35596_1080p_video_state; |
| 254 | panelstruct->laneconfig = &nt35596_1080p_video_lane_config; |
| 255 | panelstruct->paneltiminginfo |
| 256 | = &nt35596_1080p_video_timing_info; |
Casey Piper | 5197f93 | 2013-08-14 17:27:29 -0700 | [diff] [blame] | 257 | panelstruct->panelresetseq |
| 258 | = &nt35596_1080p_video_panel_reset_seq; |
Arpita Banerjee | f04ae4b | 2013-06-14 11:32:20 -0700 | [diff] [blame] | 259 | panelstruct->backlightinfo |
| 260 | = &nt35596_1080p_video_backlight; |
| 261 | pinfo->mipi.panel_cmds |
| 262 | = nt35596_1080p_video_on_command; |
| 263 | pinfo->mipi.num_of_panel_cmds |
| 264 | = NT35596_1080P_VIDEO_ON_COMMAND; |
| 265 | memcpy(phy_db->timing, |
| 266 | nt35596_1080p_video_timings, TIMING_SIZE); |
Pradeep Jilagam | feb1598 | 2013-10-29 13:08:51 +0530 | [diff] [blame] | 267 | pinfo->mipi.signature = NT35596_1080P_VIDEO_SIGNATURE; |
Jayant Shekhar | 24be5e6 | 2013-11-18 19:59:50 +0530 | [diff] [blame] | 268 | break; |
Aravind Venkateswaran | af24121 | 2013-11-04 16:46:46 -0800 | [diff] [blame] | 269 | case JDI_1080P_VIDEO_PANEL: |
| 270 | panelstruct->paneldata = &jdi_1080p_video_panel_data; |
| 271 | panelstruct->paneldata->panel_with_enable_gpio = 1; |
| 272 | panelstruct->panelres = &jdi_1080p_video_panel_res; |
| 273 | panelstruct->color = &jdi_1080p_video_color; |
| 274 | panelstruct->videopanel = &jdi_1080p_video_video_panel; |
| 275 | panelstruct->commandpanel = &jdi_1080p_video_command_panel; |
| 276 | panelstruct->state = &jdi_1080p_video_state; |
| 277 | panelstruct->laneconfig = &jdi_1080p_video_lane_config; |
| 278 | panelstruct->paneltiminginfo |
| 279 | = &jdi_1080p_video_timing_info; |
| 280 | panelstruct->panelresetseq |
| 281 | = &jdi_1080p_video_panel_reset_seq; |
| 282 | panelstruct->backlightinfo = &jdi_1080p_video_backlight; |
| 283 | pinfo->mipi.panel_cmds |
| 284 | = jdi_1080p_video_on_command; |
| 285 | pinfo->mipi.num_of_panel_cmds |
| 286 | = JDI_1080P_VIDEO_ON_COMMAND; |
| 287 | memcpy(phy_db->timing, |
| 288 | jdi_1080p_video_timings, TIMING_SIZE); |
Arpita Banerjee | f04ae4b | 2013-06-14 11:32:20 -0700 | [diff] [blame] | 289 | break; |
Pradeep Jilagam | feb1598 | 2013-10-29 13:08:51 +0530 | [diff] [blame] | 290 | case UNKNOWN_PANEL: |
| 291 | memset(panelstruct, 0, sizeof(struct panel_struct)); |
| 292 | memset(pinfo->mipi.panel_cmds, 0, sizeof(struct mipi_dsi_cmd)); |
| 293 | pinfo->mipi.num_of_panel_cmds = 0; |
| 294 | memset(phy_db->timing, 0, TIMING_SIZE); |
| 295 | pinfo->mipi.signature = 0; |
| 296 | break; |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 297 | } |
| 298 | } |
| 299 | |
Pradeep Jilagam | feb1598 | 2013-10-29 13:08:51 +0530 | [diff] [blame] | 300 | uint32_t oem_panel_max_auto_detect_panels() |
| 301 | { |
| 302 | return target_panel_auto_detect_enabled() ? |
| 303 | DISPLAY_MAX_PANEL_DETECTION : 0; |
| 304 | } |
| 305 | |
| 306 | static uint32_t auto_pan_loop = 0; |
| 307 | |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 308 | bool oem_panel_select(struct panel_struct *panelstruct, |
| 309 | struct msm_panel_info *pinfo, |
| 310 | struct mdss_dsi_phy_ctrl *phy_db) |
| 311 | { |
| 312 | uint32_t hw_id = board_hardware_id(); |
Ray Zhang | 70abc54 | 2013-07-08 15:48:19 +0800 | [diff] [blame] | 313 | uint32_t target_id = board_target_id(); |
Aravind Venkateswaran | 9ae369b | 2013-07-23 22:57:47 -0700 | [diff] [blame] | 314 | uint32_t nt35590_panel_id = NT35590_720P_VIDEO_PANEL; |
Aravind Venkateswaran | af24121 | 2013-11-04 16:46:46 -0800 | [diff] [blame] | 315 | uint32_t hw_subtype = board_hardware_subtype(); |
Pradeep Jilagam | feb1598 | 2013-10-29 13:08:51 +0530 | [diff] [blame] | 316 | bool ret = true; |
Aravind Venkateswaran | 9ae369b | 2013-07-23 22:57:47 -0700 | [diff] [blame] | 317 | |
| 318 | #if DISPLAY_TYPE_CMD_MODE |
| 319 | nt35590_panel_id = NT35590_720P_CMD_PANEL; |
| 320 | #endif |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 321 | |
Dhaval Patel | fa5d587 | 2013-08-08 10:52:16 -0700 | [diff] [blame] | 322 | switch (hw_id) { |
| 323 | case HW_PLATFORM_QRD: |
Aravind Venkateswaran | af24121 | 2013-11-04 16:46:46 -0800 | [diff] [blame] | 324 | if (hw_subtype == HW_PLATFORM_SUBTYPE_SKUF) { |
Dhaval Patel | fa5d587 | 2013-08-08 10:52:16 -0700 | [diff] [blame] | 325 | panel_id = NT35521_720P_VIDEO_PANEL; |
Aravind Venkateswaran | af24121 | 2013-11-04 16:46:46 -0800 | [diff] [blame] | 326 | } else if (hw_subtype == HW_PLATFORM_SUBTYPE_SKUG) { |
Ray Zhang | e100ab6 | 2013-09-03 19:17:07 +0800 | [diff] [blame] | 327 | panel_id = SSD2080M_720P_VIDEO_PANEL; |
Dhaval Patel | fa5d587 | 2013-08-08 10:52:16 -0700 | [diff] [blame] | 328 | } else { |
Kun Liang | 6bff57d | 2013-09-29 18:27:23 +0800 | [diff] [blame] | 329 | if (((target_id >> 16) & 0xFF) == 0x1 || ((target_id >> 16) & 0xFF) == 0x3) //EVT || PVT |
Dhaval Patel | fa5d587 | 2013-08-08 10:52:16 -0700 | [diff] [blame] | 330 | panel_id = nt35590_panel_id; |
Pradeep Jilagam | feb1598 | 2013-10-29 13:08:51 +0530 | [diff] [blame] | 331 | else if (((target_id >> 16) & 0xFF) == 0x2) { //DVT |
Dhaval Patel | fa5d587 | 2013-08-08 10:52:16 -0700 | [diff] [blame] | 332 | panel_id = HX8394A_720P_VIDEO_PANEL; |
Pradeep Jilagam | feb1598 | 2013-10-29 13:08:51 +0530 | [diff] [blame] | 333 | switch (auto_pan_loop) { |
| 334 | case 0: |
| 335 | panel_id = HX8394A_720P_VIDEO_PANEL; |
| 336 | break; |
| 337 | case 1: |
| 338 | panel_id = NT35596_1080P_VIDEO_PANEL; |
| 339 | break; |
| 340 | default: |
| 341 | panel_id = UNKNOWN_PANEL; |
| 342 | ret = false; |
| 343 | dprintf(CRITICAL, "Unknown panel\n"); |
| 344 | return ret; |
| 345 | } |
| 346 | auto_pan_loop++; |
| 347 | } |
Dhaval Patel | fa5d587 | 2013-08-08 10:52:16 -0700 | [diff] [blame] | 348 | else { |
| 349 | dprintf(CRITICAL, "Not supported device, target_id=%x\n" |
| 350 | , target_id); |
| 351 | return false; |
| 352 | } |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 353 | } |
| 354 | break; |
Dhaval Patel | fa5d587 | 2013-08-08 10:52:16 -0700 | [diff] [blame] | 355 | case HW_PLATFORM_MTP: |
| 356 | case HW_PLATFORM_SURF: |
Aravind Venkateswaran | af24121 | 2013-11-04 16:46:46 -0800 | [diff] [blame] | 357 | if (hw_subtype == HW_PLATFORM_SUBTYPE_720P) { |
| 358 | panel_id = nt35590_panel_id; |
| 359 | } else if (hw_subtype == HW_PLATFORM_SUBTYPE_1080P) { |
| 360 | panel_id = JDI_1080P_VIDEO_PANEL; |
| 361 | } else { |
| 362 | dprintf(CRITICAL, "Unsupported target_id=%d hw_subtype=%d\n" |
| 363 | , target_id, hw_subtype); |
| 364 | return false; |
| 365 | } |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 366 | break; |
Dhaval Patel | e4ef944 | 2013-07-16 12:35:56 -0700 | [diff] [blame] | 367 | default: |
Dhaval Patel | fa5d587 | 2013-08-08 10:52:16 -0700 | [diff] [blame] | 368 | dprintf(CRITICAL, "Display not enabled for %d HW type\n" |
| 369 | , hw_id); |
Dhaval Patel | e4ef944 | 2013-07-16 12:35:56 -0700 | [diff] [blame] | 370 | return false; |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 371 | } |
| 372 | |
| 373 | init_panel_data(panelstruct, pinfo, phy_db); |
| 374 | |
Pradeep Jilagam | feb1598 | 2013-10-29 13:08:51 +0530 | [diff] [blame] | 375 | return ret; |
Arpita Banerjee | 841fa06 | 2013-05-24 14:59:51 -0700 | [diff] [blame] | 376 | } |