1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
| G:\android9.0\kernel\msm-3.18\drivers\video\msm\mdss\mdss_dsi_panel.c
static int mdss_panel_parse_dt(struct device_node *np, struct mdss_dsi_ctrl_pdata *ctrl_pdata) { u32 tmp; u8 lanes = 0; int rc = 0; const char *data; static const char *pdest; struct mdss_panel_info *pinfo = &(ctrl_pdata->panel_data.panel_info);
if (mdss_dsi_is_hw_config_split(ctrl_pdata->shared_data)) pinfo->is_split_display = true;
rc = of_property_read_u32(np, "qcom,mdss-pan-physical-width-dimension", &tmp); pinfo->physical_width = (!rc ? tmp : 0); rc = of_property_read_u32(np, "qcom,mdss-pan-physical-height-dimension", &tmp); pinfo->physical_height = (!rc ? tmp : 0);
rc = of_property_read_u32(np, "qcom,mdss-dsi-bpp", &tmp);
pinfo->bpp = (!rc ? tmp : 24); pinfo->mipi.mode = DSI_VIDEO_MODE; data = of_get_property(np, "qcom,mdss-dsi-panel-type", NULL); if (data && !strncmp(data, "dsi_cmd_mode", 12)) pinfo->mipi.mode = DSI_CMD_MODE; pinfo->mipi.boot_mode = pinfo->mipi.mode; tmp = 0; data = of_get_property(np, "qcom,mdss-dsi-pixel-packing", NULL); if (data && !strcmp(data, "loose")) pinfo->mipi.pixel_packing = 1; else pinfo->mipi.pixel_packing = 0; rc = mdss_panel_get_dst_fmt(pinfo->bpp, pinfo->mipi.mode, pinfo->mipi.pixel_packing, &(pinfo->mipi.dst_format));
pdest = of_get_property(np, "qcom,mdss-dsi-panel-destination", NULL);
rc = of_property_read_u32(np, "qcom,mdss-dsi-underflow-color", &tmp); pinfo->lcdc.underflow_clr = (!rc ? tmp : 0xff); rc = of_property_read_u32(np, "qcom,mdss-dsi-border-color", &tmp); pinfo->lcdc.border_clr = (!rc ? tmp : 0); data = of_get_property(np, "qcom,mdss-dsi-panel-orientation", NULL); ......
rc = of_property_read_u32(np, "qcom,mdss-brightness-max-level", &tmp); pinfo->brightness_max = (!rc ? tmp : MDSS_MAX_BL_BRIGHTNESS); rc = of_property_read_u32(np, "qcom,mdss-dsi-bl-min-level", &tmp); pinfo->bl_min = (!rc ? tmp : 0); rc = of_property_read_u32(np, "qcom,mdss-dsi-bl-max-level", &tmp); pinfo->bl_max = (!rc ? tmp : 255); ctrl_pdata->bklt_max = pinfo->bl_max;
rc = of_property_read_u32(np, "qcom,mdss-dsi-interleave-mode", &tmp); pinfo->mipi.interleave_mode = (!rc ? tmp : 0);
pinfo->mipi.vsync_enable = of_property_read_bool(np, "qcom,mdss-dsi-te-check-enable");
if (pinfo->sim_panel_mode == SIM_SW_TE_MODE) pinfo->mipi.hw_vsync_mode = false; else pinfo->mipi.hw_vsync_mode = of_property_read_bool(np, "qcom,mdss-dsi-te-using-te-pin");
rc = of_property_read_u32(np, "qcom,mdss-dsi-h-sync-pulse", &tmp); pinfo->mipi.pulse_mode_hsa_he = (!rc ? tmp : false);
pinfo->mipi.hfp_power_stop = of_property_read_bool(np, "qcom,mdss-dsi-hfp-power-mode"); pinfo->mipi.hsa_power_stop = of_property_read_bool(np, "qcom,mdss-dsi-hsa-power-mode"); pinfo->mipi.hbp_power_stop = of_property_read_bool(np, "qcom,mdss-dsi-hbp-power-mode"); pinfo->mipi.last_line_interleave_en = of_property_read_bool(np, "qcom,mdss-dsi-last-line-interleave"); pinfo->mipi.bllp_power_stop = of_property_read_bool(np, "qcom,mdss-dsi-bllp-power-mode"); pinfo->mipi.eof_bllp_power_stop = of_property_read_bool( np, "qcom,mdss-dsi-bllp-eof-power-mode"); pinfo->mipi.traffic_mode = DSI_NON_BURST_SYNCH_PULSE; data = of_get_property(np, "qcom,mdss-dsi-traffic-mode", NULL); if (data) { if (!strcmp(data, "non_burst_sync_event")) pinfo->mipi.traffic_mode = DSI_NON_BURST_SYNCH_EVENT; else if (!strcmp(data, "burst_mode")) pinfo->mipi.traffic_mode = DSI_BURST_MODE; } rc = of_property_read_u32(np, "qcom,mdss-dsi-te-dcs-command", &tmp); pinfo->mipi.insert_dcs_cmd = (!rc ? tmp : 1); rc = of_property_read_u32(np, "qcom,mdss-dsi-wr-mem-continue", &tmp); pinfo->mipi.wr_mem_continue = (!rc ? tmp : 0x3c); rc = of_property_read_u32(np, "qcom,mdss-dsi-wr-mem-start", &tmp); pinfo->mipi.wr_mem_start = (!rc ? tmp : 0x2c); rc = of_property_read_u32(np, "qcom,mdss-dsi-te-pin-select", &tmp); pinfo->mipi.te_sel = (!rc ? tmp : 1); rc = of_property_read_u32(np, "qcom,mdss-dsi-virtual-channel-id", &tmp); pinfo->mipi.vc = (!rc ? tmp : 0); pinfo->mipi.rgb_swap = DSI_RGB_SWAP_RGB; data = of_get_property(np, "qcom,mdss-dsi-color-order", NULL); if (data) { if (!strcmp(data, "rgb_swap_rbg")) pinfo->mipi.rgb_swap = DSI_RGB_SWAP_RBG; else if (!strcmp(data, "rgb_swap_bgr")) pinfo->mipi.rgb_swap = DSI_RGB_SWAP_BGR; else if (!strcmp(data, "rgb_swap_brg")) pinfo->mipi.rgb_swap = DSI_RGB_SWAP_BRG; else if (!strcmp(data, "rgb_swap_grb")) pinfo->mipi.rgb_swap = DSI_RGB_SWAP_GRB; else if (!strcmp(data, "rgb_swap_gbr")) pinfo->mipi.rgb_swap = DSI_RGB_SWAP_GBR; } pinfo->mipi.data_lane0 = of_property_read_bool(np, "qcom,mdss-dsi-lane-0-state"); pinfo->mipi.data_lane1 = of_property_read_bool(np, "qcom,mdss-dsi-lane-1-state"); pinfo->mipi.data_lane2 = of_property_read_bool(np, "qcom,mdss-dsi-lane-2-state"); pinfo->mipi.data_lane3 = of_property_read_bool(np, "qcom,mdss-dsi-lane-3-state");
if (pinfo->mipi.data_lane0) lanes++; if (pinfo->mipi.data_lane1) lanes++; if (pinfo->mipi.data_lane2) lanes++; if (pinfo->mipi.data_lane3) lanes++;
pinfo->mipi.default_lanes = lanes;
rc = mdss_panel_parse_display_timings(np, &ctrl_pdata->panel_data);
rc = mdss_dsi_parse_hdr_settings(np, pinfo);
pinfo->mipi.rx_eot_ignore = of_property_read_bool(np, "qcom,mdss-dsi-rx-eot-ignore"); pinfo->mipi.tx_eot_append = of_property_read_bool(np, "qcom,mdss-dsi-tx-eot-append");
rc = of_property_read_u32(np, "qcom,mdss-dsi-stream", &tmp); pinfo->mipi.stream = (!rc ? tmp : 0);
data = of_get_property(np, "qcom,mdss-dsi-panel-mode-gpio-state", NULL); if (data) { if (!strcmp(data, "high")) pinfo->mode_gpio_state = MODE_GPIO_HIGH; else if (!strcmp(data, "low")) pinfo->mode_gpio_state = MODE_GPIO_LOW; } else { pinfo->mode_gpio_state = MODE_GPIO_NOT_VALID; }
rc = of_property_read_u32(np, "qcom,mdss-mdp-transfer-time-us", &tmp); pinfo->mdp_transfer_time_us = (!rc ? tmp : DEFAULT_MDP_TRANSFER_TIME);
pinfo->mipi.lp11_init = of_property_read_bool(np, "qcom,mdss-dsi-lp11-init"); rc = of_property_read_u32(np, "qcom,mdss-dsi-init-delay-us", &tmp); pinfo->mipi.init_delay = (!rc ? tmp : 0);
rc = of_property_read_u32(np, "qcom,mdss-dsi-post-init-delay", &tmp); pinfo->mipi.post_init_delay = (!rc ? tmp : 0);
mdss_dsi_parse_trigger(np, &(pinfo->mipi.mdp_trigger), "qcom,mdss-dsi-mdp-trigger");
mdss_dsi_parse_trigger(np, &(pinfo->mipi.dma_trigger), "qcom,mdss-dsi-dma-trigger");
mdss_dsi_parse_reset_seq(np, pinfo->rst_seq, &(pinfo->rst_seq_len), "qcom,mdss-dsi-reset-sequence");
mdss_dsi_parse_dcs_cmds(np, &ctrl_pdata->off_cmds, "qcom,mdss-dsi-off-command", "qcom,mdss-dsi-off-command-state");
mdss_dsi_parse_dcs_cmds(np, &ctrl_pdata->idle_on_cmds, "qcom,mdss-dsi-idle-on-command", "qcom,mdss-dsi-idle-on-command-state");
mdss_dsi_parse_dcs_cmds(np, &ctrl_pdata->idle_off_cmds, "qcom,mdss-dsi-idle-off-command", "qcom,mdss-dsi-idle-off-command-state");
rc = of_property_read_u32(np, "qcom,mdss-dsi-idle-fps", &tmp); pinfo->mipi.frame_rate_idle = (!rc ? tmp : 60);
rc = of_property_read_u32(np, "qcom,adjust-timer-wakeup-ms", &tmp); pinfo->adjust_timer_delay_ms = (!rc ? tmp : 0);
pinfo->mipi.force_clk_lane_hs = of_property_read_bool(np, "qcom,mdss-dsi-force-clock-lane-hs");
rc = mdss_dsi_parse_panel_features(np, ctrl_pdata);
mdss_dsi_parse_panel_horizintal_line_idle(np, ctrl_pdata);
mdss_dsi_parse_dfps_config(np, ctrl_pdata);
rc = mdss_panel_parse_dt_hdmi(np, ctrl_pdata);
return 0;
}
|