From 78b4ab269f5d733c8b540a6a75db1f390172cc29 Mon Sep 17 00:00:00 2001 From: Nitin Kumbhar Date: Thu, 16 Aug 2018 17:47:21 +0530 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1801086 GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/pmgr/pmgr.c | 77 ------------------------------------------- 1 file changed, 77 deletions(-) (limited to 'drivers/gpu/nvgpu/pmgr/pmgr.c') 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 @@ #include "pwrdev.h" #include "pmgrpmu.h" -#ifdef CONFIG_DEBUG_FS -#include -#include "os/linux/os_linux.h" -#endif - int pmgr_pwr_devices_get_power(struct gk20a *g, u32 *val) { struct nv_pmu_pmgr_pwr_devices_query_payload payload; @@ -74,74 +69,6 @@ int pmgr_pwr_devices_get_voltage(struct gk20a *g, u32 *val) return status; } -#ifdef CONFIG_DEBUG_FS -static int pmgr_pwr_devices_get_power_u64(void *data, u64 *p) -{ - struct gk20a *g = (struct gk20a *)data; - int err; - u32 val; - - err = pmgr_pwr_devices_get_power(g, &val); - *p = val; - - return err; -} - -static int pmgr_pwr_devices_get_current_u64(void *data, u64 *p) -{ - struct gk20a *g = (struct gk20a *)data; - int err; - u32 val; - - err = pmgr_pwr_devices_get_current(g, &val); - *p = val; - - return err; -} - -static int pmgr_pwr_devices_get_voltage_u64(void *data, u64 *p) -{ - struct gk20a *g = (struct gk20a *)data; - int err; - u32 val; - - err = pmgr_pwr_devices_get_voltage(g, &val); - *p = val; - - return err; -} - -DEFINE_SIMPLE_ATTRIBUTE( - pmgr_power_ctrl_fops, pmgr_pwr_devices_get_power_u64, NULL, "%llu\n"); - -DEFINE_SIMPLE_ATTRIBUTE( - pmgr_current_ctrl_fops, pmgr_pwr_devices_get_current_u64, NULL, "%llu\n"); - -DEFINE_SIMPLE_ATTRIBUTE( - pmgr_voltage_ctrl_fops, pmgr_pwr_devices_get_voltage_u64, NULL, "%llu\n"); - -static void pmgr_debugfs_init(struct gk20a *g) -{ - struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); - struct dentry *dbgentry; - - dbgentry = debugfs_create_file( - "power", S_IRUGO, l->debugfs, g, &pmgr_power_ctrl_fops); - if (!dbgentry) - nvgpu_err(g, "debugfs entry create failed for power"); - - dbgentry = debugfs_create_file( - "current", S_IRUGO, l->debugfs, g, &pmgr_current_ctrl_fops); - if (!dbgentry) - nvgpu_err(g, "debugfs entry create failed for current"); - - dbgentry = debugfs_create_file( - "voltage", S_IRUGO, l->debugfs, g, &pmgr_voltage_ctrl_fops); - if (!dbgentry) - nvgpu_err(g, "debugfs entry create failed for voltage"); -} -#endif - u32 pmgr_domain_sw_setup(struct gk20a *g) { u32 status; @@ -170,10 +97,6 @@ u32 pmgr_domain_sw_setup(struct gk20a *g) goto exit; } -#ifdef CONFIG_DEBUG_FS - pmgr_debugfs_init(g); -#endif - exit: return status; } -- cgit v1.2.2