drm/msm/dsi: Rename *dual panel* to *dual DSI*
authorHai Li <hali@codeaurora.org>
Wed, 10 Jun 2015 17:18:18 +0000 (13:18 -0400)
committerRob Clark <robdclark@gmail.com>
Sat, 15 Aug 2015 22:27:11 +0000 (18:27 -0400)
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: Hai Li <hali@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Documentation/devicetree/bindings/drm/msm/dsi.txt
drivers/gpu/drm/msm/dsi/dsi_manager.c

index cd8fe6c..6ccd860 100644 (file)
@@ -30,11 +30,11 @@ Optional properties:
 - panel@0: Node of panel connected to this DSI controller.
   See files in Documentation/devicetree/bindings/panel/ for each supported
   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.
-- 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.
-- 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.
 - interrupt-parent: phandle to the MDP block if the interrupt signal is routed
   through MDP block
@@ -90,9 +90,9 @@ Example:
 
                qcom,dsi-phy = <&mdss_dsi_phy0>;
 
-               qcom,dual-panel-mode;
-               qcom,master-panel;
-               qcom,sync-dual-panel;
+               qcom,dual-dsi-mode;
+               qcom,master-dsi;
+               qcom,sync-dual-dsi;
 
                panel: panel@0 {
                        compatible = "sharp,lq101r1sx01";
index cfa632f..bd247b7 100644 (file)
 struct msm_dsi_manager {
        struct msm_dsi *dsi[DSI_MAX];
 
-       bool is_dual_panel;
+       bool is_dual_dsi;
        bool is_sync_needed;
-       int master_panel_id;
+       int master_dsi_link_id;
 };
 
 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_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)
 {
@@ -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];
 }
 
-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;
 
-       /* 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.
         */
-       if (!msm_dsim->is_dual_panel)
-               msm_dsim->is_dual_panel = of_property_read_bool(
-                                               np, "qcom,dual-panel-mode");
+       if (!msm_dsim->is_dual_dsi)
+               msm_dsim->is_dual_dsi = of_property_read_bool(
+                                               np, "qcom,dual-dsi-mode");
 
-       if (msm_dsim->is_dual_panel) {
-               if (of_property_read_bool(np, "qcom,master-panel"))
-                       msm_dsim->master_panel_id = id;
+       if (msm_dsim->is_dual_dsi) {
+               if (of_property_read_bool(np, "qcom,master-dsi"))
+                       msm_dsim->master_dsi_link_id = id;
                if (!msm_dsim->is_sync_needed)
                        msm_dsim->is_sync_needed = of_property_read_bool(
-                                       np, "qcom,sync-dual-panel");
+                                       np, "qcom,sync-dual-dsi");
        }
 
        return 0;
@@ -80,7 +80,7 @@ static int dsi_mgr_host_register(int id)
        struct msm_dsi_pll *src_pll;
        int ret;
 
