Padmanabhan Komanduru | cd5645e | 2014-03-25 20:34:18 +0530 | [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> |
Mao Flynn | 8140947 | 2014-04-10 15:01:30 +0800 | [diff] [blame] | 36 | #include <target/display.h> |
Padmanabhan Komanduru | cd5645e | 2014-03-25 20:34:18 +0530 | [diff] [blame] | 37 | |
| 38 | #include "include/panel.h" |
| 39 | #include "panel_display.h" |
| 40 | |
| 41 | /*---------------------------------------------------------------------------*/ |
| 42 | /* GCDB Panel Database */ |
| 43 | /*---------------------------------------------------------------------------*/ |
| 44 | #include "include/panel_jdi_1080p_video.h" |
Padmanabhan Komanduru | 1869a76 | 2014-04-01 20:12:05 +0530 | [diff] [blame] | 45 | #include "include/panel_nt35590_720p_video.h" |
| 46 | #include "include/panel_nt35590_720p_cmd.h" |
Mao Flynn | 8140947 | 2014-04-10 15:01:30 +0800 | [diff] [blame] | 47 | #include "include/panel_innolux_720p_video.h" |
Shuo Yan | 40c660c | 2014-04-24 15:58:43 +0800 | [diff] [blame] | 48 | #include "include/panel_otm8019a_fwvga_video.h" |
Mao Flynn | 67d5c59 | 2014-06-17 16:41:02 +0800 | [diff] [blame] | 49 | #include "include/panel_otm1283a_720p_video.h" |
Mao Flynn | 732e3c2 | 2014-07-02 17:39:02 +0800 | [diff] [blame] | 50 | #include "include/panel_nt35596_1080p_skuk_video.h" |
Vineet Bajaj | 7339d0b | 2014-07-24 21:51:44 +0530 | [diff] [blame] | 51 | #include "include/panel_sharp_wqxga_dualdsi_video.h" |
Vineet Bajaj | f4fcc71 | 2014-08-04 17:38:55 +0530 | [diff] [blame] | 52 | #include "include/panel_jdi_fhd_video.h"" |
Shuo Yan | 2616adc | 2014-08-13 08:22:27 +0800 | [diff] [blame^] | 53 | #include "include/panel_hx8379a_fwvga_video.h" |
Padmanabhan Komanduru | 1869a76 | 2014-04-01 20:12:05 +0530 | [diff] [blame] | 54 | |
| 55 | #define DISPLAY_MAX_PANEL_DETECTION 2 |
Shuo Yan | 4f57eb2 | 2014-05-27 10:57:17 +0800 | [diff] [blame] | 56 | #define OTM8019A_FWVGA_VIDEO_PANEL_ON_DELAY 50 |
Padmanabhan Komanduru | cd5645e | 2014-03-25 20:34:18 +0530 | [diff] [blame] | 57 | |
| 58 | /*---------------------------------------------------------------------------*/ |
| 59 | /* static panel selection variable */ |
| 60 | /*---------------------------------------------------------------------------*/ |
Padmanabhan Komanduru | 1869a76 | 2014-04-01 20:12:05 +0530 | [diff] [blame] | 61 | static uint32_t auto_pan_loop = 0; |
| 62 | |
Padmanabhan Komanduru | cd5645e | 2014-03-25 20:34:18 +0530 | [diff] [blame] | 63 | enum { |
| 64 | JDI_1080P_VIDEO_PANEL, |
Padmanabhan Komanduru | 1869a76 | 2014-04-01 20:12:05 +0530 | [diff] [blame] | 65 | NT35590_720P_VIDEO_PANEL, |
| 66 | NT35590_720P_CMD_PANEL, |
Mao Flynn | 8140947 | 2014-04-10 15:01:30 +0800 | [diff] [blame] | 67 | INNOLUX_720P_VIDEO_PANEL, |
Shuo Yan | 40c660c | 2014-04-24 15:58:43 +0800 | [diff] [blame] | 68 | OTM8019A_FWVGA_VIDEO_PANEL, |
Mao Flynn | 67d5c59 | 2014-06-17 16:41:02 +0800 | [diff] [blame] | 69 | OTM1283A_720P_VIDEO_PANEL, |
Mao Flynn | 732e3c2 | 2014-07-02 17:39:02 +0800 | [diff] [blame] | 70 | NT35596_1080P_VIDEO_PANEL, |
Vineet Bajaj | 7339d0b | 2014-07-24 21:51:44 +0530 | [diff] [blame] | 71 | SHARP_WQXGA_DUALDSI_VIDEO_PANEL, |
Vineet Bajaj | f4fcc71 | 2014-08-04 17:38:55 +0530 | [diff] [blame] | 72 | JDI_FHD_VIDEO_PANEL, |
Shuo Yan | 2616adc | 2014-08-13 08:22:27 +0800 | [diff] [blame^] | 73 | HX8379A_FWVGA_VIDEO_PANEL, |
Padmanabhan Komanduru | cd5645e | 2014-03-25 20:34:18 +0530 | [diff] [blame] | 74 | UNKNOWN_PANEL |
| 75 | }; |
| 76 | |
| 77 | /* |
| 78 | * The list of panels that are supported on this target. |
| 79 | * Any panel in this list can be selected using fastboot oem command. |
| 80 | */ |
| 81 | static struct panel_list supp_panels[] = { |
| 82 | {"jdi_1080p_video", JDI_1080P_VIDEO_PANEL}, |
Padmanabhan Komanduru | 1869a76 | 2014-04-01 20:12:05 +0530 | [diff] [blame] | 83 | {"nt35590_720p_video", NT35590_720P_VIDEO_PANEL}, |
| 84 | {"nt35590_720p_cmd", NT35590_720P_CMD_PANEL}, |
Mao Flynn | 8140947 | 2014-04-10 15:01:30 +0800 | [diff] [blame] | 85 | {"innolux_720p_video", INNOLUX_720P_VIDEO_PANEL}, |
Shuo Yan | 40c660c | 2014-04-24 15:58:43 +0800 | [diff] [blame] | 86 | {"otm8019a_fwvga_video", OTM8019A_FWVGA_VIDEO_PANEL}, |
Mao Flynn | 67d5c59 | 2014-06-17 16:41:02 +0800 | [diff] [blame] | 87 | {"otm1283a_720p_video", OTM1283A_720P_VIDEO_PANEL}, |
Mao Flynn | 732e3c2 | 2014-07-02 17:39:02 +0800 | [diff] [blame] | 88 | {"nt35596_1080p_video", NT35596_1080P_VIDEO_PANEL}, |
Vineet Bajaj | 7339d0b | 2014-07-24 21:51:44 +0530 | [diff] [blame] | 89 | {"sharp_wqxga_dualdsi_video",SHARP_WQXGA_DUALDSI_VIDEO_PANEL}, |
Shuo Yan | 2616adc | 2014-08-13 08:22:27 +0800 | [diff] [blame^] | 90 | {"jdi_fhd_video", JDI_FHD_VIDEO_PANEL}, |
| 91 | {"hx8379a_wvga_video", HX8379A_FWVGA_VIDEO_PANEL}, |
Padmanabhan Komanduru | cd5645e | 2014-03-25 20:34:18 +0530 | [diff] [blame] | 92 | }; |
| 93 | |
| 94 | static uint32_t panel_id; |
| 95 | |
| 96 | int oem_panel_rotation() |
| 97 | { |
| 98 | return NO_ERROR; |
| 99 | } |
| 100 | |
| 101 | int oem_panel_on() |
| 102 | { |
Shuo Yan | 4f57eb2 | 2014-05-27 10:57:17 +0800 | [diff] [blame] | 103 | /* |
| 104 | *OEM can keep there panel specific on instructions in this |
| 105 | *function |
| 106 | */ |
| 107 | if (panel_id == OTM8019A_FWVGA_VIDEO_PANEL) { |
| 108 | /* needs extra delay to avoid unexpected artifacts */ |
| 109 | mdelay(OTM8019A_FWVGA_VIDEO_PANEL_ON_DELAY); |
| 110 | } |
| 111 | |
Padmanabhan Komanduru | cd5645e | 2014-03-25 20:34:18 +0530 | [diff] [blame] | 112 | return NO_ERROR; |
| 113 | } |
| 114 | |
| 115 | int oem_panel_off() |
| 116 | { |
| 117 | /* OEM can keep their panel specific off instructions |
| 118 | * in this function |
| 119 | */ |
| 120 | return NO_ERROR; |
| 121 | } |
| 122 | |
Kuogee Hsieh | 80b8a6c | 2014-06-09 17:25:38 -0700 | [diff] [blame] | 123 | static int init_panel_data(struct panel_struct *panelstruct, |
Padmanabhan Komanduru | cd5645e | 2014-03-25 20:34:18 +0530 | [diff] [blame] | 124 | struct msm_panel_info *pinfo, |
| 125 | struct mdss_dsi_phy_ctrl *phy_db) |
| 126 | { |
Kuogee Hsieh | 80b8a6c | 2014-06-09 17:25:38 -0700 | [diff] [blame] | 127 | int pan_type = PANEL_TYPE_DSI; |
Padmanabhan Komanduru | cd5645e | 2014-03-25 20:34:18 +0530 | [diff] [blame] | 128 | |
| 129 | switch (panel_id) { |
| 130 | case JDI_1080P_VIDEO_PANEL: |
| 131 | panelstruct->paneldata = &jdi_1080p_video_panel_data; |
| 132 | panelstruct->paneldata->panel_with_enable_gpio = 1; |
| 133 | panelstruct->panelres = &jdi_1080p_video_panel_res; |
| 134 | panelstruct->color = &jdi_1080p_video_color; |
| 135 | panelstruct->videopanel = &jdi_1080p_video_video_panel; |
| 136 | panelstruct->commandpanel = &jdi_1080p_video_command_panel; |
| 137 | panelstruct->state = &jdi_1080p_video_state; |
| 138 | panelstruct->laneconfig = &jdi_1080p_video_lane_config; |
| 139 | panelstruct->paneltiminginfo |
| 140 | = &jdi_1080p_video_timing_info; |
| 141 | panelstruct->panelresetseq |
| 142 | = &jdi_1080p_video_panel_reset_seq; |
| 143 | panelstruct->backlightinfo = &jdi_1080p_video_backlight; |
| 144 | pinfo->mipi.panel_cmds |
| 145 | = jdi_1080p_video_on_command; |
| 146 | pinfo->mipi.num_of_panel_cmds |
| 147 | = JDI_1080P_VIDEO_ON_COMMAND; |
| 148 | memcpy(phy_db->timing, |
| 149 | jdi_1080p_video_timings, TIMING_SIZE); |
Padmanabhan Komanduru | 1869a76 | 2014-04-01 20:12:05 +0530 | [diff] [blame] | 150 | pinfo->mipi.signature = JDI_1080P_VIDEO_SIGNATURE; |
| 151 | break; |
| 152 | case NT35590_720P_VIDEO_PANEL: |
| 153 | panelstruct->paneldata = &nt35590_720p_video_panel_data; |
| 154 | panelstruct->panelres = &nt35590_720p_video_panel_res; |
| 155 | panelstruct->color = &nt35590_720p_video_color; |
| 156 | panelstruct->videopanel = &nt35590_720p_video_video_panel; |
| 157 | panelstruct->commandpanel = &nt35590_720p_video_command_panel; |
| 158 | panelstruct->state = &nt35590_720p_video_state; |
| 159 | panelstruct->laneconfig = &nt35590_720p_video_lane_config; |
| 160 | panelstruct->paneltiminginfo |
| 161 | = &nt35590_720p_video_timing_info; |
| 162 | panelstruct->panelresetseq |
| 163 | = &nt35590_720p_video_panel_reset_seq; |
| 164 | panelstruct->backlightinfo = &nt35590_720p_video_backlight; |
| 165 | pinfo->mipi.panel_cmds |
| 166 | = nt35590_720p_video_on_command; |
| 167 | pinfo->mipi.num_of_panel_cmds |
| 168 | = NT35590_720P_VIDEO_ON_COMMAND; |
| 169 | memcpy(phy_db->timing, |
| 170 | nt35590_720p_video_timings, TIMING_SIZE); |
| 171 | pinfo->mipi.signature = NT35590_720P_VIDEO_SIGNATURE; |
| 172 | break; |
| 173 | case NT35590_720P_CMD_PANEL: |
| 174 | panelstruct->paneldata = &nt35590_720p_cmd_panel_data; |
| 175 | panelstruct->panelres = &nt35590_720p_cmd_panel_res; |
| 176 | panelstruct->color = &nt35590_720p_cmd_color; |
| 177 | panelstruct->videopanel = &nt35590_720p_cmd_video_panel; |
| 178 | panelstruct->commandpanel = &nt35590_720p_cmd_command_panel; |
| 179 | panelstruct->state = &nt35590_720p_cmd_state; |
| 180 | panelstruct->laneconfig = &nt35590_720p_cmd_lane_config; |
| 181 | panelstruct->paneltiminginfo = &nt35590_720p_cmd_timing_info; |
| 182 | panelstruct->panelresetseq |
| 183 | = &nt35590_720p_cmd_panel_reset_seq; |
| 184 | panelstruct->backlightinfo = &nt35590_720p_cmd_backlight; |
| 185 | pinfo->mipi.panel_cmds |
| 186 | = nt35590_720p_cmd_on_command; |
| 187 | pinfo->mipi.num_of_panel_cmds |
| 188 | = NT35590_720P_CMD_ON_COMMAND; |
| 189 | memcpy(phy_db->timing, |
| 190 | nt35590_720p_cmd_timings, TIMING_SIZE); |
| 191 | pinfo->mipi.signature = NT35590_720P_CMD_SIGNATURE; |
Padmanabhan Komanduru | cd5645e | 2014-03-25 20:34:18 +0530 | [diff] [blame] | 192 | break; |
Mao Flynn | 8140947 | 2014-04-10 15:01:30 +0800 | [diff] [blame] | 193 | case INNOLUX_720P_VIDEO_PANEL: |
| 194 | panelstruct->paneldata = &innolux_720p_video_panel_data; |
| 195 | panelstruct->panelres = &innolux_720p_video_panel_res; |
| 196 | panelstruct->color = &innolux_720p_video_color; |
| 197 | panelstruct->videopanel = &innolux_720p_video_video_panel; |
| 198 | panelstruct->commandpanel = &innolux_720p_video_command_panel; |
| 199 | panelstruct->state = &innolux_720p_video_state; |
| 200 | panelstruct->laneconfig = &innolux_720p_video_lane_config; |
| 201 | panelstruct->paneltiminginfo |
Mao Flynn | 67d5c59 | 2014-06-17 16:41:02 +0800 | [diff] [blame] | 202 | = &innolux_720p_video_timing_info; |
Mao Flynn | 8140947 | 2014-04-10 15:01:30 +0800 | [diff] [blame] | 203 | panelstruct->panelresetseq |
Mao Flynn | 67d5c59 | 2014-06-17 16:41:02 +0800 | [diff] [blame] | 204 | = &innolux_720p_video_reset_seq; |
Mao Flynn | 8140947 | 2014-04-10 15:01:30 +0800 | [diff] [blame] | 205 | panelstruct->backlightinfo = &innolux_720p_video_backlight; |
| 206 | pinfo->mipi.panel_cmds |
Mao Flynn | 67d5c59 | 2014-06-17 16:41:02 +0800 | [diff] [blame] | 207 | = innolux_720p_video_on_command; |
Mao Flynn | 8140947 | 2014-04-10 15:01:30 +0800 | [diff] [blame] | 208 | pinfo->mipi.num_of_panel_cmds |
Mao Flynn | 67d5c59 | 2014-06-17 16:41:02 +0800 | [diff] [blame] | 209 | = INNOLUX_720P_VIDEO_ON_COMMAND; |
Mao Flynn | 8140947 | 2014-04-10 15:01:30 +0800 | [diff] [blame] | 210 | memcpy(phy_db->timing, |
Mao Flynn | 67d5c59 | 2014-06-17 16:41:02 +0800 | [diff] [blame] | 211 | innolux_720p_video_timings, TIMING_SIZE); |
Mao Flynn | 8140947 | 2014-04-10 15:01:30 +0800 | [diff] [blame] | 212 | break; |
Shuo Yan | 40c660c | 2014-04-24 15:58:43 +0800 | [diff] [blame] | 213 | case OTM8019A_FWVGA_VIDEO_PANEL: |
Mao Flynn | 67d5c59 | 2014-06-17 16:41:02 +0800 | [diff] [blame] | 214 | panelstruct->paneldata = &otm8019a_fwvga_video_panel_data; |
| 215 | panelstruct->panelres = &otm8019a_fwvga_video_panel_res; |
| 216 | panelstruct->color = &otm8019a_fwvga_video_color; |
| 217 | panelstruct->videopanel = &otm8019a_fwvga_video_video_panel; |
| 218 | panelstruct->commandpanel = &otm8019a_fwvga_video_command_panel; |
| 219 | panelstruct->state = &otm8019a_fwvga_video_state; |
| 220 | panelstruct->laneconfig = &otm8019a_fwvga_video_lane_config; |
| 221 | panelstruct->paneltiminginfo |
| 222 | = &otm8019a_fwvga_video_timing_info; |
| 223 | panelstruct->panelresetseq |
| 224 | = &otm8019a_fwvga_video_reset_seq; |
| 225 | panelstruct->backlightinfo = &otm8019a_fwvga_video_backlight; |
| 226 | pinfo->mipi.panel_cmds |
| 227 | = otm8019a_fwvga_video_on_command; |
| 228 | pinfo->mipi.num_of_panel_cmds |
| 229 | = OTM8019A_FWVGA_VIDEO_ON_COMMAND; |
| 230 | memcpy(phy_db->timing, |
| 231 | otm8019a_fwvga_video_timings, TIMING_SIZE); |
| 232 | break; |
| 233 | case OTM1283A_720P_VIDEO_PANEL: |
| 234 | panelstruct->paneldata = &otm1283a_720p_video_panel_data; |
| 235 | panelstruct->panelres = &otm1283a_720p_video_panel_res; |
| 236 | panelstruct->color = &otm1283a_720p_video_color; |
| 237 | panelstruct->videopanel = &otm1283a_720p_video_video_panel; |
| 238 | panelstruct->commandpanel = &otm1283a_720p_video_command_panel; |
| 239 | panelstruct->state = &otm1283a_720p_video_state; |
| 240 | panelstruct->laneconfig = &otm1283a_720p_video_lane_config; |
| 241 | panelstruct->paneltiminginfo |
| 242 | = &otm1283a_720p_video_timing_info; |
| 243 | panelstruct->panelresetseq |
| 244 | = &otm1283a_720p_video_reset_seq; |
| 245 | panelstruct->backlightinfo = &otm1283a_720p_video_backlight; |
| 246 | pinfo->mipi.panel_cmds |
| 247 | = otm1283a_720p_video_on_command; |
| 248 | pinfo->mipi.num_of_panel_cmds |
| 249 | = OTM1283A_720P_VIDEO_ON_COMMAND; |
| 250 | memcpy(phy_db->timing, |
| 251 | otm1283a_720p_video_timings, TIMING_SIZE); |
| 252 | break; |
Mao Flynn | 732e3c2 | 2014-07-02 17:39:02 +0800 | [diff] [blame] | 253 | case NT35596_1080P_VIDEO_PANEL: |
| 254 | panelstruct->paneldata = &nt35596_1080p_skuk_video_panel_data; |
| 255 | panelstruct->panelres = &nt35596_1080p_skuk_video_panel_res; |
| 256 | panelstruct->color = &nt35596_1080p_skuk_video_color; |
| 257 | panelstruct->videopanel = &nt35596_1080p_skuk_video_video_panel; |
| 258 | panelstruct->commandpanel = &nt35596_1080p_skuk_video_command_panel; |
| 259 | panelstruct->state = &nt35596_1080p_skuk_video_state; |
| 260 | panelstruct->laneconfig = &nt35596_1080p_skuk_video_lane_config; |
| 261 | panelstruct->paneltiminginfo |
| 262 | = &nt35596_1080p_skuk_video_timing_info; |
| 263 | panelstruct->panelresetseq |
| 264 | = &nt35596_1080p_skuk_video_reset_seq; |
| 265 | panelstruct->backlightinfo = &nt35596_1080p_skuk_video_backlight; |
| 266 | pinfo->mipi.panel_cmds |
| 267 | = nt35596_1080p_skuk_video_on_command; |
| 268 | pinfo->mipi.num_of_panel_cmds |
| 269 | = NT35596_1080P_SKUK_VIDEO_ON_COMMAND; |
| 270 | memcpy(phy_db->timing, |
| 271 | nt35596_1080p_skuk_video_timings, TIMING_SIZE); |
| 272 | break; |
Vineet Bajaj | 7339d0b | 2014-07-24 21:51:44 +0530 | [diff] [blame] | 273 | case SHARP_WQXGA_DUALDSI_VIDEO_PANEL: |
| 274 | panelstruct->paneldata = &sharp_wqxga_dualdsi_video_panel_data; |
| 275 | panelstruct->panelres = &sharp_wqxga_dualdsi_video_panel_res; |
| 276 | panelstruct->color = &sharp_wqxga_dualdsi_video_color; |
| 277 | panelstruct->videopanel = &sharp_wqxga_dualdsi_video_video_panel; |
| 278 | panelstruct->commandpanel = &sharp_wqxga_dualdsi_video_command_panel; |
| 279 | panelstruct->state = &sharp_wqxga_dualdsi_video_state; |
| 280 | panelstruct->laneconfig = &sharp_wqxga_dualdsi_video_lane_config; |
| 281 | panelstruct->paneltiminginfo |
| 282 | = &sharp_wqxga_dualdsi_video_timing_info; |
| 283 | panelstruct->panelresetseq |
| 284 | = &sharp_wqxga_dualdsi_video_reset_seq; |
| 285 | panelstruct->backlightinfo = &sharp_wqxga_dualdsi_video_backlight; |
| 286 | pinfo->mipi.panel_cmds |
| 287 | = sharp_wqxga_dualdsi_video_on_command; |
| 288 | pinfo->mipi.num_of_panel_cmds |
| 289 | = SHARP_WQXGA_DUALDSI_VIDEO_ON_COMMAND; |
| 290 | memcpy(phy_db->timing, |
| 291 | sharp_wqxga_dualdsi_video_timings, TIMING_SIZE); |
| 292 | pinfo->mipi.signature = SHARP_WQXGA_DUALDSI_VIDEO_SIGNATURE; |
| 293 | break; |
Vineet Bajaj | f4fcc71 | 2014-08-04 17:38:55 +0530 | [diff] [blame] | 294 | case JDI_FHD_VIDEO_PANEL: |
| 295 | panelstruct->paneldata = &jdi_fhd_video_panel_data; |
| 296 | panelstruct->panelres = &jdi_fhd_video_panel_res; |
| 297 | panelstruct->color = &jdi_fhd_video_color; |
| 298 | panelstruct->videopanel = &jdi_fhd_video_video_panel; |
| 299 | panelstruct->commandpanel = &jdi_fhd_video_command_panel; |
| 300 | panelstruct->state = &jdi_fhd_video_state; |
| 301 | panelstruct->laneconfig = &jdi_fhd_video_lane_config; |
| 302 | panelstruct->paneltiminginfo |
| 303 | = &jdi_fhd_video_timing_info; |
| 304 | panelstruct->panelresetseq |
| 305 | = &jdi_fhd_video_reset_seq; |
| 306 | panelstruct->backlightinfo = &jdi_fhd_video_backlight; |
| 307 | pinfo->mipi.panel_cmds |
| 308 | = jdi_fhd_video_on_command; |
| 309 | pinfo->mipi.num_of_panel_cmds |
| 310 | = JDI_FHD_VIDEO_ON_COMMAND; |
| 311 | memcpy(phy_db->timing, |
| 312 | jdi_fhd_video_timings, TIMING_SIZE); |
| 313 | break; |
Shuo Yan | 2616adc | 2014-08-13 08:22:27 +0800 | [diff] [blame^] | 314 | case HX8379A_FWVGA_VIDEO_PANEL: |
| 315 | panelstruct->paneldata = &hx8379a_fwvga_video_panel_data; |
| 316 | panelstruct->panelres = &hx8379a_fwvga_video_panel_res; |
| 317 | panelstruct->color = &hx8379a_fwvga_video_color; |
| 318 | panelstruct->videopanel = &hx8379a_fwvga_video_video_panel; |
| 319 | panelstruct->commandpanel = &hx8379a_fwvga_video_command_panel; |
| 320 | panelstruct->state = &hx8379a_fwvga_video_state; |
| 321 | panelstruct->laneconfig = &hx8379a_fwvga_video_lane_config; |
| 322 | panelstruct->paneltiminginfo |
| 323 | = &hx8379a_fwvga_video_timing_info; |
| 324 | panelstruct->panelresetseq |
| 325 | = &hx8379a_fwvga_video_reset_seq; |
| 326 | panelstruct->backlightinfo = &hx8379a_fwvga_video_backlight; |
| 327 | pinfo->mipi.panel_cmds |
| 328 | = hx8379a_fwvga_video_on_command; |
| 329 | pinfo->mipi.num_of_panel_cmds |
| 330 | = HX8379A_FWVGA_VIDEO_ON_COMMAND; |
| 331 | memcpy(phy_db->timing, |
| 332 | hx8379a_fwvga_video_timings, TIMING_SIZE); |
| 333 | break; |
Mao Flynn | 8140947 | 2014-04-10 15:01:30 +0800 | [diff] [blame] | 334 | case UNKNOWN_PANEL: |
Padmanabhan Komanduru | cd5645e | 2014-03-25 20:34:18 +0530 | [diff] [blame] | 335 | default: |
Mao Flynn | 8140947 | 2014-04-10 15:01:30 +0800 | [diff] [blame] | 336 | memset(panelstruct, 0, sizeof(struct panel_struct)); |
| 337 | memset(pinfo->mipi.panel_cmds, 0, sizeof(struct mipi_dsi_cmd)); |
| 338 | pinfo->mipi.num_of_panel_cmds = 0; |
| 339 | memset(phy_db->timing, 0, TIMING_SIZE); |
Kuogee Hsieh | 80b8a6c | 2014-06-09 17:25:38 -0700 | [diff] [blame] | 340 | pan_type = PANEL_TYPE_UNKNOWN; |
Mao Flynn | 8140947 | 2014-04-10 15:01:30 +0800 | [diff] [blame] | 341 | break; |
Padmanabhan Komanduru | cd5645e | 2014-03-25 20:34:18 +0530 | [diff] [blame] | 342 | } |
Kuogee Hsieh | 80b8a6c | 2014-06-09 17:25:38 -0700 | [diff] [blame] | 343 | return pan_type; |
Padmanabhan Komanduru | cd5645e | 2014-03-25 20:34:18 +0530 | [diff] [blame] | 344 | } |
| 345 | |
Padmanabhan Komanduru | 1869a76 | 2014-04-01 20:12:05 +0530 | [diff] [blame] | 346 | uint32_t oem_panel_max_auto_detect_panels() |
| 347 | { |
| 348 | return target_panel_auto_detect_enabled() ? |
| 349 | DISPLAY_MAX_PANEL_DETECTION : 0; |
| 350 | } |
| 351 | |
Kuogee Hsieh | 80b8a6c | 2014-06-09 17:25:38 -0700 | [diff] [blame] | 352 | int oem_panel_select(const char *panel_name, struct panel_struct *panelstruct, |
Padmanabhan Komanduru | cd5645e | 2014-03-25 20:34:18 +0530 | [diff] [blame] | 353 | struct msm_panel_info *pinfo, |
| 354 | struct mdss_dsi_phy_ctrl *phy_db) |
| 355 | { |
| 356 | uint32_t hw_id = board_hardware_id(); |
Mao Flynn | 8140947 | 2014-04-10 15:01:30 +0800 | [diff] [blame] | 357 | uint32_t hw_subtype = board_hardware_subtype(); |
Padmanabhan Komanduru | cd5645e | 2014-03-25 20:34:18 +0530 | [diff] [blame] | 358 | int32_t panel_override_id; |
Mao Flynn | 67d5c59 | 2014-06-17 16:41:02 +0800 | [diff] [blame] | 359 | uint32_t target_id, plat_hw_ver_major; |
Padmanabhan Komanduru | cd5645e | 2014-03-25 20:34:18 +0530 | [diff] [blame] | 360 | |
| 361 | if (panel_name) { |
| 362 | panel_override_id = panel_name_to_id(supp_panels, |
| 363 | ARRAY_SIZE(supp_panels), panel_name); |
| 364 | |
| 365 | if (panel_override_id < 0) { |
| 366 | dprintf(CRITICAL, "Not able to search the panel:%s\n", |
| 367 | panel_name + strspn(panel_name, " ")); |
| 368 | } else if (panel_override_id < UNKNOWN_PANEL) { |
| 369 | /* panel override using fastboot oem command */ |
| 370 | panel_id = panel_override_id; |
| 371 | |
| 372 | dprintf(INFO, "OEM panel override:%s\n", |
| 373 | panel_name + strspn(panel_name, " ")); |
| 374 | goto panel_init; |
| 375 | } |
| 376 | } |
| 377 | |
| 378 | switch (hw_id) { |
| 379 | case HW_PLATFORM_MTP: |
Padmanabhan Komanduru | 1869a76 | 2014-04-01 20:12:05 +0530 | [diff] [blame] | 380 | panel_id = JDI_1080P_VIDEO_PANEL; |
| 381 | break; |
Padmanabhan Komanduru | cd5645e | 2014-03-25 20:34:18 +0530 | [diff] [blame] | 382 | case HW_PLATFORM_SURF: |
| 383 | panel_id = JDI_1080P_VIDEO_PANEL; |
Padmanabhan Komanduru | 1869a76 | 2014-04-01 20:12:05 +0530 | [diff] [blame] | 384 | switch (auto_pan_loop) { |
| 385 | case 0: |
| 386 | panel_id = JDI_1080P_VIDEO_PANEL; |
| 387 | break; |
| 388 | case 1: |
| 389 | panel_id = NT35590_720P_VIDEO_PANEL; |
| 390 | break; |
| 391 | default: |
| 392 | panel_id = UNKNOWN_PANEL; |
Padmanabhan Komanduru | 1869a76 | 2014-04-01 20:12:05 +0530 | [diff] [blame] | 393 | dprintf(CRITICAL, "Unknown panel\n"); |
Kuogee Hsieh | 80b8a6c | 2014-06-09 17:25:38 -0700 | [diff] [blame] | 394 | return PANEL_TYPE_UNKNOWN; |
Padmanabhan Komanduru | 1869a76 | 2014-04-01 20:12:05 +0530 | [diff] [blame] | 395 | } |
| 396 | auto_pan_loop++; |
Padmanabhan Komanduru | cd5645e | 2014-03-25 20:34:18 +0530 | [diff] [blame] | 397 | break; |
Mao Flynn | 8140947 | 2014-04-10 15:01:30 +0800 | [diff] [blame] | 398 | case HW_PLATFORM_QRD: |
Shuo Yan | 2616adc | 2014-08-13 08:22:27 +0800 | [diff] [blame^] | 399 | target_id = board_target_id(); |
| 400 | plat_hw_ver_major = ((target_id >> 16) & 0xFF); |
| 401 | |
Mao Flynn | 732e3c2 | 2014-07-02 17:39:02 +0800 | [diff] [blame] | 402 | if (platform_is_msm8939()) { |
| 403 | switch (hw_subtype) { |
| 404 | case HW_PLATFORM_SUBTYPE_SKUK: |
| 405 | panel_id = NT35596_1080P_VIDEO_PANEL; |
| 406 | break; |
| 407 | default: |
| 408 | dprintf(CRITICAL, "Invalid subtype id %d for QRD HW\n", |
| 409 | hw_subtype); |
| 410 | return PANEL_TYPE_UNKNOWN; |
| 411 | } |
| 412 | } else { |
| 413 | switch (hw_subtype) { |
| 414 | case HW_PLATFORM_SUBTYPE_SKUH: |
Shuo Yan | 2616adc | 2014-08-13 08:22:27 +0800 | [diff] [blame^] | 415 | /* qrd SKUIC */ |
Mao Flynn | 732e3c2 | 2014-07-02 17:39:02 +0800 | [diff] [blame] | 416 | if ((plat_hw_ver_major >> 4) == 0x1) |
| 417 | panel_id = OTM1283A_720P_VIDEO_PANEL; |
| 418 | else |
| 419 | panel_id = INNOLUX_720P_VIDEO_PANEL; |
| 420 | break; |
| 421 | case HW_PLATFORM_SUBTYPE_SKUI: |
Shuo Yan | 2616adc | 2014-08-13 08:22:27 +0800 | [diff] [blame^] | 422 | /* qrd SKUIC */ |
| 423 | if ((plat_hw_ver_major >> 4) == 0x1) |
| 424 | panel_id = HX8379A_FWVGA_VIDEO_PANEL; |
| 425 | else |
| 426 | panel_id = OTM8019A_FWVGA_VIDEO_PANEL; |
Mao Flynn | 732e3c2 | 2014-07-02 17:39:02 +0800 | [diff] [blame] | 427 | break; |
| 428 | default: |
| 429 | dprintf(CRITICAL, "Invalid subtype id %d for QRD HW\n", |
| 430 | hw_subtype); |
| 431 | return PANEL_TYPE_UNKNOWN; |
| 432 | } |
Mao Flynn | 8140947 | 2014-04-10 15:01:30 +0800 | [diff] [blame] | 433 | } |
| 434 | break; |
Padmanabhan Komanduru | cd5645e | 2014-03-25 20:34:18 +0530 | [diff] [blame] | 435 | default: |
| 436 | dprintf(CRITICAL, "Display not enabled for %d HW type\n", |
| 437 | hw_id); |
Kuogee Hsieh | 80b8a6c | 2014-06-09 17:25:38 -0700 | [diff] [blame] | 438 | return PANEL_TYPE_UNKNOWN; |
Padmanabhan Komanduru | cd5645e | 2014-03-25 20:34:18 +0530 | [diff] [blame] | 439 | } |
| 440 | |
| 441 | panel_init: |
Radhika Ranjan Soni | 7ea9855 | 2014-06-11 17:01:12 +0530 | [diff] [blame] | 442 | /* Set LDO mode */ |
| 443 | if (platform_is_msm8939() || (hw_id == HW_PLATFORM_QRD)) |
| 444 | phy_db->regulator_mode = DSI_PHY_REGULATOR_LDO_MODE; |
| 445 | |
Jayant Shekhar | b130da2 | 2014-05-29 12:47:51 +0530 | [diff] [blame] | 446 | pinfo->pipe_type = MDSS_MDP_PIPE_TYPE_RGB; |
Padmanabhan Komanduru | cd5645e | 2014-03-25 20:34:18 +0530 | [diff] [blame] | 447 | return init_panel_data(panelstruct, pinfo, phy_db); |
| 448 | } |