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