summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/therm
diff options
context:
space:
mode:
authorNitin Kumbhar <nkumbhar@nvidia.com>2018-08-13 00:39:04 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-09-05 07:51:43 -0400
commitbcdac829f44afc1b08941c507e691866f3a9cb38 (patch)
tree12a4e0378a7ea5bed584ee9c87b16d047f943886 /drivers/gpu/nvgpu/common/therm
parent0406900ca944305f9713905f4d7363fc2d9cbbea (diff)
gpu: nvgpu: move therm debugfs to linux
Move debugfs related code of therm from common driver to linux specific part of the driver. gp106_therm_debugfs_init() is updated to use nvgpu_os_linux_ops. This also affects gv100 as gp106_therm_debugfs_init is used for gv100 as well. JIRA NVGPU-603 Change-Id: Ia293d14599bc0c91fd1e917b5a430bd8f3d96e56 Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1797906 GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/therm')
-rw-r--r--drivers/gpu/nvgpu/common/therm/therm_gp106.c33
-rw-r--r--drivers/gpu/nvgpu/common/therm/therm_gp106.h5
2 files changed, 2 insertions, 36 deletions
diff --git a/drivers/gpu/nvgpu/common/therm/therm_gp106.c b/drivers/gpu/nvgpu/common/therm/therm_gp106.c
index 1f82aa7a..cc3127d7 100644
--- a/drivers/gpu/nvgpu/common/therm/therm_gp106.c
+++ b/drivers/gpu/nvgpu/common/therm/therm_gp106.c
@@ -21,16 +21,12 @@
21 */ 21 */
22 22
23#include <nvgpu/io.h> 23#include <nvgpu/io.h>
24
24#include "gk20a/gk20a.h" 25#include "gk20a/gk20a.h"
25 26
26#include "therm_gp106.h" 27#include "therm_gp106.h"
27#include "therm/thrmpmu.h" 28#include "therm/thrmpmu.h"
28 29
29#ifdef CONFIG_DEBUG_FS
30#include <linux/debugfs.h>
31#include "os/linux/os_linux.h"
32#endif
33
34#include <nvgpu/hw/gp106/hw_therm_gp106.h> 30#include <nvgpu/hw/gp106/hw_therm_gp106.h>
35 31
36#include <nvgpu/utils.h> 32#include <nvgpu/utils.h>
@@ -66,33 +62,6 @@ int gp106_get_internal_sensor_curr_temp(struct gk20a *g, u32 *temp_f24_8)
66 return err; 62 return err;
67} 63}
68 64
69#ifdef CONFIG_DEBUG_FS
70static int therm_get_internal_sensor_curr_temp(void *data, u64 *val)
71{
72 struct gk20a *g = (struct gk20a *)data;
73 u32 readval;
74 int err;
75
76 err = gp106_get_internal_sensor_curr_temp(g, &readval);
77 if (!err)
78 *val = readval;
79
80 return err;
81}
82DEFINE_SIMPLE_ATTRIBUTE(therm_ctrl_fops, therm_get_internal_sensor_curr_temp, NULL, "%llu\n");
83
84void gp106_therm_debugfs_init(struct gk20a *g)
85{
86 struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
87 struct dentry *dbgentry;
88
89 dbgentry = debugfs_create_file(
90 "temp", S_IRUGO, l->debugfs, g, &therm_ctrl_fops);
91 if (!dbgentry)
92 nvgpu_err(g, "debugfs entry create failed for therm_curr_temp");
93}
94#endif
95
96int gp106_elcg_init_idle_filters(struct gk20a *g) 65int gp106_elcg_init_idle_filters(struct gk20a *g)
97{ 66{
98 u32 gate_ctrl, idle_filter; 67 u32 gate_ctrl, idle_filter;
diff --git a/drivers/gpu/nvgpu/common/therm/therm_gp106.h b/drivers/gpu/nvgpu/common/therm/therm_gp106.h
index a92c2e0f..e29c993f 100644
--- a/drivers/gpu/nvgpu/common/therm/therm_gp106.h
+++ b/drivers/gpu/nvgpu/common/therm/therm_gp106.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * general thermal control structures & definitions 2 * general thermal control structures & definitions
3 * 3 *
4 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"), 7 * copy of this software and associated documentation files (the "Software"),
@@ -31,9 +31,6 @@ struct gk20a;
31 31
32void gp106_get_internal_sensor_limits(s32 *max_24_8, s32 *min_24_8); 32void gp106_get_internal_sensor_limits(s32 *max_24_8, s32 *min_24_8);
33int gp106_get_internal_sensor_curr_temp(struct gk20a *g, u32 *temp_f24_8); 33int gp106_get_internal_sensor_curr_temp(struct gk20a *g, u32 *temp_f24_8);
34#ifdef CONFIG_DEBUG_FS
35void gp106_therm_debugfs_init(struct gk20a *g);
36#endif
37int gp106_elcg_init_idle_filters(struct gk20a *g); 34int gp106_elcg_init_idle_filters(struct gk20a *g);
38u32 gp106_configure_therm_alert(struct gk20a *g, s32 curr_warn_temp); 35u32 gp106_configure_therm_alert(struct gk20a *g, s32 curr_warn_temp);
39 36