-       if (!IS_DUAL_PANEL()) {
+       if (!IS_DUAL_DSI()) {
                ret = msm_dsi_host_register(msm_dsi->host, true);
                if (ret)
                        return ret;
@@ -90,9 +90,9 @@ static int dsi_mgr_host_register(int id)
        } else if (!other_dsi) {
                ret = 0;
        } else {
-               struct msm_dsi *mdsi = IS_MASTER_PANEL(id) ?
+               struct msm_dsi *mdsi = IS_MASTER_DSI_LINK(id) ?
                                        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;
                /* Register slave host first, so that slave DSI device
                 * has a chance to probe, and do not block the master
@@ -159,23 +159,23 @@ static enum drm_connector_status dsi_mgr_connector_detect(
                                                &msm_dsi->panel_flags);
 
                /* 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
                 * keep using the panel flags got from the current DSI link.
                 */
-               if (!msm_dsi->panel && IS_DUAL_PANEL() &&
-                       !IS_MASTER_PANEL(id) && other_dsi)
+               if (!msm_dsi->panel && IS_DUAL_DSI() &&
+                       !IS_MASTER_DSI_LINK(id) && other_dsi)
                        msm_dsi->panel = msm_dsi_host_get_panel(
                                        other_dsi->host, NULL);
 
-               if (msm_dsi->panel && IS_DUAL_PANEL())
+               if (msm_dsi->panel && IS_DUAL_DSI())
                        drm_object_attach_property(&connector->base,
                                connector->dev->mode_config.tile_property, 0);
 
-               /* Set split display info to kms once dual panel is connected
-                * to both hosts
+               /* Set split display info to kms once dual DSI panel is
+                * connected to both hosts.
                 */
-               if (msm_dsi->panel && IS_DUAL_PANEL() &&
+               if (msm_dsi->panel && IS_DUAL_DSI() &&
                        other_dsi && other_dsi->panel) {
                        bool cmd_mode = !(msm_dsi->panel_flags &
                                                MIPI_DSI_MODE_VIDEO);
@@ -188,7 +188,7 @@ static enum drm_connector_status dsi_mgr_connector_detect(
                                kms->funcs->set_split_display(kms, encoder,
                                                        slave_enc, cmd_mode);
                        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)
        if (!num)
                return 0;
 
-       if (IS_DUAL_PANEL()) {
+       if (IS_DUAL_DSI()) {
                /* report half resolution to user */
                dsi_dual_connector_fix_modes(connector);
                ret = dsi_dual_connector_tile_init(connector, id);
@@ -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 mipi_dsi_host *host = msm_dsi->host;
        struct drm_panel *panel = msm_dsi->panel;
-       bool is_dual_panel = IS_DUAL_PANEL();
+       bool is_dual_dsi = IS_DUAL_DSI();
        int ret;
 
        DBG("id=%d", id);
-       if (!panel || (is_dual_panel && (DSI_1 == id)))
+       if (!panel || (is_dual_dsi && (DSI_1 == id)))
                return;
 
        ret = msm_dsi_host_power_on(host);
@@ -353,7 +353,7 @@ static void dsi_mgr_bridge_pre_enable(struct drm_bridge *bridge)
                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);
                if (ret) {
                        pr_err("%s: power on host1 failed, %d\n",
@@ -377,7 +377,7 @@ static void dsi_mgr_bridge_pre_enable(struct drm_bridge *bridge)
                goto host_en_fail;
        }
 
-       if (is_dual_panel && msm_dsi1) {
+       if (is_dual_dsi && msm_dsi1) {
                ret = msm_dsi_host_enable(msm_dsi1->host);
                if (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)
        return;
 
 panel_en_fail:
-       if (is_dual_panel && msm_dsi1)
+       if (is_dual_dsi && msm_dsi1)
                msm_dsi_host_disable(msm_dsi1->host);
 host1_en_fail:
        msm_dsi_host_disable(host);
 host_en_fail:
        drm_panel_unprepare(panel);
 panel_prep_fail:
-       if (is_dual_panel && msm_dsi1)
+       if (is_dual_dsi && msm_dsi1)
                msm_dsi_host_power_off(msm_dsi1->host);
 host1_on_fail:
        msm_dsi_host_power_off(host);
@@ -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 mipi_dsi_host *host = msm_dsi->host;
        struct drm_panel *panel = msm_dsi->panel;
-       bool is_dual_panel = IS_DUAL_PANEL();
+       bool is_dual_dsi = IS_DUAL_DSI();
        int ret;
 
        DBG("id=%d", id);
 
-       if (!panel || (is_dual_panel && (DSI_1 == id)))
+       if (!panel || (is_dual_dsi && (DSI_1 == id)))
                return;
 
        ret = drm_panel_disable(panel);
@@ -442,7 +442,7 @@ static void dsi_mgr_bridge_post_disable(struct drm_bridge *bridge)
        if (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);
                if (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)
        if (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);
                if (ret)
                        pr_err("%s: host1 power off failed, %d\n",
@@ -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 *other_dsi = dsi_mgr_get_other_dsi(id);
        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",
                        mode->base.id, mode->name,
@@ -483,11 +483,11 @@ static void dsi_mgr_bridge_mode_set(struct drm_bridge *bridge,
                        mode->vsync_end, mode->vtotal,
                        mode->type, mode->flags);
 
-       if (is_dual_panel && (DSI_1 == id))
+       if (is_dual_dsi && (DSI_1 == id))
                return;
 
        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);
 }
 
@@ -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_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;
 
        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)
         * first controller only when the second controller is disabled.
         */
        msm_dsi->phy_enabled = false;
-       if (IS_DUAL_PANEL() && mdsi && sdsi) {
+       if (IS_DUAL_DSI() && mdsi && sdsi) {
                if (!mdsi->phy_enabled && !sdsi->phy_enabled) {
                        msm_dsi_phy_disable(sdsi->phy);
                        msm_dsi_phy_disable(mdsi->phy);
@@ -726,9 +726,9 @@ int msm_dsi_manager_register(struct msm_dsi *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) {
-               pr_err("%s: failed to parse dual panel info\n", __func__);
+               pr_err("%s: failed to parse dual DSI info\n", __func__);
                goto fail;
        }