summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/pmgr/pmgr.c
diff options
context:
space:
mode:
authorNitin Kumbhar <nkumbhar@nvidia.com>2018-08-16 08:17:21 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-09-05 07:51:50 -0400
commit78b4ab269f5d733c8b540a6a75db1f390172cc29 (patch)
tree72341f9ff90c8af8a822d707855953e5e1ef2682 /drivers/gpu/nvgpu/pmgr/pmgr.c
parentbcdac829f44afc1b08941c507e691866f3a9cb38 (diff)
gpu: nvgpu: move pmgr debugfs to linux
Move debugfs related part of pmgr to linux files. JIRA NVGPU-603 Change-Id: I478491e06e2e7cdbe3826166aafd8491d1e6c1e7 Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1801086 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/pmgr/pmgr.c')
-rw-r--r--drivers/gpu/nvgpu/pmgr/pmgr.c77
1 files changed, 0 insertions, 77 deletions
diff --git a/drivers/gpu/nvgpu/pmgr/pmgr.c b/drivers/gpu/nvgpu/pmgr/pmgr.c
index 3d028c98..3d6a96af 100644
--- a/drivers/gpu/nvgpu/pmgr/pmgr.c
+++ b/drivers/gpu/nvgpu/pmgr/pmgr.c
@@ -24,11 +24,6 @@
24#include "pwrdev.h" 24#include "pwrdev.h"
25#include "pmgrpmu.h" 25#include "pmgrpmu.h"
26 26
27#ifdef CONFIG_DEBUG_FS
28#include <linux/debugfs.h>
29#include "os/linux/os_linux.h"
30#endif
31
32int pmgr_pwr_devices_get_power(struct gk20a *g, u32 *val) 27int pmgr_pwr_devices_get_power(struct gk20a *g, u32 *val)
33{ 28{
34 struct nv_pmu_pmgr_pwr_devices_query_payload payload; 29 struct nv_pmu_pmgr_pwr_devices_query_payload payload;
@@ -74,74 +69,6 @@ int pmgr_pwr_devices_get_voltage(struct gk20a *g, u32 *val)
74 return status; 69 return status;
75} 70}
76 71
77#ifdef CONFIG_DEBUG_FS
78static int pmgr_pwr_devices_get_power_u64(void *data, u64 *p)
79{
80 struct gk20a *g = (struct gk20a *)data;
81 int err;
82 u32 val;
83
84 err = pmgr_pwr_devices_get_power(g, &val);
85 *p = val;
86
87 return err;
88}
89
90static int pmgr_pwr_devices_get_current_u64(void *data, u64 *p)
91{
92 struct gk20a *g = (struct gk20a *)data;
93 int err;
94 u32 val;
95
96 err = pmgr_pwr_devices_get_current(g, &val);
97 *p = val;
98
99 return err;
100}
101
102static int pmgr_pwr_devices_get_voltage_u64(void *data, u64 *p)
103{
104 struct gk20a *g = (struct gk20a *)data;
105 int err;
106 u32 val;
107
108 err = pmgr_pwr_devices_get_voltage(g, &val);
109 *p = val;
110
111 return err;
112}
113
114DEFINE_SIMPLE_ATTRIBUTE(
115 pmgr_power_ctrl_fops, pmgr_pwr_devices_get_power_u64, NULL, "%llu\n");
116
117DEFINE_SIMPLE_ATTRIBUTE(
118 pmgr_current_ctrl_fops, pmgr_pwr_devices_get_current_u64, NULL, "%llu\n");
119
120DEFINE_SIMPLE_ATTRIBUTE(
121 pmgr_voltage_ctrl_fops, pmgr_pwr_devices_get_voltage_u64, NULL, "%llu\n");
122
123static void pmgr_debugfs_init(struct gk20a *g)
124{
125 struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
126 struct dentry *dbgentry;
127
128 dbgentry = debugfs_create_file(
129 "power", S_IRUGO, l->debugfs, g, &pmgr_power_ctrl_fops);
130 if (!dbgentry)
131 nvgpu_err(g, "debugfs entry create failed for power");
132
133 dbgentry = debugfs_create_file(
134 "current", S_IRUGO, l->debugfs, g, &pmgr_current_ctrl_fops);
135 if (!dbgentry)
136 nvgpu_err(g, "debugfs entry create failed for current");
137
138 dbgentry = debugfs_create_file(
139 "voltage", S_IRUGO, l->debugfs, g, &pmgr_voltage_ctrl_fops);
140 if (!dbgentry)
141 nvgpu_err(g, "debugfs entry create failed for voltage");
142}
143#endif
144
145u32 pmgr_domain_sw_setup(struct gk20a *g) 72u32 pmgr_domain_sw_setup(struct gk20a *g)
146{ 73{
147 u32 status; 74 u32 status;
@@ -170,10 +97,6 @@ u32 pmgr_domain_sw_setup(struct gk20a *g)
170 goto exit; 97 goto exit;
171 } 98 }
172 99
173#ifdef CONFIG_DEBUG_FS
174 pmgr_debugfs_init(g);
175#endif
176
177exit: 100exit:
178 return status; 101 return status;
179} 102}