]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commitdiff
soc/tegra: edp: Update CPU EDP clock handling
authorJon Hunter <jonathanh@nvidia.com>
Wed, 14 Dec 2016 12:05:44 +0000 (12:05 +0000)
committermobile promotions <svcmobile_promotions@nvidia.com>
Thu, 15 Dec 2016 19:35:03 +0000 (11:35 -0800)
Update the CPU EDP driver to use device-tree to lookup the CPU clock
instead of using the legacy clk_get_sys() API.

Bug 1811732

Change-Id: I02242052a2a8821892f708e6c6cb2fe71950dbd3
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: http://git-master/r/1271034
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
drivers/soc/tegra/tegra-cpu-edp.c

index 41c52d331a2dfdc4b9fbf8bd639b75178f32bc3d..5fd659a234fe0a586722baf9a8ea8e6eadbb23a2 100644 (file)
@@ -37,7 +37,6 @@
 #include <soc/tegra/tegra-ppm.h>
 
 struct cpu_edp_platform_data {
-       char *clk_name;
        int n_caps;
        int freq_step;
        int reg_edp;
@@ -433,7 +432,12 @@ static int tegra_cpu_edp_probe(struct platform_device *pdev)
 
        mutex_init(&ctx->edp_lock);
 
-       cpu_clk = clk_get_sys(NULL, "cclk_g");
+       cpu_clk = devm_clk_get(&pdev->dev, "cpu-edp");
+       if (IS_ERR(cpu_clk)) {
+               dev_err(&pdev->dev, "Failed to get 'cpu-edp' clock\n");
+               return PTR_ERR(cpu_clk);
+       }
+
        fv = fv_relation_create(cpu_clk, ctx->pdata.freq_step, 220,
                                tegra_edp_get_max_cpu_freq(), 0,
                                tegra_cpu_edp_predict_millivolts);