diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmu/pmgr.h b/drivers/gpu/nvgpu/include/nvgpu/pmu/pmgr.h new file mode 100644 index 000000000..07846325d --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/pmu/pmgr.h @@ -0,0 +1,40 @@ +/* + * general power device structures & definitions + * + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +#ifndef NVGPU_PMU_PMGR_H +#define NVGPU_PMU_PMGR_H + +#include + +struct gk20a; + +int pmgr_pwr_devices_get_current(struct gk20a *g, u32 *val); +int pmgr_pwr_devices_get_voltage(struct gk20a *g, u32 *val); +int pmgr_pwr_devices_get_power(struct gk20a *g, u32 *val); +int pmgr_domain_sw_setup(struct gk20a *g); +int pmgr_domain_pmu_setup(struct gk20a *g); +int pmgr_pmu_init_pmupstate(struct gk20a *g); +void pmgr_pmu_free_pmupstate(struct gk20a *g); + + +#endif /* NVGPU_PMU_PMGR_H */ diff --git a/drivers/gpu/nvgpu/os/linux/debug_pmgr.c b/drivers/gpu/nvgpu/os/linux/debug_pmgr.c index c26497855..88af14049 100644 --- a/drivers/gpu/nvgpu/os/linux/debug_pmgr.c +++ b/drivers/gpu/nvgpu/os/linux/debug_pmgr.c @@ -16,9 +16,9 @@ #include -#include "os_linux.h" +#include -#include "pmgr/pmgr.h" +#include "os_linux.h" static int pmgr_pwr_devices_get_power_u64(void *data, u64 *p) { diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c index a0fa54e53..2c0292a01 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c @@ -33,6 +33,7 @@ #include #include #include +#include #include "ioctl_ctrl.h" #include "ioctl_dbg.h" @@ -46,7 +47,6 @@ #include "dmabuf.h" #include "channel.h" #include "dmabuf_vidmem.h" -#include "pmgr/pmgr.h" #define HZ_TO_MHZ(a) ((a > 0xF414F9CD7ULL) ? 0xffff : (a >> 32) ? \ (u32) ((a * 0x10C8ULL) >> 32) : (u16) ((u32) a/MHZ)) diff --git a/drivers/gpu/nvgpu/pmgr/pmgr.h b/drivers/gpu/nvgpu/pmgr/pmgr.h index b22a48b85..2d62ffc40 100644 --- a/drivers/gpu/nvgpu/pmgr/pmgr.h +++ b/drivers/gpu/nvgpu/pmgr/pmgr.h @@ -1,7 +1,7 @@ /* * general power device structures & definitions * - * Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -21,8 +21,8 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ -#ifndef NVGPU_PMGR_H -#define NVGPU_PMGR_H +#ifndef NVGPU_PMGR_PMGR_H +#define NVGPU_PMGR_PMGR_H #include "pwrdev.h" #include "pwrmonitor.h" @@ -34,12 +34,4 @@ struct pmgr_pmupstate { struct pmgr_pwr_policy pmgr_policyobjs; }; -int pmgr_domain_sw_setup(struct gk20a *g); -int pmgr_domain_pmu_setup(struct gk20a *g); -int pmgr_pwr_devices_get_current(struct gk20a *g, u32 *val); -int pmgr_pwr_devices_get_voltage(struct gk20a *g, u32 *val); -int pmgr_pwr_devices_get_power(struct gk20a *g, u32 *val); -int pmgr_pmu_init_pmupstate(struct gk20a *g); -void pmgr_pmu_free_pmupstate(struct gk20a *g); - -#endif /* NVGPU_PMGR_H */ +#endif /* NVGPU_PMGR_PMGR_H */ diff --git a/drivers/gpu/nvgpu/pstate/pstate.c b/drivers/gpu/nvgpu/pstate/pstate.c index 35d54bc8d..d1d0f4f28 100644 --- a/drivers/gpu/nvgpu/pstate/pstate.c +++ b/drivers/gpu/nvgpu/pstate/pstate.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "pmu_perf/pmu_perf.h" #include "pmu_perf/change_seq.h"