diff options
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/clk_gk20a.c | 15 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/clk_gk20a.h | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 4 |
4 files changed, 13 insertions, 9 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 | ||
46 | static int clk_gk20a_debugfs_init(struct gk20a *g); | ||
47 | #endif | ||
48 | |||
45 | static u8 pl_to_div[] = { | 49 | static 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 | } |
801 | DEFINE_SIMPLE_ATTRIBUTE(monitor_fops, monitor_get, NULL, "%llu\n"); | 811 | DEFINE_SIMPLE_ATTRIBUTE(monitor_fops, monitor_get, NULL, "%llu\n"); |
802 | 812 | ||
803 | int clk_gk20a_debugfs_init(struct platform_device *dev) | 813 | static 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); |
diff --git a/drivers/gpu/nvgpu/gk20a/clk_gk20a.h b/drivers/gpu/nvgpu/gk20a/clk_gk20a.h index f6cdd272..950034a4 100644 --- a/drivers/gpu/nvgpu/gk20a/clk_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/clk_gk20a.h | |||
@@ -56,6 +56,7 @@ struct clk_gk20a { | |||
56 | struct mutex clk_mutex; | 56 | struct mutex clk_mutex; |
57 | bool sw_ready; | 57 | bool sw_ready; |
58 | bool clk_hw_on; | 58 | bool clk_hw_on; |
59 | bool debugfs_set; | ||
59 | }; | 60 | }; |
60 | 61 | ||
61 | int gk20a_init_clk_support(struct gk20a *g); | 62 | int gk20a_init_clk_support(struct gk20a *g); |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index b0aef022..fb4e0886 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -1502,8 +1502,6 @@ static int gk20a_probe(struct platform_device *dev) | |||
1502 | gk20a_create_sysfs(dev); | 1502 | gk20a_create_sysfs(dev); |
1503 | 1503 | ||
1504 | #ifdef CONFIG_DEBUG_FS | 1504 | #ifdef CONFIG_DEBUG_FS |
1505 | clk_gk20a_debugfs_init(dev); | ||
1506 | |||
1507 | spin_lock_init(&gk20a->debugfs_lock); | 1505 | spin_lock_init(&gk20a->debugfs_lock); |
1508 | gk20a->mm.ltc_enabled = true; | 1506 | gk20a->mm.ltc_enabled = true; |
1509 | gk20a->mm.ltc_enabled_debug = true; | 1507 | gk20a->mm.ltc_enabled_debug = true; |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 0b91420b..57cc338c 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -591,10 +591,6 @@ static inline int support_gk20a_pmu(void){return 0;} | |||
591 | 591 | ||
592 | void gk20a_create_sysfs(struct platform_device *dev); | 592 | void gk20a_create_sysfs(struct platform_device *dev); |
593 | 593 | ||
594 | #ifdef CONFIG_DEBUG_FS | ||
595 | int clk_gk20a_debugfs_init(struct platform_device *dev); | ||
596 | #endif | ||
597 | |||
598 | #define GK20A_BAR0_IORESOURCE_MEM 0 | 594 | #define GK20A_BAR0_IORESOURCE_MEM 0 |
599 | #define GK20A_BAR1_IORESOURCE_MEM 1 | 595 | #define GK20A_BAR1_IORESOURCE_MEM 1 |
600 | #define GK20A_SIM_IORESOURCE_MEM 2 | 596 | #define GK20A_SIM_IORESOURCE_MEM 2 |