drm/msm/dsi: convert to msm_clk_get()
authorRob Clark <robdclark@gmail.com>
Mon, 16 Oct 2017 17:35:57 +0000 (13:35 -0400)
committerRob Clark <robdclark@gmail.com>
Sat, 28 Oct 2017 15:01:33 +0000 (11:01 -0400)
We already have, as a result of upstreaming the gpu bindings,
msm_clk_get() which will try to get the clock both without and with a
"_clk" suffix.  Use this in DSI code so we can drop the "_clk" suffix
in bindings while maintaing backwards compatibility.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
drivers/gpu/drm/msm/dsi/dsi_cfg.c
drivers/gpu/drm/msm/dsi/dsi_host.c
drivers/gpu/drm/msm/dsi/phy/dsi_phy.c

index a5d75c9b3a737560b6d190182a7cb7a3837588ae..65c1dfbbe019623ff4da20def45c168586ffd80d 100644 (file)
@@ -14,7 +14,7 @@
 #include "dsi_cfg.h"
 
 static const char * const dsi_v2_bus_clk_names[] = {
-       "core_mmss_clk", "iface_clk", "bus_clk",
+       "core_mmss", "iface", "bus",
 };
 
 static const struct msm_dsi_config apq8064_dsi_cfg = {
@@ -34,7 +34,7 @@ static const struct msm_dsi_config apq8064_dsi_cfg = {
 };
 
 static const char * const dsi_6g_bus_clk_names[] = {
-       "mdp_core_clk", "iface_clk", "bus_clk", "core_mmss_clk",
+       "mdp_core", "iface", "bus", "core_mmss",
 };
 
 static const struct msm_dsi_config msm8974_apq8084_dsi_cfg = {
@@ -55,7 +55,7 @@ static const struct msm_dsi_config msm8974_apq8084_dsi_cfg = {
 };
 
 static const char * const dsi_8916_bus_clk_names[] = {
-       "mdp_core_clk", "iface_clk", "bus_clk",
+       "mdp_core", "iface", "bus",
 };
 
 static const struct msm_dsi_config msm8916_dsi_cfg = {
@@ -99,7 +99,7 @@ static const struct msm_dsi_config msm8994_dsi_cfg = {
  * without it too. Figure out why it doesn't enable and uncomment below
  */
 static const char * const dsi_8996_bus_clk_names[] = {
-       "mdp_core_clk", "iface_clk", "bus_clk", /* "core_mmss_clk", */
+       "mdp_core", "iface", "bus", /* "core_mmss", */
 };
 
 static const struct msm_dsi_config msm8996_dsi_cfg = {
index dbb31a0144194662a85f20ae0b77117ce071b901..50d437568d43b976ab652da29358c32367fb4e62 100644 (file)
@@ -334,46 +334,46 @@ static int dsi_regulator_init(struct msm_dsi_host *msm_host)
 
 static int dsi_clk_init(struct msm_dsi_host *msm_host)
 {
-       struct device *dev = &msm_host->pdev->dev;
+       struct platform_device *pdev = msm_host->pdev;
        const struct msm_dsi_cfg_handler *cfg_hnd = msm_host->cfg_hnd;
        const struct msm_dsi_config *cfg = cfg_hnd->cfg;
        int i, ret = 0;
 
        /* get bus clocks */
        for (i = 0; i < cfg->num_bus_clks; i++) {
-               msm_host->bus_clks[i] = devm_clk_get(dev,
+               msm_host->bus_clks[i] = msm_clk_get(pdev,
                                                cfg->bus_clk_names[i]);
                if (IS_ERR(msm_host->bus_clks[i])) {
                        ret = PTR_ERR(msm_host->bus_clks[i]);
-                       pr_err("%s: Unable to get %s, ret = %d\n",
+                       pr_err("%s: Unable to get %s clock, ret = %d\n",
                                __func__, cfg->bus_clk_names[i], ret);
                        goto exit;
                }
        }
 
        /* get link and source clocks */
-       msm_host->byte_clk = devm_clk_get(dev, "byte_clk");
+       msm_host->byte_clk = msm_clk_get(pdev, "byte");
        if (IS_ERR(msm_host->byte_clk)) {
                ret = PTR_ERR(msm_host->byte_clk);
-               pr_err("%s: can't find dsi_byte_clk. ret=%d\n",
+               pr_err("%s: can't find dsi_byte clock. ret=%d\n",
                        __func__, ret);
                msm_host->byte_clk = NULL;
                goto exit;
        }
 
-       msm_host->pixel_clk = devm_clk_get(dev, "pixel_clk");
+       msm_host->pixel_clk = msm_clk_get(pdev, "pixel");
        if (IS_ERR(msm_host->pixel_clk)) {
                ret = PTR_ERR(msm_host->pixel_clk);
-               pr_err("%s: can't find dsi_pixel_clk. ret=%d\n",
+               pr_err("%s: can't find dsi_pixel clock. ret=%d\n",
                        __func__, ret);
                msm_host->pixel_clk = NULL;
                goto exit;
        }
 
-       msm_host->esc_clk = devm_clk_get(dev, "core_clk");
+       msm_host->esc_clk = msm_clk_get(pdev, "core");
        if (IS_ERR(msm_host->esc_clk)) {
                ret = PTR_ERR(msm_host->esc_clk);
-               pr_err("%s: can't find dsi_esc_clk. ret=%d\n",
+               pr_err("%s: can't find dsi_esc clock. ret=%d\n",
                        __func__, ret);
                msm_host->esc_clk = NULL;
                goto exit;
@@ -382,22 +382,22 @@ static int dsi_clk_init(struct msm_dsi_host *msm_host)
        msm_host->byte_clk_src = clk_get_parent(msm_host->byte_clk);
        if (!msm_host->byte_clk_src) {
                ret = -ENODEV;
-               pr_err("%s: can't find byte_clk_src. ret=%d\n", __func__, ret);
+               pr_err("%s: can't find byte_clk clock. ret=%d\n", __func__, ret);
                goto exit;
        }
 
        msm_host->pixel_clk_src = clk_get_parent(msm_host->pixel_clk);
        if (!msm_host->pixel_clk_src) {
                ret = -ENODEV;
-               pr_err("%s: can't find pixel_clk_src. ret=%d\n", __func__, ret);
+               pr_err("%s: can't find pixel_clk clock. ret=%d\n", __func__, ret);
                goto exit;
        }
 
        if (cfg_hnd->major == MSM_DSI_VER_MAJOR_V2) {
-               msm_host->src_clk = devm_clk_get(dev, "src_clk");
+               msm_host->src_clk = msm_clk_get(pdev, "src");
                if (IS_ERR(msm_host->src_clk)) {
                        ret = PTR_ERR(msm_host->src_clk);
-                       pr_err("%s: can't find dsi_src_clk. ret=%d\n",
+                       pr_err("%s: can't find src clock. ret=%d\n",
                                __func__, ret);
                        msm_host->src_clk = NULL;
                        goto exit;
@@ -406,7 +406,7 @@ static int dsi_clk_init(struct msm_dsi_host *msm_host)
                msm_host->esc_clk_src = clk_get_parent(msm_host->esc_clk);
                if (!msm_host->esc_clk_src) {
                        ret = -ENODEV;
-                       pr_err("%s: can't get esc_clk_src. ret=%d\n",
+                       pr_err("%s: can't get esc clock parent. ret=%d\n",
                                __func__, ret);
                        goto exit;
                }
@@ -414,7 +414,7 @@ static int dsi_clk_init(struct msm_dsi_host *msm_host)
                msm_host->dsi_clk_src = clk_get_parent(msm_host->src_clk);
                if (!msm_host->dsi_clk_src) {
                        ret = -ENODEV;
-                       pr_err("%s: can't get dsi_clk_src. ret=%d\n",
+                       pr_err("%s: can't get src clock parent. ret=%d\n",
                                __func__, ret);
                }
        }
index 7c9bf91bc22b6dd20615cb9181bec1446e3f72be..790ca280cbfdf6a88e131d607db2074d7c18e889 100644 (file)
@@ -482,7 +482,7 @@ static int dsi_phy_driver_probe(struct platform_device *pdev)
                goto fail;
        }
 
-       phy->ahb_clk = devm_clk_get(dev, "iface_clk");
+       phy->ahb_clk = msm_clk_get(pdev, "iface");
        if (IS_ERR(phy->ahb_clk)) {
                dev_err(dev, "%s: Unable to get ahb clk\n", __func__);
                ret = PTR_ERR(phy->ahb_clk);