summaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorSandor Yu <R01008@freescale.com>2014-07-23 11:01:08 +0800
committerNitin Garg <nitin.garg@freescale.com>2015-09-17 09:20:05 -0500
commit5dd1803bebdb393d5e7c68d9ec1f611364b8ba00 (patch)
tree59c1b4fedb04c803abf09684607cc0b4e14d6f10 /drivers/mfd
parent3ac64f34cc40540f8405ee2167a540145507efea (diff)
ENGR00323271-02 hdmi: Add mipi core clock to hdmi drivers
HDMI isfr clock source from video 27M clock. There are one clock gate control of video27m_root in CCM, ccm_video27m_root_cg = ((lpcg_mipi_core_cfg_clk_enable_clock_root | lpcg_mipi_core_pll_refclk_enable_clock_root) | lpcg_vpu_rclk_enable_clock_root); The video 27M clock depend on vpu clock or mipi core clock. In mx6 chip, vpu can been disabled by fuse, so for vpu disabled case, mipi core clock should enabled and make sure 27M clock on. Add mipi core clock management in hdmi drivers to support vpu disabled case. Signed-off-by: Sandor Yu <R01008@freescale.com> (cherry picked from commit 32c8b60e0509300b504795ec96488242bbb11d3b)
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/mxc-hdmi-core.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/mfd/mxc-hdmi-core.c b/drivers/mfd/mxc-hdmi-core.c
index 29d43f9a085c..4cdf2dc15300 100644
--- a/drivers/mfd/mxc-hdmi-core.c
+++ b/drivers/mfd/mxc-hdmi-core.c
@@ -51,6 +51,7 @@ struct mxc_hdmi_data {
static void __iomem *hdmi_base;
static struct clk *isfr_clk;
static struct clk *iahb_clk;
+static struct clk *mipi_core_clk;
static spinlock_t irq_spinlock;
static spinlock_t edid_spinlock;
static unsigned int sample_rate;
@@ -666,18 +667,32 @@ static int mxc_hdmi_core_probe(struct platform_device *pdev)
hdmi_abort_state = 0;
spin_unlock_irqrestore(&hdmi_audio_lock, flags);
+ mipi_core_clk = clk_get(&hdmi_data->pdev->dev, "mipi_core");
+ if (IS_ERR(mipi_core_clk)) {
+ ret = PTR_ERR(mipi_core_clk);
+ dev_err(&hdmi_data->pdev->dev,
+ "Unable to get mipi core clk: %d\n", ret);
+ goto eclkg;
+ }
+
+ ret = clk_prepare_enable(mipi_core_clk);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "Cannot enable mipi core clock: %d\n", ret);
+ goto eclke;
+ }
+
isfr_clk = clk_get(&hdmi_data->pdev->dev, "hdmi_isfr");
if (IS_ERR(isfr_clk)) {
ret = PTR_ERR(isfr_clk);
dev_err(&hdmi_data->pdev->dev,
"Unable to get HDMI isfr clk: %d\n", ret);
- goto eclkg;
+ goto eclkg1;
}
ret = clk_prepare_enable(isfr_clk);
if (ret < 0) {
dev_err(&pdev->dev, "Cannot enable HDMI clock: %d\n", ret);
- goto eclke;
+ goto eclke1;
}
pr_debug("%s isfr_clk:%d\n", __func__,
@@ -720,6 +735,7 @@ static int mxc_hdmi_core_probe(struct platform_device *pdev)
/* Disable HDMI clocks until video/audio sub-drivers are initialized */
clk_disable_unprepare(isfr_clk);
clk_disable_unprepare(iahb_clk);
+ clk_disable_unprepare(mipi_core_clk);
/* Replace platform data coming in with a local struct */
platform_set_drvdata(pdev, hdmi_data);
@@ -734,8 +750,12 @@ eclke2:
clk_put(iahb_clk);
eclkg2:
clk_disable_unprepare(isfr_clk);
-eclke:
+eclke1:
clk_put(isfr_clk);
+eclkg1:
+ clk_disable_unprepare(mipi_core_clk);
+eclke:
+ clk_put(mipi_core_clk);
eclkg:
return ret;
}