From 1c7258411da89aea5279e9a8d117479928f8bf64 Mon Sep 17 00:00:00 2001 From: ddutta Date: Fri, 14 Sep 2018 10:48:48 +0530 Subject: gpu: nvgpu: expose linux clock controls via HAL Expose the linux specific clock implementations via the HAL interface to allow nvgpu to use the controls globally. This patch does the following. 1) Implement a new ops interface and a corresponding linux specific implementation for allowing nvgpu to iterate through a list of available clock frequencies via nvgpu_linux_clk_get_f_points(). 2) Implement nvgpu_linux_clk_get_range(). Bug 2061372 Change-Id: I7ce9a999dbdcd9fafcc84301af148545f6ca97a9 Signed-off-by: Debarshi Dutta Reviewed-on: https://git-master.nvidia.com/r/1774280 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c index 1b4a5456..b055eb6e 100644 --- a/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c @@ -97,6 +97,8 @@ static int gv11b_tegra_probe(struct device *dev) gp10b_tegra_get_clocks(dev); nvgpu_linux_init_clk_support(platform->g); + nvgpu_mutex_init(&platform->clk_get_freq_lock); + return 0; } @@ -108,12 +110,16 @@ static int gv11b_tegra_late_probe(struct device *dev) static int gv11b_tegra_remove(struct device *dev) { + struct gk20a_platform *platform = gk20a_get_platform(dev); + gv11b_tegra_scale_exit(dev); #ifdef CONFIG_TEGRA_GK20A_NVHOST nvgpu_free_nvhost_dev(get_gk20a(dev)); #endif + nvgpu_mutex_destroy(&platform->clk_get_freq_lock); + return 0; } -- cgit v1.2.2