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