summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/clk_gk20a.c
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2014-07-22 21:28:43 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:10:33 -0400
commitb972f8d15eca74d91b932f16b09aacb893e110a8 (patch)
tree963e0db5aed91b077df7c48ede5b1bbbdf5b6f52 /drivers/gpu/nvgpu/gk20a/clk_gk20a.c
parent10571e9db77f47fb50a8a2ebee820966a8c72b87 (diff)
gpu: nvgpu: Init clock debugfs after clock support
Initialized GK20A clock debugfs after clock support hardware and software are ready. Bug 1450787 Change-Id: I8ec2ef303a84b9151b7ce209a1864f1729382a44 Signed-off-by: Alex Frid <afrid@nvidia.com> Reviewed-on: http://git-master/r/440973 Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/clk_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/clk_gk20a.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/clk_gk20a.c b/drivers/gpu/nvgpu/gk20a/clk_gk20a.c
index abb9e98a..30f2b4ed 100644
--- a/drivers/gpu/nvgpu/gk20a/clk_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/clk_gk20a.c
@@ -42,6 +42,10 @@ struct pll_parms gpc_pll_params = {
42 1, 32, /* PL */ 42 1, 32, /* PL */
43}; 43};
44 44
45#ifdef CONFIG_DEBUG_FS
46static int clk_gk20a_debugfs_init(struct gk20a *g);
47#endif
48
45static u8 pl_to_div[] = { 49static u8 pl_to_div[] = {
46/* PL: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 */ 50/* PL: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 */
47/* p: */ 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 12, 16, 20, 24, 32 }; 51/* p: */ 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 12, 16, 20, 24, 32 };
@@ -661,6 +665,12 @@ int gk20a_init_clk_support(struct gk20a *g)
661 if (err) 665 if (err)
662 return err; 666 return err;
663 667
668#ifdef CONFIG_DEBUG_FS
669 if (!clk->debugfs_set) {
670 if (!clk_gk20a_debugfs_init(g))
671 clk->debugfs_set = true;
672 }
673#endif
664 return err; 674 return err;
665} 675}
666 676
@@ -800,11 +810,10 @@ static int monitor_get(void *data, u64 *val)
800} 810}
801DEFINE_SIMPLE_ATTRIBUTE(monitor_fops, monitor_get, NULL, "%llu\n"); 811DEFINE_SIMPLE_ATTRIBUTE(monitor_fops, monitor_get, NULL, "%llu\n");
802 812
803int clk_gk20a_debugfs_init(struct platform_device *dev) 813static int clk_gk20a_debugfs_init(struct gk20a *g)
804{ 814{
805 struct dentry *d; 815 struct dentry *d;
806 struct gk20a_platform *platform = platform_get_drvdata(dev); 816 struct gk20a_platform *platform = platform_get_drvdata(g->dev);
807 struct gk20a *g = get_gk20a(dev);
808 817
809 d = debugfs_create_file( 818 d = debugfs_create_file(
810 "rate", S_IRUGO|S_IWUSR, platform->debugfs, g, &rate_fops); 819 "rate", S_IRUGO|S_IWUSR, platform->debugfs, g, &rate_fops);