summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/clk/clk.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/clk/clk.c')
-rw-r--r--drivers/gpu/nvgpu/clk/clk.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk.c b/drivers/gpu/nvgpu/clk/clk.c
index 0679efc0..34b344c8 100644
--- a/drivers/gpu/nvgpu/clk/clk.c
+++ b/drivers/gpu/nvgpu/clk/clk.c
@@ -188,3 +188,51 @@ u32 clk_pmu_vf_inject(struct gk20a *g)
188done: 188done:
189 return status; 189 return status;
190} 190}
191
192u32 clk_domain_print_vf_table(struct gk20a *g, u32 clkapidomain)
193{
194 u32 status = -EINVAL;
195 struct clk_domain *pdomain;
196 u8 i;
197 struct clk_pmupstate *pclk = &g->clk_pmu;
198 u16 clkmhz = 0;
199 u32 volt = 0;
200
201 BOARDOBJGRP_FOR_EACH(&(pclk->clk_domainobjs.super.super),
202 struct clk_domain *, pdomain, i) {
203 if (pdomain->api_domain == clkapidomain) {
204 status = pdomain->clkdomainclkvfsearch(g, pclk,
205 pdomain, &clkmhz, &volt,
206 CLK_PROG_VFE_ENTRY_LOGIC);
207 return status;
208 }
209 }
210 return status;
211}
212
213u32 clk_domain_get_f_or_v(
214 struct gk20a *g,
215 u32 clkapidomain,
216 u16 *pclkmhz,
217 u32 *pvoltuv
218)
219{
220 u32 status = -EINVAL;
221 struct clk_domain *pdomain;
222 u8 i;
223 struct clk_pmupstate *pclk = &g->clk_pmu;
224
225 if ((pclkmhz == NULL) || (pvoltuv == NULL))
226 return -EINVAL;
227
228 BOARDOBJGRP_FOR_EACH(&(pclk->clk_domainobjs.super.super),
229 struct clk_domain *, pdomain, i) {
230 if (pdomain->api_domain == clkapidomain) {
231 status = pdomain->clkdomainclkvfsearch(g, pclk,
232 pdomain, pclkmhz, pvoltuv,
233 CLK_PROG_VFE_ENTRY_LOGIC);
234 return status;
235 }
236 }
237 return status;
238}