Commit 678565c3 authored by Hai Li's avatar Hai Li Committed by Rob Clark

drm/msm/dsi: Rename *dual panel* to *dual DSI*

The current term of *dual panel* in DSI driver code causes confusion.
It is supposed to indicate the panel using two DSI links. Rename it
to *dual DSI*.
Signed-off-by: default avatarHai Li <hali@codeaurora.org>
Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
parent 13351cd1
...@@ -30,11 +30,11 @@ Optional properties: ...@@ -30,11 +30,11 @@ Optional properties:
- panel@0: Node of panel connected to this DSI controller. - panel@0: Node of panel connected to this DSI controller.
See files in Documentation/devicetree/bindings/panel/ for each supported See files in Documentation/devicetree/bindings/panel/ for each supported
panel. panel.
- qcom,dual-panel-mode: Boolean value indicating if the DSI controller is - qcom,dual-dsi-mode: Boolean value indicating if the DSI controller is
driving a panel which needs 2 DSI links. driving a panel which needs 2 DSI links.
- qcom,master-panel: Boolean value indicating if the DSI controller is driving - qcom,master-dsi: Boolean value indicating if the DSI controller is driving
the master link of the 2-DSI panel. the master link of the 2-DSI panel.
- qcom,sync-dual-panel: Boolean value indicating if the DSI controller is - qcom,sync-dual-dsi: Boolean value indicating if the DSI controller is
driving a 2-DSI panel whose 2 links need receive command simultaneously. driving a 2-DSI panel whose 2 links need receive command simultaneously.
- interrupt-parent: phandle to the MDP block if the interrupt signal is routed - interrupt-parent: phandle to the MDP block if the interrupt signal is routed
through MDP block through MDP block
...@@ -90,9 +90,9 @@ Example: ...@@ -90,9 +90,9 @@ Example:
qcom,dsi-phy = <&mdss_dsi_phy0>; qcom,dsi-phy = <&mdss_dsi_phy0>;
qcom,dual-panel-mode; qcom,dual-dsi-mode;
qcom,master-panel; qcom,master-dsi;
qcom,sync-dual-panel; qcom,sync-dual-dsi;
panel: panel@0 { panel: panel@0 {
compatible = "sharp,lq101r1sx01"; compatible = "sharp,lq101r1sx01";
......
...@@ -29,16 +29,16 @@ ...@@ -29,16 +29,16 @@
struct msm_dsi_manager { struct msm_dsi_manager {
struct msm_dsi *dsi[DSI_MAX]; struct msm_dsi *dsi[DSI_MAX];
bool is_dual_panel; bool is_dual_dsi;
bool is_sync_needed; bool is_sync_needed;
int master_panel_id; int master_dsi_link_id;
}; };
static struct msm_dsi_manager msm_dsim_glb; static struct msm_dsi_manager msm_dsim_glb;
#define IS_DUAL_PANEL() (msm_dsim_glb.is_dual_panel) #define IS_DUAL_DSI() (msm_dsim_glb.is_dual_dsi)
#define IS_SYNC_NEEDED() (msm_dsim_glb.is_sync_needed) #define IS_SYNC_NEEDED() (msm_dsim_glb.is_sync_needed)
#define IS_MASTER_PANEL(id) (msm_dsim_glb.master_panel_id == id) #define IS_MASTER_DSI_LINK(id) (msm_dsim_glb.master_dsi_link_id == id)
static inline struct msm_dsi *dsi_mgr_get_dsi(int id) static inline struct msm_dsi *dsi_mgr_get_dsi(int id)
{ {
...@@ -50,23 +50,23 @@ static inline struct msm_dsi *dsi_mgr_get_other_dsi(int id) ...@@ -50,23 +50,23 @@ static inline struct msm_dsi *dsi_mgr_get_other_dsi(int id)
return msm_dsim_glb.dsi[(id + 1) % DSI_MAX]; return msm_dsim_glb.dsi[(id + 1) % DSI_MAX];
} }
static int dsi_mgr_parse_dual_panel(struct device_node *np, int id) static int dsi_mgr_parse_dual_dsi(struct device_node *np, int id)
{ {
struct msm_dsi_manager *msm_dsim = &msm_dsim_glb; struct msm_dsi_manager *msm_dsim = &msm_dsim_glb;
/* We assume 2 dsi nodes have the same information of dual-panel and /* We assume 2 dsi nodes have the same information of dual-dsi and
* sync-mode, and only one node specifies master in case of dual mode. * sync-mode, and only one node specifies master in case of dual mode.
*/ */
if (!msm_dsim->is_dual_panel) if (!msm_dsim->is_dual_dsi)
msm_dsim->is_dual_panel = of_property_read_bool( msm_dsim->is_dual_dsi = of_property_read_bool(
np, "qcom,dual-panel-mode"); np, "qcom,dual-dsi-mode");
if (msm_dsim->is_dual_panel) { if (msm_dsim->is_dual_dsi) {
if (of_property_read_bool(np, "qcom,master-panel")) if (of_property_read_bool(np, "qcom,master-dsi"))
msm_dsim->master_panel_id = id; msm_dsim->master_dsi_link_id = id;
if (!msm_dsim->is_sync_needed) if (!msm_dsim->is_sync_needed)
msm_dsim->is_sync_needed = of_property_read_bool( msm_dsim->is_sync_needed = of_property_read_bool(
np, "qcom,sync-dual-panel"); np, "qcom,sync-dual-dsi");
} }
return 0; return 0;
...@@ -80,7 +80,7 @@ static int dsi_mgr_host_register(int id) ...@@ -80,7 +80,7 @@ static int dsi_mgr_host_register(int id)
struct msm_dsi_pll *src_pll; struct msm_dsi_pll *src_pll;
int ret; int ret;
if (!IS_DUAL_PANEL()) { if (!IS_DUAL_DSI()) {
ret = msm_dsi_host_register(msm_dsi->host, true); ret = msm_dsi_host_register(msm_dsi->host, true);
if (ret) if (ret)
return ret; return ret;
...@@ -90,9 +90,9 @@ static int dsi_mgr_host_register(int id) ...@@ -90,9 +90,9 @@ static int dsi_mgr_host_register(int id)
} else if (!other_dsi) { } else if (!other_dsi) {
ret = 0; ret = 0;
} else { } else {
struct msm_dsi *mdsi = IS_MASTER_PANEL(id) ? struct msm_dsi *mdsi = IS_MASTER_DSI_LINK(id) ?
msm_dsi : other_dsi; msm_dsi : other_dsi;
struct msm_dsi *sdsi = IS_MASTER_PANEL(id) ? struct msm_dsi *sdsi = IS_MASTER_DSI_LINK(id) ?
other_dsi : msm_dsi; other_dsi : msm_dsi;
/* Register slave host first, so that slave DSI device /* Register slave host first, so that slave DSI device
* has a chance to probe, and do not block the master * has a chance to probe, and do not block the master
...@@ -159,23 +159,23 @@ static enum drm_connector_status dsi_mgr_connector_detect( ...@@ -159,23 +159,23 @@ static enum drm_connector_status dsi_mgr_connector_detect(
&msm_dsi->panel_flags); &msm_dsi->panel_flags);
/* There is only 1 panel in the global panel list /* There is only 1 panel in the global panel list
* for dual panel mode. Therefore slave dsi should get * for dual DSI mode. Therefore slave dsi should get
* the drm_panel instance from master dsi, and * the drm_panel instance from master dsi, and
* keep using the panel flags got from the current DSI link. * keep using the panel flags got from the current DSI link.
*/ */
if (!msm_dsi->panel && IS_DUAL_PANEL() && if (!msm_dsi->panel && IS_DUAL_DSI() &&
!IS_MASTER_PANEL(id) && other_dsi) !IS_MASTER_DSI_LINK(id) && other_dsi)
msm_dsi->panel = msm_dsi_host_get_panel( msm_dsi->panel = msm_dsi_host_get_panel(
other_dsi->host, NULL); other_dsi->host, NULL);
if (msm_dsi->panel && IS_DUAL_PANEL()) if (msm_dsi->panel && IS_DUAL_DSI())
drm_object_attach_property(&connector->base, drm_object_attach_property(&connector->base,
connector->dev->mode_config.tile_property, 0); connector->dev->mode_config.tile_property, 0);
/* Set split display info to kms once dual panel is connected /* Set split display info to kms once dual DSI panel is
* to both hosts * connected to both hosts.
*/ */
if (msm_dsi->panel && IS_DUAL_PANEL() && if (msm_dsi->panel && IS_DUAL_DSI() &&
other_dsi && other_dsi->panel) { other_dsi && other_dsi->panel) {
bool cmd_mode = !(msm_dsi->panel_flags & bool cmd_mode = !(msm_dsi->panel_flags &
MIPI_DSI_MODE_VIDEO); MIPI_DSI_MODE_VIDEO);
...@@ -188,7 +188,7 @@ static enum drm_connector_status dsi_mgr_connector_detect( ...@@ -188,7 +188,7 @@ static enum drm_connector_status dsi_mgr_connector_detect(
kms->funcs->set_split_display(kms, encoder, kms->funcs->set_split_display(kms, encoder,
slave_enc, cmd_mode); slave_enc, cmd_mode);
else else
pr_err("mdp does not support dual panel\n"); pr_err("mdp does not support dual DSI\n");
} }
} }
...@@ -285,7 +285,7 @@ static int dsi_mgr_connector_get_modes(struct drm_connector *connector) ...@@ -285,7 +285,7 @@ static int dsi_mgr_connector_get_modes(struct drm_connector *connector)
if (!num) if (!num)
return 0; return 0;
if (IS_DUAL_PANEL()) { if (IS_DUAL_DSI()) {
/* report half resolution to user */ /* report half resolution to user */
dsi_dual_connector_fix_modes(connector); dsi_dual_connector_fix_modes(connector);
ret = dsi_dual_connector_tile_init(connector, id); ret = dsi_dual_connector_tile_init(connector, id);
...@@ -340,11 +340,11 @@ static void dsi_mgr_bridge_pre_enable(struct drm_bridge *bridge) ...@@ -340,11 +340,11 @@ static void dsi_mgr_bridge_pre_enable(struct drm_bridge *bridge)
struct msm_dsi *msm_dsi1 = dsi_mgr_get_dsi(DSI_1); struct msm_dsi *msm_dsi1 = dsi_mgr_get_dsi(DSI_1);
struct mipi_dsi_host *host = msm_dsi->host; struct mipi_dsi_host *host = msm_dsi->host;
struct drm_panel *panel = msm_dsi->panel; struct drm_panel *panel = msm_dsi->panel;
bool is_dual_panel = IS_DUAL_PANEL(); bool is_dual_dsi = IS_DUAL_DSI();
int ret; int ret;
DBG("id=%d", id); DBG("id=%d", id);
if (!panel || (is_dual_panel && (DSI_1 == id))) if (!panel || (is_dual_dsi && (DSI_1 == id)))
return; return;
ret = msm_dsi_host_power_on(host); ret = msm_dsi_host_power_on(host);
...@@ -353,7 +353,7 @@ static void dsi_mgr_bridge_pre_enable(struct drm_bridge *bridge) ...@@ -353,7 +353,7 @@ static void dsi_mgr_bridge_pre_enable(struct drm_bridge *bridge)
goto host_on_fail; goto host_on_fail;
} }
if (is_dual_panel && msm_dsi1) { if (is_dual_dsi && msm_dsi1) {
ret = msm_dsi_host_power_on(msm_dsi1->host); ret = msm_dsi_host_power_on(msm_dsi1->host);
if (ret) { if (ret) {
pr_err("%s: power on host1 failed, %d\n", pr_err("%s: power on host1 failed, %d\n",
...@@ -377,7 +377,7 @@ static void dsi_mgr_bridge_pre_enable(struct drm_bridge *bridge) ...@@ -377,7 +377,7 @@ static void dsi_mgr_bridge_pre_enable(struct drm_bridge *bridge)
goto host_en_fail; goto host_en_fail;
} }
if (is_dual_panel && msm_dsi1) { if (is_dual_dsi && msm_dsi1) {
ret = msm_dsi_host_enable(msm_dsi1->host); ret = msm_dsi_host_enable(msm_dsi1->host);
if (ret) { if (ret) {
pr_err("%s: enable host1 failed, %d\n", __func__, ret); pr_err("%s: enable host1 failed, %d\n", __func__, ret);
...@@ -394,14 +394,14 @@ static void dsi_mgr_bridge_pre_enable(struct drm_bridge *bridge) ...@@ -394,14 +394,14 @@ static void dsi_mgr_bridge_pre_enable(struct drm_bridge *bridge)
return; return;
panel_en_fail: panel_en_fail:
if (is_dual_panel && msm_dsi1) if (is_dual_dsi && msm_dsi1)
msm_dsi_host_disable(msm_dsi1->host); msm_dsi_host_disable(msm_dsi1->host);
host1_en_fail: host1_en_fail:
msm_dsi_host_disable(host); msm_dsi_host_disable(host);
host_en_fail: host_en_fail:
drm_panel_unprepare(panel); drm_panel_unprepare(panel);
panel_prep_fail: panel_prep_fail:
if (is_dual_panel && msm_dsi1) if (is_dual_dsi && msm_dsi1)
msm_dsi_host_power_off(msm_dsi1->host); msm_dsi_host_power_off(msm_dsi1->host);
host1_on_fail: host1_on_fail:
msm_dsi_host_power_off(host); msm_dsi_host_power_off(host);
...@@ -426,12 +426,12 @@ static void dsi_mgr_bridge_post_disable(struct drm_bridge *bridge) ...@@ -426,12 +426,12 @@ static void dsi_mgr_bridge_post_disable(struct drm_bridge *bridge)
struct msm_dsi *msm_dsi1 = dsi_mgr_get_dsi(DSI_1); struct msm_dsi *msm_dsi1 = dsi_mgr_get_dsi(DSI_1);
struct mipi_dsi_host *host = msm_dsi->host; struct mipi_dsi_host *host = msm_dsi->host;
struct drm_panel *panel = msm_dsi->panel; struct drm_panel *panel = msm_dsi->panel;
bool is_dual_panel = IS_DUAL_PANEL(); bool is_dual_dsi = IS_DUAL_DSI();
int ret; int ret;
DBG("id=%d", id); DBG("id=%d", id);
if (!panel || (is_dual_panel && (DSI_1 == id))) if (!panel || (is_dual_dsi && (DSI_1 == id)))
return; return;
ret = drm_panel_disable(panel); ret = drm_panel_disable(panel);
...@@ -442,7 +442,7 @@ static void dsi_mgr_bridge_post_disable(struct drm_bridge *bridge) ...@@ -442,7 +442,7 @@ static void dsi_mgr_bridge_post_disable(struct drm_bridge *bridge)
if (ret) if (ret)
pr_err("%s: host %d disable failed, %d\n", __func__, id, ret); pr_err("%s: host %d disable failed, %d\n", __func__, id, ret);
if (is_dual_panel && msm_dsi1) { if (is_dual_dsi && msm_dsi1) {
ret = msm_dsi_host_disable(msm_dsi1->host); ret = msm_dsi_host_disable(msm_dsi1->host);
if (ret) if (ret)
pr_err("%s: host1 disable failed, %d\n", __func__, ret); pr_err("%s: host1 disable failed, %d\n", __func__, ret);
...@@ -456,7 +456,7 @@ static void dsi_mgr_bridge_post_disable(struct drm_bridge *bridge) ...@@ -456,7 +456,7 @@ static void dsi_mgr_bridge_post_disable(struct drm_bridge *bridge)
if (ret) if (ret)
pr_err("%s: host %d power off failed,%d\n", __func__, id, ret); pr_err("%s: host %d power off failed,%d\n", __func__, id, ret);
if (is_dual_panel && msm_dsi1) { if (is_dual_dsi && msm_dsi1) {
ret = msm_dsi_host_power_off(msm_dsi1->host); ret = msm_dsi_host_power_off(msm_dsi1->host);
if (ret) if (ret)
pr_err("%s: host1 power off failed, %d\n", pr_err("%s: host1 power off failed, %d\n",
...@@ -472,7 +472,7 @@ static void dsi_mgr_bridge_mode_set(struct drm_bridge *bridge, ...@@ -472,7 +472,7 @@ static void dsi_mgr_bridge_mode_set(struct drm_bridge *bridge,
struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id); struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id);
struct msm_dsi *other_dsi = dsi_mgr_get_other_dsi(id); struct msm_dsi *other_dsi = dsi_mgr_get_other_dsi(id);
struct mipi_dsi_host *host = msm_dsi->host; struct mipi_dsi_host *host = msm_dsi->host;
bool is_dual_panel = IS_DUAL_PANEL(); bool is_dual_dsi = IS_DUAL_DSI();
DBG("set mode: %d:\"%s\" %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x", DBG("set mode: %d:\"%s\" %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x",
mode->base.id, mode->name, mode->base.id, mode->name,
...@@ -483,11 +483,11 @@ static void dsi_mgr_bridge_mode_set(struct drm_bridge *bridge, ...@@ -483,11 +483,11 @@ static void dsi_mgr_bridge_mode_set(struct drm_bridge *bridge,
mode->vsync_end, mode->vtotal, mode->vsync_end, mode->vtotal,
mode->type, mode->flags); mode->type, mode->flags);
if (is_dual_panel && (DSI_1 == id)) if (is_dual_dsi && (DSI_1 == id))
return; return;
msm_dsi_host_set_display_mode(host, adjusted_mode); msm_dsi_host_set_display_mode(host, adjusted_mode);
if (is_dual_panel && other_dsi) if (is_dual_dsi && other_dsi)
msm_dsi_host_set_display_mode(other_dsi->host, adjusted_mode); msm_dsi_host_set_display_mode(other_dsi->host, adjusted_mode);
} }
...@@ -610,7 +610,7 @@ int msm_dsi_manager_phy_enable(int id, ...@@ -610,7 +610,7 @@ int msm_dsi_manager_phy_enable(int id,
{ {
struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id); struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id);
struct msm_dsi_phy *phy = msm_dsi->phy; struct msm_dsi_phy *phy = msm_dsi->phy;
int src_pll_id = IS_DUAL_PANEL() ? DSI_CLOCK_MASTER : id; int src_pll_id = IS_DUAL_DSI() ? DSI_CLOCK_MASTER : id;
int ret; int ret;
ret = msm_dsi_phy_enable(phy, src_pll_id, bit_rate, esc_rate); ret = msm_dsi_phy_enable(phy, src_pll_id, bit_rate, esc_rate);
...@@ -635,7 +635,7 @@ void msm_dsi_manager_phy_disable(int id) ...@@ -635,7 +635,7 @@ void msm_dsi_manager_phy_disable(int id)
* first controller only when the second controller is disabled. * first controller only when the second controller is disabled.
*/ */
msm_dsi->phy_enabled = false; msm_dsi->phy_enabled = false;
if (IS_DUAL_PANEL() && mdsi && sdsi) { if (IS_DUAL_DSI() && mdsi && sdsi) {
if (!mdsi->phy_enabled && !sdsi->phy_enabled) { if (!mdsi->phy_enabled && !sdsi->phy_enabled) {
msm_dsi_phy_disable(sdsi->phy); msm_dsi_phy_disable(sdsi->phy);
msm_dsi_phy_disable(mdsi->phy); msm_dsi_phy_disable(mdsi->phy);
...@@ -726,9 +726,9 @@ int msm_dsi_manager_register(struct msm_dsi *msm_dsi) ...@@ -726,9 +726,9 @@ int msm_dsi_manager_register(struct msm_dsi *msm_dsi)
msm_dsim->dsi[id] = msm_dsi; msm_dsim->dsi[id] = msm_dsi;
ret = dsi_mgr_parse_dual_panel(msm_dsi->pdev->dev.of_node, id); ret = dsi_mgr_parse_dual_dsi(msm_dsi->pdev->dev.of_node, id);
if (ret) { if (ret) {
pr_err("%s: failed to parse dual panel info\n", __func__); pr_err("%s: failed to parse dual DSI info\n", __func__);
goto fail; goto fail;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment