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