drm/exynos: add mout_hdmi clock in hdmi driver to change parent
authorRahul Sharma <rahul.sharma@samsung.com>
Tue, 11 Jun 2013 06:54:03 +0000 (12:24 +0530)
committerInki Dae <daeinki@gmail.com>
Fri, 28 Jun 2013 12:13:56 +0000 (21:13 +0900)
HDMI driver needs to configure the mout_hdmi mux clock to change
the parent between sclk_hdmiphy and sclk_pixel.

Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drivers/gpu/drm/exynos/exynos_hdmi.c

index 83bd496ca6a3faec875809cc6083b85a2b58feb1..ce13a23a8274cc0ef6f3518d66529d9b908a7758 100644 (file)
@@ -83,6 +83,7 @@ struct hdmi_resources {
        struct clk                      *sclk_pixel;
        struct clk                      *sclk_hdmiphy;
        struct clk                      *hdmiphy;
+       struct clk                      *mout_hdmi;
        struct regulator_bulk_data      *regul_bulk;
        int                             regul_count;
 };
@@ -1112,7 +1113,7 @@ static void hdmi_v13_mode_apply(struct hdmi_context *hdata)
        }
 
        clk_disable_unprepare(hdata->res.sclk_hdmi);
-       clk_set_parent(hdata->res.sclk_hdmi, hdata->res.sclk_hdmiphy);
+       clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_hdmiphy);
        clk_prepare_enable(hdata->res.sclk_hdmi);
 
        /* enable HDMI and timing generator */
@@ -1279,7 +1280,7 @@ static void hdmi_v14_mode_apply(struct hdmi_context *hdata)
        }
 
        clk_disable_unprepare(hdata->res.sclk_hdmi);
-       clk_set_parent(hdata->res.sclk_hdmi, hdata->res.sclk_hdmiphy);
+       clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_hdmiphy);
        clk_prepare_enable(hdata->res.sclk_hdmi);
 
        /* enable HDMI and timing generator */
@@ -1305,7 +1306,7 @@ static void hdmiphy_conf_reset(struct hdmi_context *hdata)
        u32 reg;
 
        clk_disable_unprepare(hdata->res.sclk_hdmi);
-       clk_set_parent(hdata->res.sclk_hdmi, hdata->res.sclk_pixel);
+       clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_pixel);
        clk_prepare_enable(hdata->res.sclk_hdmi);
 
        /* operation mode */
@@ -1812,8 +1813,13 @@ static int hdmi_resources_init(struct hdmi_context *hdata)
                DRM_ERROR("failed to get clock 'hdmiphy'\n");
                goto fail;
        }
+       res->mout_hdmi = devm_clk_get(dev, "mout_hdmi");
+       if (IS_ERR(res->mout_hdmi)) {
+               DRM_ERROR("failed to get clock 'mout_hdmi'\n");
+               goto fail;
+       }
 
-       clk_set_parent(res->sclk_hdmi, res->sclk_pixel);
+       clk_set_parent(res->mout_hdmi, res->sclk_pixel);
 
        res->regul_bulk = devm_kzalloc(dev, ARRAY_SIZE(supply) *
                sizeof(res->regul_bulk[0]), GFP_KERNEL);