gpu: nvgpu: add call back for get_cur_freq

When thermal throttling triggers gpcclk clock
changes, devfreq driver need to have call back
for get_cur_freq to get current gpu frequency.

With out this change, "17000000.gp10b/cur_freq"
interface won't show the current gpcclk frequency,
when thermal throttling triggers gpcclk frequency
changes.

Bug 1740309

Change-Id: I2484728094883abc285b2a3808bb2cef26a4ea96
Signed-off-by: sreenivasulu velpula <svelpula@nvidia.com>
Reviewed-on: http://git-master/r/1145912
(cherry picked from commit 0a6ef7b121d1b8aeba42cefa6e8b090b1ccd15e7)
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/1147652
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
sreenivasulu velpula
2016-05-11 19:42:04 +05:30
committed by Terje Bergstrom
parent 5272552ab1
commit abbc813fe3

View File

@@ -251,6 +251,20 @@ static int gk20a_scale_get_dev_status(struct device *dev,
return 0;
}
/*
* get_cur_freq(struct device *dev, unsigned long *freq)
*
* This function gets the current GPU clock rate.
*/
static int get_cur_freq(struct device *dev, unsigned long *freq)
{
struct gk20a_platform *platform = dev_get_drvdata(dev);
*freq = platform->clk_get_rate(dev);
return 0;
}
/*
* gk20a_scale_init(dev)
*/
@@ -287,6 +301,7 @@ void gk20a_scale_init(struct device *dev)
profile->devfreq_profile.target = gk20a_scale_target;
profile->devfreq_profile.get_dev_status =
gk20a_scale_get_dev_status;
profile->devfreq_profile.get_cur_freq = get_cur_freq;
devfreq = devfreq_add_device(dev,
&profile->devfreq_profile,