Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee8afc1e authored by Yuan Zhao's avatar Yuan Zhao Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/dsi-staging: Set the dsi panel type



Parse the DTS panel type settings. Consider the default
panel physical type as LCD. We need to set OLED in DTS if
the panel is an OLED type.

Change-Id: Ib53651ab3861e75bf061f38d60a2f6135c1f537d
Signed-off-by: default avatarYuan Zhao <yzhao@codeaurora.org>
parent da0c6938
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -3131,6 +3131,7 @@ struct dsi_panel *dsi_panel_get(struct device *parent,
{
	struct dsi_panel *panel;
	struct dsi_parser_utils *utils;
	const char *panel_physical_type;
	int rc = 0;

	panel = kzalloc(sizeof(*panel), GFP_KERNEL);
@@ -3149,6 +3150,15 @@ struct dsi_panel *dsi_panel_get(struct device *parent,
	if (!panel->name)
		panel->name = DSI_PANEL_DEFAULT_LABEL;

	/*
	 * Set panel type to LCD as default.
	 */
	panel->panel_type = DSI_DISPLAY_PANEL_TYPE_LCD;
	panel_physical_type  = utils->get_property(utils->data,
				"qcom,mdss-dsi-panel-physical-type", NULL);
	if (panel_physical_type && !strcmp(panel_physical_type, "oled"))
		panel->panel_type = DSI_DISPLAY_PANEL_TYPE_OLED;

	rc = dsi_panel_parse_host_config(panel);
	if (rc) {
		pr_err("failed to parse host configuration, rc=%d\n", rc);
+12 −0
Original line number Diff line number Diff line
@@ -71,6 +71,12 @@ enum dsi_dms_mode {
	DSI_DMS_MODE_RES_SWITCH_IMMEDIATE,
};

enum dsi_panel_physical_type {
	DSI_DISPLAY_PANEL_TYPE_LCD = 0,
	DSI_DISPLAY_PANEL_TYPE_OLED,
	DSI_DISPLAY_PANEL_TYPE_MAX,
};

struct dsi_dfps_capabilities {
	enum dsi_dfps_type type;
	u32 min_refresh_rate;
@@ -204,6 +210,7 @@ struct dsi_panel {

	bool sync_broadcast_en;
	int power_mode;
	enum dsi_panel_physical_type panel_type;
};

static inline bool dsi_panel_ulps_feature_enabled(struct dsi_panel *panel)
@@ -226,6 +233,11 @@ static inline void dsi_panel_release_panel_lock(struct dsi_panel *panel)
	mutex_unlock(&panel->panel_lock);
}

static inline bool dsi_panel_is_type_oled(struct dsi_panel *panel)
{
	return (panel->panel_type == DSI_DISPLAY_PANEL_TYPE_OLED);
}

struct dsi_panel *dsi_panel_get(struct device *parent,
				struct device_node *of_node,
				struct device_node *parser_node,