MLK-18355-4: imx hdp: Get cec clk div from SW_CLK_H register
authorSandor Yu <Sandor.yu@nxp.com>
Fri, 18 May 2018 07:29:43 +0000 (15:29 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
Remove get core clock rate code,
get cec clk div from HDMI SW_CLK_H register.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
drivers/gpu/drm/imx/hdp/imx-hdp.c
drivers/mxc/hdp-cec/imx-hdp-cec.c
drivers/mxc/hdp-cec/imx-hdp-cec.h

index 325473d..83bfb8a 100644 (file)
@@ -77,12 +77,14 @@ static void imx_hdp_state_init(struct imx_hdp *hdp)
 #ifdef CONFIG_IMX_HDP_CEC
 static void imx_hdp_cec_init(struct imx_hdp *hdp)
 {
+       state_struct *state = &hdp->state;
        struct imx_cec_dev *cec = &hdp->cec;
+       u32 clk_MHz;
 
        memset(cec, 0, sizeof(struct imx_cec_dev));
 
-       if (hdp->clks.clk_core)
-               cec->clk_core = hdp->clks.clk_core;
+       CDN_API_GetClock(state, &clk_MHz);
+       cec->clk_div = clk_MHz * 10;
        cec->dev = hdp->dev;
        cec->mem = &hdp->mem;
        cec->rw = hdp->rw;
index 8d23c5a..e1aea1f 100644 (file)
@@ -272,13 +272,6 @@ int imx_cec_register(struct imx_cec_dev *cec)
        struct device *dev = cec->dev;
        int ret;
 
-       /* Set CEC clock divider */
-       if (cec->clk_core)
-               cec->clk_div = clk_get_rate(cec->clk_core) / 100000;
-       else
-               /* Default HDMI core clock rate 133MHz */
-               cec->clk_div = 1330;
-
        cec->adap = cec_allocate_adapter(&imx_cec_adap_ops, cec,
                                         CEC_NAME,
                                         CEC_CAP_PHYS_ADDR | CEC_CAP_LOG_ADDRS |
index 4a7593a..42a06b9 100644 (file)
@@ -336,7 +336,6 @@ struct imx_cec_dev {
        struct task_struct *cec_worker;
 
        /* inited by HDP controller driver */
-       struct clk *clk_core;
        struct hdp_mem *mem;
        struct hdp_rw_func *rw;
 };