diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-02-02 16:24:21 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-03-16 14:48:29 -0400 |
commit | 589d6385b19a357cf566b75ded9355f9b8053ad7 (patch) | |
tree | 6453c1d3525c6a53b7b749a39b51e4a598680a64 /drivers/gpu/nvgpu/gk20a/gk20a_scale.c | |
parent | 686c3b701fb1db75a0b416a25c288c04a396df31 (diff) |
gpu: nvgpu: Implement get_rate/set_rate as GPU op
Move clock APIs from gk20a_platform to gpu_ops. At the same time
allow use of internal get_rate/set_rate for querying both GPCCLK
and PWRCLK on iGPU.
At the same time we can replace calls to clk framework with the
new HAL and drop direct dependency to clk framework.
gp10b ops were replaced as a whole at HAL initialization. That
replaces anything set in platform probe stage, so reduce that to
touch only clock gating regs.
Change-Id: Iaf219b1f000d362dbf397d45832f52d25463b31c
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1300113
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a_scale.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a_scale.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c index edf92de6..b9e92f15 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c | |||
@@ -19,10 +19,8 @@ | |||
19 | #include <linux/devfreq.h> | 19 | #include <linux/devfreq.h> |
20 | #include <linux/debugfs.h> | 20 | #include <linux/debugfs.h> |
21 | #include <linux/types.h> | 21 | #include <linux/types.h> |
22 | #include <linux/clk.h> | ||
23 | #include <linux/export.h> | 22 | #include <linux/export.h> |
24 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
25 | #include <linux/clk/tegra.h> | ||
26 | #include <soc/tegra/chip-id.h> | 24 | #include <soc/tegra/chip-id.h> |
27 | #include <linux/platform_data/tegra_edp.h> | 25 | #include <linux/platform_data/tegra_edp.h> |
28 | #include <linux/pm_qos.h> | 26 | #include <linux/pm_qos.h> |
@@ -188,11 +186,11 @@ static int gk20a_scale_target(struct device *dev, unsigned long *freq, | |||
188 | if (rounded_rate == g->last_freq) | 186 | if (rounded_rate == g->last_freq) |
189 | return 0; | 187 | return 0; |
190 | 188 | ||
191 | if (platform->clk_get_rate(dev) == rounded_rate) | 189 | if (g->ops.clk.get_rate(g, CTRL_CLK_DOMAIN_GPCCLK) == rounded_rate) |
192 | *freq = rounded_rate; | 190 | *freq = rounded_rate; |
193 | else { | 191 | else { |
194 | platform->clk_set_rate(dev, rounded_rate); | 192 | g->ops.clk.set_rate(g, CTRL_CLK_DOMAIN_GPCCLK, rounded_rate); |
195 | *freq = platform->clk_get_rate(dev); | 193 | *freq = g->ops.clk.get_rate(g, CTRL_CLK_DOMAIN_GPCCLK); |
196 | } | 194 | } |
197 | 195 | ||
198 | g->last_freq = *freq; | 196 | g->last_freq = *freq; |
@@ -321,7 +319,7 @@ static int gk20a_scale_get_dev_status(struct device *dev, | |||
321 | 319 | ||
322 | /* Make sure there are correct values for the current frequency */ | 320 | /* Make sure there are correct values for the current frequency */ |
323 | profile->dev_stat.current_frequency = | 321 | profile->dev_stat.current_frequency = |
324 | platform->clk_get_rate(profile->dev); | 322 | g->ops.clk.get_rate(g, CTRL_CLK_DOMAIN_GPCCLK); |
325 | 323 | ||
326 | /* Update load estimate */ | 324 | /* Update load estimate */ |
327 | update_load_estimate_gpmu(dev); | 325 | update_load_estimate_gpmu(dev); |
@@ -344,8 +342,8 @@ static int gk20a_scale_get_dev_status(struct device *dev, | |||
344 | 342 | ||
345 | static int get_cur_freq(struct device *dev, unsigned long *freq) | 343 | static int get_cur_freq(struct device *dev, unsigned long *freq) |
346 | { | 344 | { |
347 | struct gk20a_platform *platform = dev_get_drvdata(dev); | 345 | struct gk20a *g = get_gk20a(dev); |
348 | *freq = platform->clk_get_rate(dev); | 346 | *freq = g->ops.clk.get_rate(g, CTRL_CLK_DOMAIN_GPCCLK); |
349 | return 0; | 347 | return 0; |
350 | } | 348 | } |
351 | 349 | ||