diff options
author | Vijayakumar <vsubbu@nvidia.com> | 2016-09-12 13:06:33 -0400 |
---|---|---|
committer | Deepak Nibade <dnibade@nvidia.com> | 2016-12-27 04:56:50 -0500 |
commit | 3c351f5bb2d04c1f70c72f3f2fd758bbb340877c (patch) | |
tree | cdaaf5547d6a2663111ba3dadb60d723f5833683 /drivers/gpu/nvgpu/clk/clk.c | |
parent | 1b1090512020369df18dbe36336ac5a85d2cd693 (diff) |
gpu: nvgpu: add function to retrieve clk points
JIRA DNVGPU-123
Function will copy possible clock points for
a given master clock domain to pointer passed.
pointer with NULL value and count of zero can be passed
to query number of clock points for a given domain so that
memory can be allocated and function called again to
fill clock points
Change-Id: Iec6206f23789980036be99793599e934bd221035
Reviewed-on: http://git-master/r/1218912
(cherry picked from commit 9219697bff1e12deb605325055a02a7b387996e9)
Signed-off-by: Vijayakumar <vsubbu@nvidia.com>
Reviewed-on: http://git-master/r/1235055
Reviewed-by: Thomas Fleury <tfleury@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/clk/clk.c')
-rw-r--r-- | drivers/gpu/nvgpu/clk/clk.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk.c b/drivers/gpu/nvgpu/clk/clk.c index 34b344c8..7ee4f283 100644 --- a/drivers/gpu/nvgpu/clk/clk.c +++ b/drivers/gpu/nvgpu/clk/clk.c | |||
@@ -236,3 +236,34 @@ u32 clk_domain_get_f_or_v( | |||
236 | } | 236 | } |
237 | return status; | 237 | return status; |
238 | } | 238 | } |
239 | |||
240 | u32 clk_domain_get_f_points( | ||
241 | struct gk20a *g, | ||
242 | u32 clkapidomain, | ||
243 | u32 *pfpointscount, | ||
244 | u16 *pfreqpointsinmhz | ||
245 | ) | ||
246 | { | ||
247 | u32 status = -EINVAL; | ||
248 | struct clk_domain *pdomain; | ||
249 | u8 i; | ||
250 | struct clk_pmupstate *pclk = &g->clk_pmu; | ||
251 | |||
252 | if (pfpointscount == NULL) | ||
253 | return -EINVAL; | ||
254 | |||
255 | if ((pfreqpointsinmhz == NULL) && (*pfpointscount != 0)) | ||
256 | return -EINVAL; | ||
257 | |||
258 | BOARDOBJGRP_FOR_EACH(&(pclk->clk_domainobjs.super.super), | ||
259 | struct clk_domain *, pdomain, i) { | ||
260 | if (pdomain->api_domain == clkapidomain) { | ||
261 | status = pdomain->clkdomainclkgetfpoints(g, pclk, | ||
262 | pdomain, pfpointscount, | ||
263 | pfreqpointsinmhz, | ||
264 | CLK_PROG_VFE_ENTRY_LOGIC); | ||
265 | return status; | ||
266 | } | ||
267 | } | ||
268 | return status; | ||
269 | } | ||