Commit db9a3750 authored by Rob Clark's avatar Rob Clark

drm/msm/dsi: convert to msm_clk_get()

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: default avatarRob Clark <robdclark@gmail.com>
Reviewed-by: default avatarSean Paul <seanpaul@chromium.org>
parent e9acce2b
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "dsi_cfg.h" #include "dsi_cfg.h"
static const char * const dsi_v2_bus_clk_names[] = { 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 = { static const struct msm_dsi_config apq8064_dsi_cfg = {
...@@ -34,7 +34,7 @@ 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[] = { 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 = { static const struct msm_dsi_config msm8974_apq8084_dsi_cfg = {
...@@ -55,7 +55,7 @@ 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[] = { 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 = { static const struct msm_dsi_config msm8916_dsi_cfg = {
...@@ -99,7 +99,7 @@ static const struct msm_dsi_config msm8994_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 * without it too. Figure out why it doesn't enable and uncomment below
*/ */
static const char * const dsi_8996_bus_clk_names[] = { 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 = { static const struct msm_dsi_config msm8996_dsi_cfg = {
......
...@@ -334,46 +334,46 @@ static int dsi_regulator_init(struct msm_dsi_host *msm_host) ...@@ -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) 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_cfg_handler *cfg_hnd = msm_host->cfg_hnd;
const struct msm_dsi_config *cfg = cfg_hnd->cfg; const struct msm_dsi_config *cfg = cfg_hnd->cfg;
int i, ret = 0; int i, ret = 0;
/* get bus clocks */ /* get bus clocks */
for (i = 0; i < cfg->num_bus_clks; i++) { 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]); cfg->bus_clk_names[i]);
if (IS_ERR(msm_host->bus_clks[i])) { if (IS_ERR(msm_host->bus_clks[i])) {
ret = PTR_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); __func__, cfg->bus_clk_names[i], ret);
goto exit; goto exit;
} }
} }
/* get link and source clocks */ /* 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)) { if (IS_ERR(msm_host->byte_clk)) {
ret = PTR_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); __func__, ret);
msm_host->byte_clk = NULL; msm_host->byte_clk = NULL;
goto exit; 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)) { if (IS_ERR(msm_host->pixel_clk)) {
ret = PTR_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); __func__, ret);
msm_host->pixel_clk = NULL; msm_host->pixel_clk = NULL;
goto exit; 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)) { if (IS_ERR(msm_host->esc_clk)) {
ret = PTR_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); __func__, ret);
msm_host->esc_clk = NULL; msm_host->esc_clk = NULL;
goto exit; goto exit;
...@@ -382,22 +382,22 @@ static int dsi_clk_init(struct msm_dsi_host *msm_host) ...@@ -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); msm_host->byte_clk_src = clk_get_parent(msm_host->byte_clk);
if (!msm_host->byte_clk_src) { if (!msm_host->byte_clk_src) {
ret = -ENODEV; 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; goto exit;
} }
msm_host->pixel_clk_src = clk_get_parent(msm_host->pixel_clk); msm_host->pixel_clk_src = clk_get_parent(msm_host->pixel_clk);
if (!msm_host->pixel_clk_src) { if (!msm_host->pixel_clk_src) {
ret = -ENODEV; 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; goto exit;
} }
if (cfg_hnd->major == MSM_DSI_VER_MAJOR_V2) { 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)) { if (IS_ERR(msm_host->src_clk)) {
ret = PTR_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); __func__, ret);
msm_host->src_clk = NULL; msm_host->src_clk = NULL;
goto exit; goto exit;
...@@ -406,7 +406,7 @@ static int dsi_clk_init(struct msm_dsi_host *msm_host) ...@@ -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); msm_host->esc_clk_src = clk_get_parent(msm_host->esc_clk);
if (!msm_host->esc_clk_src) { if (!msm_host->esc_clk_src) {
ret = -ENODEV; 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); __func__, ret);
goto exit; goto exit;
} }
...@@ -414,7 +414,7 @@ static int dsi_clk_init(struct msm_dsi_host *msm_host) ...@@ -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); msm_host->dsi_clk_src = clk_get_parent(msm_host->src_clk);
if (!msm_host->dsi_clk_src) { if (!msm_host->dsi_clk_src) {
ret = -ENODEV; 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); __func__, ret);
} }
} }
......
...@@ -482,7 +482,7 @@ static int dsi_phy_driver_probe(struct platform_device *pdev) ...@@ -482,7 +482,7 @@ static int dsi_phy_driver_probe(struct platform_device *pdev)
goto fail; 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)) { if (IS_ERR(phy->ahb_clk)) {
dev_err(dev, "%s: Unable to get ahb clk\n", __func__); dev_err(dev, "%s: Unable to get ahb clk\n", __func__);
ret = PTR_ERR(phy->ahb_clk); ret = PTR_ERR(phy->ahb_clk);
......
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