Dhaval Patel | 019057a | 2014-08-12 13:52:25 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2013-2014, 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_sharp_wqxga_dualdsi_video.h" |
| 44 | #include "include/panel_jdi_qhd_dualdsi_video.h" |
| 45 | #include "include/panel_jdi_qhd_dualdsi_cmd.h" |
Siddhartha Agrawal | cddb0b8 | 2014-10-14 15:07:18 -0700 | [diff] [blame] | 46 | #include "include/panel_jdi_4k_dualdsi_video.h" |
Ingrid Gallardo | dfb1d49 | 2014-10-31 16:54:26 -0700 | [diff] [blame] | 47 | #include "include/panel_jdi_1080p_video.h" |
Ilia Lin | 4566819 | 2014-11-23 16:15:03 +0200 | [diff] [blame] | 48 | #include "include/panel_hx8379a_truly_fwvga_video.h" |
Jeevan Shriram | 5ed1b82 | 2014-11-30 22:10:57 -0800 | [diff] [blame^] | 49 | #include "include/panel_nt35597_wqxga_video.h" |
| 50 | #include "include/panel_nt35597_wqxga_cmd.h" |
Dhaval Patel | 019057a | 2014-08-12 13:52:25 -0700 | [diff] [blame] | 51 | |
| 52 | /*---------------------------------------------------------------------------*/ |
| 53 | /* static panel selection variable */ |
| 54 | /*---------------------------------------------------------------------------*/ |
| 55 | enum { |
| 56 | SHARP_WQXGA_DUALDSI_VIDEO_PANEL, |
| 57 | JDI_QHD_DUALDSI_VIDEO_PANEL, |
| 58 | JDI_QHD_DUALDSI_CMD_PANEL, |
Siddhartha Agrawal | cddb0b8 | 2014-10-14 15:07:18 -0700 | [diff] [blame] | 59 | JDI_4K_DUALDSI_VIDEO_PANEL, |
Ingrid Gallardo | dfb1d49 | 2014-10-31 16:54:26 -0700 | [diff] [blame] | 60 | JDI_1080P_VIDEO_PANEL, |
Ilia Lin | 4566819 | 2014-11-23 16:15:03 +0200 | [diff] [blame] | 61 | HX8379A_TRULY_FWVGA_VIDEO_PANEL, |
Jeevan Shriram | 5ed1b82 | 2014-11-30 22:10:57 -0800 | [diff] [blame^] | 62 | NOVATEK_WQXGA_VIDEO_PANEL, |
| 63 | NOVATEK_WQXGA_CMD_PANEL, |
Dhaval Patel | 019057a | 2014-08-12 13:52:25 -0700 | [diff] [blame] | 64 | UNKNOWN_PANEL |
| 65 | }; |
| 66 | |
| 67 | /* |
| 68 | * The list of panels that are supported on this target. |
| 69 | * Any panel in this list can be selected using fastboot oem command. |
| 70 | */ |
| 71 | static struct panel_list supp_panels[] = { |
| 72 | {"sharp_wqxga_dualdsi_video", SHARP_WQXGA_DUALDSI_VIDEO_PANEL}, |
| 73 | {"jdi_qhd_dualdsi_video", JDI_QHD_DUALDSI_VIDEO_PANEL}, |
| 74 | {"jdi_qhd_dualdsi_cmd", JDI_QHD_DUALDSI_CMD_PANEL}, |
Siddhartha Agrawal | cddb0b8 | 2014-10-14 15:07:18 -0700 | [diff] [blame] | 75 | {"jdi_4k_dualdsi_video", JDI_4K_DUALDSI_VIDEO_PANEL}, |
Ingrid Gallardo | dfb1d49 | 2014-10-31 16:54:26 -0700 | [diff] [blame] | 76 | {"jdi_1080p_video", JDI_1080P_VIDEO_PANEL}, |
Ilia Lin | 4566819 | 2014-11-23 16:15:03 +0200 | [diff] [blame] | 77 | {"hx8379a_truly_fwvga_video", HX8379A_TRULY_FWVGA_VIDEO_PANEL}, |
Jeevan Shriram | 5ed1b82 | 2014-11-30 22:10:57 -0800 | [diff] [blame^] | 78 | {"nt35597_wqxga_video", NOVATEK_WQXGA_VIDEO_PANEL}, |
| 79 | {"nt35597_wqxga_cmd", NOVATEK_WQXGA_CMD_PANEL}, |
Dhaval Patel | 019057a | 2014-08-12 13:52:25 -0700 | [diff] [blame] | 80 | }; |
| 81 | |
| 82 | static uint32_t panel_id; |
| 83 | |
| 84 | int oem_panel_rotation() |
| 85 | { |
| 86 | /* OEM can keep there panel specific on instructions in this |
| 87 | function */ |
| 88 | return NO_ERROR; |
| 89 | } |
| 90 | |
| 91 | int oem_panel_on() |
| 92 | { |
| 93 | /* OEM can keep there panel specific on instructions in this |
| 94 | function */ |
| 95 | if (panel_id == JDI_QHD_DUALDSI_CMD_PANEL) { |
| 96 | /* needs extra delay to avoid unexpected artifacts */ |
| 97 | mdelay(JDI_QHD_DUALDSI_CMD_PANEL_ON_DELAY); |
| 98 | |
| 99 | } |
| 100 | return NO_ERROR; |
| 101 | } |
| 102 | |
| 103 | int oem_panel_off() |
| 104 | { |
| 105 | /* OEM can keep there panel specific off instructions in this |
| 106 | function */ |
| 107 | return NO_ERROR; |
| 108 | } |
| 109 | |
| 110 | static bool init_panel_data(struct panel_struct *panelstruct, |
| 111 | struct msm_panel_info *pinfo, |
| 112 | struct mdss_dsi_phy_ctrl *phy_db) |
| 113 | { |
| 114 | int pan_type; |
| 115 | |
| 116 | phy_db->is_pll_20nm = 1; |
| 117 | |
| 118 | switch (panel_id) { |
| 119 | case SHARP_WQXGA_DUALDSI_VIDEO_PANEL: |
| 120 | pan_type = PANEL_TYPE_DSI; |
Kuogee Hsieh | 208736d | 2014-08-22 14:16:55 -0700 | [diff] [blame] | 121 | pinfo->lcd_reg_en = 0; |
Dhaval Patel | 019057a | 2014-08-12 13:52:25 -0700 | [diff] [blame] | 122 | panelstruct->paneldata = &sharp_wqxga_dualdsi_video_panel_data; |
| 123 | panelstruct->paneldata->panel_operating_mode = 11; |
| 124 | panelstruct->paneldata->panel_with_enable_gpio = 0; |
| 125 | panelstruct->panelres = &sharp_wqxga_dualdsi_video_panel_res; |
| 126 | panelstruct->color = &sharp_wqxga_dualdsi_video_color; |
| 127 | panelstruct->videopanel = &sharp_wqxga_dualdsi_video_video_panel; |
| 128 | panelstruct->commandpanel = &sharp_wqxga_dualdsi_video_command_panel; |
| 129 | panelstruct->state = &sharp_wqxga_dualdsi_video_state; |
| 130 | panelstruct->laneconfig = &sharp_wqxga_dualdsi_video_lane_config; |
| 131 | panelstruct->paneltiminginfo |
| 132 | = &sharp_wqxga_dualdsi_video_timing_info; |
| 133 | panelstruct->panelresetseq |
| 134 | = &sharp_wqxga_dualdsi_video_reset_seq; |
| 135 | panelstruct->backlightinfo = &sharp_wqxga_dualdsi_video_backlight; |
Padmanabhan Komanduru | b3d3184 | 2014-11-04 15:47:53 +0530 | [diff] [blame] | 136 | pinfo->mipi.panel_on_cmds |
Dhaval Patel | 019057a | 2014-08-12 13:52:25 -0700 | [diff] [blame] | 137 | = sharp_wqxga_dualdsi_video_on_command; |
Padmanabhan Komanduru | b3d3184 | 2014-11-04 15:47:53 +0530 | [diff] [blame] | 138 | pinfo->mipi.num_of_panel_on_cmds |
Dhaval Patel | 019057a | 2014-08-12 13:52:25 -0700 | [diff] [blame] | 139 | = SHARP_WQXGA_DUALDSI_VIDEO_ON_COMMAND; |
Padmanabhan Komanduru | b3d3184 | 2014-11-04 15:47:53 +0530 | [diff] [blame] | 140 | pinfo->mipi.panel_off_cmds |
| 141 | = sharp_wqxga_dualdsi_video_off_command; |
| 142 | pinfo->mipi.num_of_panel_off_cmds |
| 143 | = SHARP_WQXGA_DUALDSI_VIDEO_OFF_COMMAND; |
Dhaval Patel | 019057a | 2014-08-12 13:52:25 -0700 | [diff] [blame] | 144 | memcpy(phy_db->timing, |
| 145 | sharp_wqxga_dualdsi_video_timings, TIMING_SIZE); |
| 146 | break; |
| 147 | case JDI_QHD_DUALDSI_VIDEO_PANEL: |
| 148 | pan_type = PANEL_TYPE_DSI; |
Kuogee Hsieh | 208736d | 2014-08-22 14:16:55 -0700 | [diff] [blame] | 149 | pinfo->lcd_reg_en = 1; |
Dhaval Patel | 019057a | 2014-08-12 13:52:25 -0700 | [diff] [blame] | 150 | panelstruct->paneldata = &jdi_qhd_dualdsi_video_panel_data; |
| 151 | panelstruct->panelres = &jdi_qhd_dualdsi_video_panel_res; |
| 152 | panelstruct->color = &jdi_qhd_dualdsi_video_color; |
| 153 | panelstruct->videopanel = &jdi_qhd_dualdsi_video_video_panel; |
| 154 | panelstruct->commandpanel = &jdi_qhd_dualdsi_video_command_panel; |
| 155 | panelstruct->state = &jdi_qhd_dualdsi_video_state; |
| 156 | panelstruct->laneconfig = &jdi_qhd_dualdsi_video_lane_config; |
| 157 | panelstruct->paneltiminginfo |
| 158 | = &jdi_qhd_dualdsi_video_timing_info; |
| 159 | panelstruct->panelresetseq |
| 160 | = &jdi_qhd_dualdsi_video_reset_seq; |
Dhaval Patel | 019057a | 2014-08-12 13:52:25 -0700 | [diff] [blame] | 161 | panelstruct->backlightinfo = &jdi_qhd_dualdsi_video_backlight; |
Padmanabhan Komanduru | b3d3184 | 2014-11-04 15:47:53 +0530 | [diff] [blame] | 162 | pinfo->mipi.panel_on_cmds |
Dhaval Patel | 019057a | 2014-08-12 13:52:25 -0700 | [diff] [blame] | 163 | = jdi_qhd_dualdsi_video_on_command; |
Padmanabhan Komanduru | b3d3184 | 2014-11-04 15:47:53 +0530 | [diff] [blame] | 164 | pinfo->mipi.num_of_panel_on_cmds |
Dhaval Patel | 019057a | 2014-08-12 13:52:25 -0700 | [diff] [blame] | 165 | = JDI_QHD_DUALDSI_VIDEO_ON_COMMAND; |
Padmanabhan Komanduru | b3d3184 | 2014-11-04 15:47:53 +0530 | [diff] [blame] | 166 | pinfo->mipi.panel_off_cmds |
| 167 | = jdi_qhd_dualdsi_video_off_command; |
| 168 | pinfo->mipi.num_of_panel_off_cmds |
| 169 | = JDI_QHD_DUALDSI_VIDEO_OFF_COMMAND; |
Dhaval Patel | 019057a | 2014-08-12 13:52:25 -0700 | [diff] [blame] | 170 | memcpy(phy_db->timing, |
| 171 | jdi_qhd_dualdsi_video_timings, TIMING_SIZE); |
| 172 | break; |
| 173 | case JDI_QHD_DUALDSI_CMD_PANEL: |
| 174 | pan_type = PANEL_TYPE_DSI; |
Kuogee Hsieh | 208736d | 2014-08-22 14:16:55 -0700 | [diff] [blame] | 175 | pinfo->lcd_reg_en = 1; |
Dhaval Patel | 019057a | 2014-08-12 13:52:25 -0700 | [diff] [blame] | 176 | panelstruct->paneldata = &jdi_qhd_dualdsi_cmd_panel_data; |
| 177 | panelstruct->panelres = &jdi_qhd_dualdsi_cmd_panel_res; |
| 178 | panelstruct->color = &jdi_qhd_dualdsi_cmd_color; |
| 179 | panelstruct->videopanel = &jdi_qhd_dualdsi_cmd_video_panel; |
| 180 | panelstruct->commandpanel = &jdi_qhd_dualdsi_cmd_command_panel; |
| 181 | panelstruct->state = &jdi_qhd_dualdsi_cmd_state; |
| 182 | panelstruct->laneconfig = &jdi_qhd_dualdsi_cmd_lane_config; |
| 183 | panelstruct->paneltiminginfo |
| 184 | = &jdi_qhd_dualdsi_cmd_timing_info; |
| 185 | panelstruct->panelresetseq |
| 186 | = &jdi_qhd_dualdsi_cmd_reset_seq; |
Dhaval Patel | 019057a | 2014-08-12 13:52:25 -0700 | [diff] [blame] | 187 | panelstruct->backlightinfo = &jdi_qhd_dualdsi_cmd_backlight; |
Padmanabhan Komanduru | b3d3184 | 2014-11-04 15:47:53 +0530 | [diff] [blame] | 188 | pinfo->mipi.panel_on_cmds |
Dhaval Patel | 019057a | 2014-08-12 13:52:25 -0700 | [diff] [blame] | 189 | = jdi_qhd_dualdsi_cmd_on_command; |
Padmanabhan Komanduru | b3d3184 | 2014-11-04 15:47:53 +0530 | [diff] [blame] | 190 | pinfo->mipi.num_of_panel_on_cmds |
Dhaval Patel | 019057a | 2014-08-12 13:52:25 -0700 | [diff] [blame] | 191 | = JDI_QHD_DUALDSI_CMD_ON_COMMAND; |
Padmanabhan Komanduru | b3d3184 | 2014-11-04 15:47:53 +0530 | [diff] [blame] | 192 | pinfo->mipi.panel_off_cmds |
| 193 | = jdi_qhd_dualdsi_cmd_off_command; |
| 194 | pinfo->mipi.num_of_panel_off_cmds |
| 195 | = JDI_QHD_DUALDSI_CMD_OFF_COMMAND; |
Dhaval Patel | 019057a | 2014-08-12 13:52:25 -0700 | [diff] [blame] | 196 | memcpy(phy_db->timing, |
| 197 | jdi_qhd_dualdsi_cmd_timings, TIMING_SIZE); |
| 198 | break; |
Siddhartha Agrawal | cddb0b8 | 2014-10-14 15:07:18 -0700 | [diff] [blame] | 199 | case JDI_4K_DUALDSI_VIDEO_PANEL: |
| 200 | pan_type = PANEL_TYPE_DSI; |
| 201 | pinfo->lcd_reg_en = 1; |
| 202 | pinfo->mipi.cmds_post_tg = 1; |
| 203 | panelstruct->paneldata = &jdi_4k_dualdsi_video_panel_data; |
| 204 | panelstruct->panelres = &jdi_4k_dualdsi_video_panel_res; |
| 205 | panelstruct->color = &jdi_4k_dualdsi_video_color; |
| 206 | panelstruct->videopanel = &jdi_4k_dualdsi_video_video_panel; |
| 207 | panelstruct->commandpanel = &jdi_4k_dualdsi_video_command_panel; |
| 208 | panelstruct->state = &jdi_4k_dualdsi_video_state; |
| 209 | panelstruct->laneconfig = &jdi_4k_dualdsi_video_lane_config; |
| 210 | panelstruct->paneltiminginfo |
| 211 | = &jdi_4k_dualdsi_video_timing_info; |
| 212 | panelstruct->panelresetseq |
| 213 | = &jdi_4k_dualdsi_video_reset_seq; |
| 214 | panelstruct->backlightinfo = &jdi_4k_dualdsi_video_backlight; |
Padmanabhan Komanduru | b3d3184 | 2014-11-04 15:47:53 +0530 | [diff] [blame] | 215 | pinfo->mipi.panel_on_cmds |
Siddhartha Agrawal | cddb0b8 | 2014-10-14 15:07:18 -0700 | [diff] [blame] | 216 | = jdi_4k_dualdsi_video_on_command; |
Padmanabhan Komanduru | b3d3184 | 2014-11-04 15:47:53 +0530 | [diff] [blame] | 217 | pinfo->mipi.num_of_panel_on_cmds |
Siddhartha Agrawal | cddb0b8 | 2014-10-14 15:07:18 -0700 | [diff] [blame] | 218 | = JDI_4K_DUALDSI_VIDEO_ON_COMMAND; |
Padmanabhan Komanduru | b3d3184 | 2014-11-04 15:47:53 +0530 | [diff] [blame] | 219 | pinfo->mipi.panel_off_cmds |
| 220 | = jdi_4k_dualdsi_video_off_command; |
| 221 | pinfo->mipi.num_of_panel_off_cmds |
| 222 | = JDI_4K_DUALDSI_VIDEO_OFF_COMMAND; |
Siddhartha Agrawal | cddb0b8 | 2014-10-14 15:07:18 -0700 | [diff] [blame] | 223 | memcpy(phy_db->timing, |
| 224 | jdi_4k_dualdsi_video_timings, TIMING_SIZE); |
| 225 | memcpy(&panelstruct->fbcinfo, &jdi_4k_dualdsi_video_fbc, |
| 226 | sizeof(struct fb_compression)); |
Ingrid Gallardo | d4d3cd6 | 2014-12-01 21:30:13 -0800 | [diff] [blame] | 227 | break; |
Ingrid Gallardo | dfb1d49 | 2014-10-31 16:54:26 -0700 | [diff] [blame] | 228 | case JDI_1080P_VIDEO_PANEL: |
| 229 | pan_type = PANEL_TYPE_DSI; |
| 230 | pinfo->lcd_reg_en = 1; |
| 231 | panelstruct->paneldata = &jdi_1080p_video_panel_data; |
| 232 | panelstruct->panelres = &jdi_1080p_video_panel_res; |
| 233 | panelstruct->color = &jdi_1080p_video_color; |
| 234 | panelstruct->videopanel = &jdi_1080p_video_video_panel; |
| 235 | panelstruct->commandpanel = &jdi_1080p_video_command_panel; |
| 236 | panelstruct->state = &jdi_1080p_video_state; |
| 237 | panelstruct->laneconfig = &jdi_1080p_video_lane_config; |
| 238 | panelstruct->paneltiminginfo |
| 239 | = &jdi_1080p_video_timing_info; |
| 240 | panelstruct->panelresetseq |
| 241 | = &jdi_1080p_video_panel_reset_seq; |
| 242 | panelstruct->backlightinfo = &jdi_1080p_video_backlight; |
| 243 | pinfo->mipi.panel_on_cmds |
| 244 | = jdi_1080p_video_on_command; |
| 245 | pinfo->mipi.num_of_panel_on_cmds |
| 246 | = JDI_1080P_VIDEO_ON_COMMAND; |
| 247 | pinfo->mipi.panel_off_cmds |
| 248 | = jdi_1080p_video_off_command; |
| 249 | pinfo->mipi.num_of_panel_off_cmds |
| 250 | = JDI_1080P_VIDEO_OFF_COMMAND; |
| 251 | memcpy(phy_db->timing, |
| 252 | jdi_1080p_video_timings, TIMING_SIZE); |
Siddhartha Agrawal | cddb0b8 | 2014-10-14 15:07:18 -0700 | [diff] [blame] | 253 | break; |
Ilia Lin | 4566819 | 2014-11-23 16:15:03 +0200 | [diff] [blame] | 254 | case HX8379A_TRULY_FWVGA_VIDEO_PANEL: |
| 255 | pan_type = PANEL_TYPE_DSI; |
| 256 | pinfo->lcd_reg_en = 1; |
| 257 | panelstruct->paneldata = &hx8379a_truly_fwvga_video_panel_data; |
| 258 | panelstruct->panelres = &hx8379a_truly_fwvga_video_panel_res; |
| 259 | panelstruct->color = &hx8379a_truly_fwvga_video_color; |
| 260 | panelstruct->videopanel = &hx8379a_truly_fwvga_video_video_panel; |
| 261 | panelstruct->commandpanel = &hx8379a_truly_fwvga_video_command_panel; |
| 262 | panelstruct->state = &hx8379a_truly_fwvga_video_state; |
| 263 | panelstruct->laneconfig = &hx8379a_truly_fwvga_video_lane_config; |
| 264 | panelstruct->paneltiminginfo |
| 265 | = &hx8379a_truly_fwvga_video_timing_info; |
| 266 | panelstruct->panelresetseq |
| 267 | = &hx8379a_truly_fwvga_video_reset_seq; |
| 268 | panelstruct->backlightinfo = &hx8379a_truly_fwvga_video_backlight; |
| 269 | pinfo->mipi.panel_on_cmds |
| 270 | = hx8379a_truly_fwvga_video_on_command; |
| 271 | pinfo->mipi.num_of_panel_on_cmds |
| 272 | = HX8379A_TRULY_FWVGA_VIDEO_ON_COMMAND; |
| 273 | pinfo->mipi.panel_off_cmds |
| 274 | = hx8379a_truly_fwvga_video_off_command; |
| 275 | pinfo->mipi.num_of_panel_off_cmds |
| 276 | = HX8379A_TRULY_FWVGA_VIDEO_OFF_COMMAND; |
| 277 | pinfo->mipi.broadcast = 0; |
| 278 | memcpy(phy_db->timing, |
| 279 | hx8379a_truly_fwvga_video_timings, TIMING_SIZE); |
Jeevan Shriram | 5ed1b82 | 2014-11-30 22:10:57 -0800 | [diff] [blame^] | 280 | case NOVATEK_WQXGA_VIDEO_PANEL: |
| 281 | dprintf(ALWAYS, " Novatek 35597 panel selected\n"); |
| 282 | pan_type = PANEL_TYPE_DSI; |
| 283 | pinfo->lcd_reg_en = 0; |
| 284 | panelstruct->paneldata = &nt35597_wqxga_video_panel_data; |
| 285 | panelstruct->paneldata->panel_with_enable_gpio = 0; |
| 286 | panelstruct->panelres = &nt35597_wqxga_video_panel_res; |
| 287 | panelstruct->color = &nt35597_wqxga_video_color; |
| 288 | panelstruct->videopanel = &nt35597_wqxga_video_video_panel; |
| 289 | panelstruct->commandpanel = &nt35597_wqxga_video_command_panel; |
| 290 | panelstruct->state = &nt35597_wqxga_video_state; |
| 291 | panelstruct->laneconfig = &nt35597_wqxga_video_lane_config; |
| 292 | panelstruct->paneltiminginfo |
| 293 | = &nt35597_wqxga_video_timing_info; |
| 294 | panelstruct->panelresetseq |
| 295 | = &nt35597_wqxga_video_reset_seq; |
| 296 | panelstruct->backlightinfo = &nt35597_wqxga_video_backlight; |
| 297 | pinfo->mipi.panel_on_cmds |
| 298 | = nt35597_wqxga_video_on_command; |
| 299 | pinfo->mipi.num_of_panel_on_cmds |
| 300 | = NT35597_WQXGA_VIDEO_ON_COMMAND; |
| 301 | pinfo->mipi.panel_off_cmds |
| 302 | = nt35597_wqxga_video_off_command; |
| 303 | pinfo->mipi.num_of_panel_off_cmds |
| 304 | = NT35597_WQXGA_VIDEO_OFF_COMMAND; |
| 305 | memcpy(phy_db->timing, |
| 306 | nt35597_wqxga_video_timings, TIMING_SIZE); |
| 307 | memcpy(&panelstruct->fbcinfo, &nt35597_wqxga_video_fbc, |
| 308 | sizeof(struct fb_compression)); |
| 309 | break; |
| 310 | case NOVATEK_WQXGA_CMD_PANEL: |
| 311 | dprintf(ALWAYS, " Novatek 35597 command mode panel selected\n"); |
| 312 | pan_type = PANEL_TYPE_DSI; |
| 313 | pinfo->lcd_reg_en = 1; |
| 314 | panelstruct->paneldata = &nt35597_wqxga_cmd_panel_data; |
| 315 | panelstruct->paneldata->panel_with_enable_gpio = 0; |
| 316 | panelstruct->panelres = &nt35597_wqxga_cmd_panel_res; |
| 317 | panelstruct->color = &nt35597_wqxga_cmd_color; |
| 318 | panelstruct->videopanel = &nt35597_wqxga_cmd_video_panel; |
| 319 | panelstruct->commandpanel = &nt35597_wqxga_cmd_command_panel; |
| 320 | panelstruct->state = &nt35597_wqxga_cmd_state; |
| 321 | panelstruct->laneconfig = &nt35597_wqxga_cmd_lane_config; |
| 322 | panelstruct->paneltiminginfo |
| 323 | = &nt35597_wqxga_cmd_timing_info; |
| 324 | panelstruct->panelresetseq |
| 325 | = &nt35597_wqxga_cmd_reset_seq; |
| 326 | panelstruct->backlightinfo = &nt35597_wqxga_cmd_backlight; |
| 327 | pinfo->mipi.panel_on_cmds |
| 328 | = nt35597_wqxga_cmd_on_command; |
| 329 | pinfo->mipi.num_of_panel_on_cmds |
| 330 | = NT35597_WQXGA_CMD_ON_COMMAND; |
| 331 | pinfo->mipi.panel_off_cmds |
| 332 | = nt35597_wqxga_cmd_off_command; |
| 333 | pinfo->mipi.num_of_panel_off_cmds |
| 334 | = NT35597_WQXGA_CMD_OFF_COMMAND; |
| 335 | memcpy(phy_db->timing, |
| 336 | nt35597_wqxga_cmd_timings, TIMING_SIZE); |
| 337 | memcpy(&panelstruct->fbcinfo, &nt35597_wqxga_cmd_fbc, |
| 338 | sizeof(struct fb_compression)); |
Ilia Lin | 4566819 | 2014-11-23 16:15:03 +0200 | [diff] [blame] | 339 | break; |
Dhaval Patel | 019057a | 2014-08-12 13:52:25 -0700 | [diff] [blame] | 340 | default: |
| 341 | case UNKNOWN_PANEL: |
| 342 | pan_type = PANEL_TYPE_UNKNOWN; |
| 343 | break; |
| 344 | } |
| 345 | return pan_type; |
| 346 | } |
| 347 | |
| 348 | bool oem_panel_select(const char *panel_name, struct panel_struct *panelstruct, |
| 349 | struct msm_panel_info *pinfo, |
| 350 | struct mdss_dsi_phy_ctrl *phy_db) |
| 351 | { |
| 352 | uint32_t hw_id = board_hardware_id(); |
| 353 | int32_t panel_override_id; |
| 354 | |
| 355 | if (panel_name) { |
| 356 | panel_override_id = panel_name_to_id(supp_panels, |
| 357 | ARRAY_SIZE(supp_panels), panel_name); |
| 358 | |
| 359 | if (panel_override_id < 0) { |
| 360 | dprintf(CRITICAL, "Not able to search the panel:%s\n", |
| 361 | panel_name + strspn(panel_name, " ")); |
| 362 | } else if (panel_override_id < UNKNOWN_PANEL) { |
| 363 | /* panel override using fastboot oem command */ |
| 364 | panel_id = panel_override_id; |
| 365 | |
| 366 | dprintf(INFO, "OEM panel override:%s\n", |
| 367 | panel_name + strspn(panel_name, " ")); |
| 368 | goto panel_init; |
| 369 | } |
| 370 | } |
| 371 | |
| 372 | switch (hw_id) { |
| 373 | case HW_PLATFORM_MTP: |
| 374 | case HW_PLATFORM_FLUID: |
| 375 | case HW_PLATFORM_SURF: |
| 376 | panel_id = SHARP_WQXGA_DUALDSI_VIDEO_PANEL; |
| 377 | break; |
Siddhartha Agrawal | cddb0b8 | 2014-10-14 15:07:18 -0700 | [diff] [blame] | 378 | case HW_PLATFORM_LIQUID: |
| 379 | panel_id = JDI_4K_DUALDSI_VIDEO_PANEL; |
| 380 | break; |
Ilia Lin | 4566819 | 2014-11-23 16:15:03 +0200 | [diff] [blame] | 381 | case HW_PLATFORM_DRAGON: |
| 382 | panel_id = HX8379A_TRULY_FWVGA_VIDEO_PANEL; |
| 383 | break; |
Dhaval Patel | 019057a | 2014-08-12 13:52:25 -0700 | [diff] [blame] | 384 | default: |
| 385 | dprintf(CRITICAL, "Display not enabled for %d HW type\n" |
| 386 | , hw_id); |
| 387 | return PANEL_TYPE_UNKNOWN; |
| 388 | } |
| 389 | |
| 390 | panel_init: |
Ilia Lin | 4566819 | 2014-11-23 16:15:03 +0200 | [diff] [blame] | 391 | if (panel_id == JDI_4K_DUALDSI_VIDEO_PANEL || panel_id == HX8379A_TRULY_FWVGA_VIDEO_PANEL) |
Siddhartha Agrawal | cddb0b8 | 2014-10-14 15:07:18 -0700 | [diff] [blame] | 392 | phy_db->regulator_mode = DSI_PHY_REGULATOR_LDO_MODE; |
Dhaval Patel | 019057a | 2014-08-12 13:52:25 -0700 | [diff] [blame] | 393 | return init_panel_data(panelstruct, pinfo, phy_db); |
| 394 | } |