From 1b1090512020369df18dbe36336ac5a85d2cd693 Mon Sep 17 00:00:00 2001 From: Vijayakumar Date: Wed, 31 Aug 2016 17:40:24 +0530 Subject: gpu: nvgpu: support to parse VF table JIRA DNVGPU-123 function was added to retrieve V for F or F for V for a given clock domain. Clock domain can be master or slave. F or V can be intermediate point between two successive V or F values in VF table. VF table should be cached before calling this function. A F value below Fmin will return Vmin. F > Fmax will return error A V value above Vmax wil return F max. A V value below Vmin will return error. Change-Id: I28b4e8647510c6933e9e1204cfff31d74616e11a Signed-off-by: Vijayakumar Reviewed-on: http://git-master/r/1211234 (cherry-picked from commit 5b83b03f2454fbec8d49a064ed09b09c92d3e9fa) Reviewed-on: http://git-master/r/1235054 Reviewed-by: Thomas Fleury Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/clk/clk_domain.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/gpu/nvgpu/clk/clk_domain.h') diff --git a/drivers/gpu/nvgpu/clk/clk_domain.h b/drivers/gpu/nvgpu/clk/clk_domain.h index 2670a066..07976a2a 100644 --- a/drivers/gpu/nvgpu/clk/clk_domain.h +++ b/drivers/gpu/nvgpu/clk/clk_domain.h @@ -26,8 +26,13 @@ struct clk_domain; /*data and function definition to talk to driver*/ u32 clk_domain_sw_setup(struct gk20a *g); u32 clk_domain_pmu_setup(struct gk20a *g); + typedef u32 clkproglink(struct gk20a *g, struct clk_pmupstate *pclk, struct clk_domain *pdomain); + +typedef u32 clkvfsearch(struct gk20a *g, struct clk_pmupstate *pclk, + struct clk_domain *pdomain, u16 *clkmhz, + u32 *voltuv, u8 rail); struct clk_domains { struct boardobjgrp_e32 super; u8 n_num_entries; @@ -55,6 +60,7 @@ struct clk_domain { u8 ratio_domain; u8 usage; clkproglink *clkdomainclkproglink; + clkvfsearch *clkdomainclkvfsearch; }; struct clk_domain_3x { @@ -92,4 +98,8 @@ struct clk_domain_3x_slave { u32 clk_domain_clk_prog_link(struct gk20a *g, struct clk_pmupstate *pclk); +#define CLK_CLK_DOMAIN_GET(pclk, idx) \ + ((struct clk_domain *)BOARDOBJGRP_OBJ_GET_BY_IDX( \ + &pclk->clk_domainobjs.super.super, (u8)(idx))) + #endif -- cgit v1.2.2