From c32aa0170d258f6db5252cc319a58b626bd8f7e0 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Mon, 22 May 2017 12:19:38 +0530 Subject: gpu: nvgpu: remove clk_common.c clk/clk_common.c includes some linux specific clock calls which can be easily replaced Move linux specific call to platform file Rest of the APIs are removed by directly substituting API code into caller function Jira NVGPU-49 Change-Id: Ia70e7a65c877649699b5d064683c34c0cb696d2e Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1483862 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/clk/clk_common.c | 62 -------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 drivers/gpu/nvgpu/clk/clk_common.c (limited to 'drivers/gpu/nvgpu/clk/clk_common.c') diff --git a/drivers/gpu/nvgpu/clk/clk_common.c b/drivers/gpu/nvgpu/clk/clk_common.c deleted file mode 100644 index 0704ba2b..00000000 --- a/drivers/gpu/nvgpu/clk/clk_common.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2011-2016, NVIDIA CORPORATION. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include - -#include "gk20a/gk20a.h" -#include "gk20a/platform_gk20a.h" - -struct clk *gk20a_clk_get(struct gk20a *g) -{ - if (!g->clk.tegra_clk) { - struct clk *clk; - char clk_dev_id[32]; - struct device *dev = dev_from_gk20a(g); - - snprintf(clk_dev_id, 32, "tegra_%s", dev_name(dev)); - - clk = clk_get_sys(clk_dev_id, "gpu"); - if (IS_ERR(clk)) { - nvgpu_err(g, "fail to get tegra gpu clk %s/gpu\n", - clk_dev_id); - return NULL; - } - g->clk.tegra_clk = clk; - } - - return g->clk.tegra_clk; -} - -unsigned long gk20a_clk_get_rate(struct gk20a *g) -{ - struct clk_gk20a *clk = &g->clk; - return rate_gpc2clk_to_gpu(clk->gpc_pll.freq); -} - -long gk20a_clk_round_rate(struct gk20a *g, unsigned long rate) -{ - /* make sure the clock is available */ - if (!gk20a_clk_get(g)) - return rate; - - return clk_round_rate(clk_get_parent(g->clk.tegra_clk), rate); -} - -int gk20a_clk_set_rate(struct gk20a *g, unsigned long rate) -{ - return clk_set_rate(g->clk.tegra_clk, rate); -} - -- cgit v1.2.2