summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp106/clk_gp106.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gp106/clk_gp106.c')
-rw-r--r--drivers/gpu/nvgpu/gp106/clk_gp106.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gp106/clk_gp106.c b/drivers/gpu/nvgpu/gp106/clk_gp106.c
index 24b07112..dd7a2dd6 100644
--- a/drivers/gpu/nvgpu/gp106/clk_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/clk_gp106.c
@@ -32,7 +32,9 @@
32#include <nvgpu/list.h> 32#include <nvgpu/list.h>
33#include <nvgpu/clk_arb.h> 33#include <nvgpu/clk_arb.h>
34#include <nvgpu/timers.h> 34#include <nvgpu/timers.h>
35#include <nvgpu/pmu.h>
35 36
37#include "clk/clk.h"
36#include "gk20a/gk20a.h" 38#include "gk20a/gk20a.h"
37#include "gp106/mclk_gp106.h" 39#include "gp106/mclk_gp106.h"
38 40
@@ -243,6 +245,37 @@ read_err:
243 245
244} 246}
245 247
248int gp106_clk_domain_get_f_points(
249 struct gk20a *g,
250 u32 clkapidomain,
251 u32 *pfpointscount,
252 u16 *pfreqpointsinmhz)
253{
254 int status = -EINVAL;
255 struct clk_domain *pdomain;
256 u8 i;
257 struct clk_pmupstate *pclk = &g->clk_pmu;
258
259 if (pfpointscount == NULL)
260 return -EINVAL;
261
262 if ((pfreqpointsinmhz == NULL) && (*pfpointscount != 0))
263 return -EINVAL;
264
265 BOARDOBJGRP_FOR_EACH(&(pclk->clk_domainobjs.super.super),
266 struct clk_domain *, pdomain, i) {
267 if (pdomain->api_domain == clkapidomain) {
268 status = pdomain->clkdomainclkgetfpoints(g, pclk,
269 pdomain, pfpointscount,
270 pfreqpointsinmhz,
271 CLK_PROG_VFE_ENTRY_LOGIC);
272 return status;
273 }
274 }
275 return status;
276}
277
278
246#ifdef CONFIG_DEBUG_FS 279#ifdef CONFIG_DEBUG_FS
247static int gp106_get_rate_show(void *data , u64 *val) { 280static int gp106_get_rate_show(void *data , u64 *val) {
248 struct namemap_cfg *c = (struct namemap_cfg *) data; 281 struct namemap_cfg *c = (struct namemap_cfg *) data;