vpu: optimize get_vpu_clk with clktree api
authorEvoke Zhang <evoke.zhang@amlogic.com>
Mon, 26 Feb 2018 07:05:15 +0000 (15:05 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Fri, 2 Mar 2018 07:07:51 +0000 (15:07 +0800)
PD#156734: vpu: optimize get_vpu_clk with clktree api
use clk_hw_get_rate instead of clk_get_rate.

Change-Id: Ib2d72c04d4df9acbacf06d189bbbce378f582716
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
drivers/amlogic/media/common/vpu/vpu.c

index 0323231..6ee49c2 100644 (file)
@@ -149,6 +149,7 @@ unsigned int get_vpu_clk(void)
        unsigned int clk_freq;
        unsigned int clk_source, div;
        unsigned int mux_id;
+       struct clk_hw *hw;
 
        if (IS_ERR_OR_NULL(vpu_conf.vpu_clk)) {
                VPUERR("%s: vpu_clk\n", __func__);
@@ -174,7 +175,8 @@ unsigned int get_vpu_clk(void)
                return clk_freq;
        }
 
-       clk_freq = clk_get_rate(vpu_conf.vpu_clk);
+       hw = __clk_get_hw(vpu_conf.vpu_clk);
+       clk_freq = clk_hw_get_rate(hw);
        return clk_freq;
 }