gpu: nvgpu: Remove clk.h dependency from gk20a.h

gk20a.h depends on definition of struct clk_pmupstate. Change that
to a pointer and use forward declaration, and allocation and free
functions.

Fix a few build breaks by adding explicit includes where previously
a header file had gotten included implicitly.

JIRA NVGPU-596

Change-Id: Iafe7d72a6fd31543653e0e10e2d2e552b6c3514b
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1945286
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Terje Bergstrom
2018-11-07 13:28:12 -08:00
committed by mobile promotions
parent bca27e31e3
commit 07760eb9a1
16 changed files with 124 additions and 87 deletions

View File

@@ -19,6 +19,7 @@
#include <nvgpu/clk.h>
#include "os_linux.h"
#include "clk/clk.h"
void nvgpu_clk_arb_pstate_change_lock(struct gk20a *g, bool lock);
@@ -41,7 +42,7 @@ static int sys_cfc_read(void *data , u64 *val)
{
struct gk20a *g = (struct gk20a *)data;
bool bload = boardobjgrpmask_bitget(
&g->clk_pmu.clk_freq_controllers.freq_ctrl_load_mask.super,
&g->clk_pmu->clk_freq_controllers.freq_ctrl_load_mask.super,
CTRL_CLK_CLK_FREQ_CONTROLLER_ID_SYS);
/* val = 1 implies CLFC is loaded or enabled */
@@ -68,7 +69,7 @@ static int ltc_cfc_read(void *data , u64 *val)
{
struct gk20a *g = (struct gk20a *)data;
bool bload = boardobjgrpmask_bitget(
&g->clk_pmu.clk_freq_controllers.freq_ctrl_load_mask.super,
&g->clk_pmu->clk_freq_controllers.freq_ctrl_load_mask.super,
CTRL_CLK_CLK_FREQ_CONTROLLER_ID_LTC);
/* val = 1 implies CLFC is loaded or enabled */
@@ -95,7 +96,7 @@ static int xbar_cfc_read(void *data , u64 *val)
{
struct gk20a *g = (struct gk20a *)data;
bool bload = boardobjgrpmask_bitget(
&g->clk_pmu.clk_freq_controllers.freq_ctrl_load_mask.super,
&g->clk_pmu->clk_freq_controllers.freq_ctrl_load_mask.super,
CTRL_CLK_CLK_FREQ_CONTROLLER_ID_XBAR);
/* val = 1 implies CLFC is loaded or enabled */
@@ -123,7 +124,7 @@ static int gpc_cfc_read(void *data , u64 *val)
{
struct gk20a *g = (struct gk20a *)data;
bool bload = boardobjgrpmask_bitget(
&g->clk_pmu.clk_freq_controllers.freq_ctrl_load_mask.super,
&g->clk_pmu->clk_freq_controllers.freq_ctrl_load_mask.super,
CTRL_CLK_CLK_FREQ_CONTROLLER_ID_GPC0);
/* val = 1 implies CLFC is loaded or enabled */