diff options
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a_scale.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c index e5c93db5..6d60d899 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c | |||
@@ -252,6 +252,20 @@ static int gk20a_scale_get_dev_status(struct device *dev, | |||
252 | } | 252 | } |
253 | 253 | ||
254 | /* | 254 | /* |
255 | * get_cur_freq(struct device *dev, unsigned long *freq) | ||
256 | * | ||
257 | * This function gets the current GPU clock rate. | ||
258 | */ | ||
259 | |||
260 | static int get_cur_freq(struct device *dev, unsigned long *freq) | ||
261 | { | ||
262 | struct gk20a_platform *platform = dev_get_drvdata(dev); | ||
263 | *freq = platform->clk_get_rate(dev); | ||
264 | return 0; | ||
265 | } | ||
266 | |||
267 | |||
268 | /* | ||
255 | * gk20a_scale_init(dev) | 269 | * gk20a_scale_init(dev) |
256 | */ | 270 | */ |
257 | 271 | ||
@@ -287,6 +301,7 @@ void gk20a_scale_init(struct device *dev) | |||
287 | profile->devfreq_profile.target = gk20a_scale_target; | 301 | profile->devfreq_profile.target = gk20a_scale_target; |
288 | profile->devfreq_profile.get_dev_status = | 302 | profile->devfreq_profile.get_dev_status = |
289 | gk20a_scale_get_dev_status; | 303 | gk20a_scale_get_dev_status; |
304 | profile->devfreq_profile.get_cur_freq = get_cur_freq; | ||
290 | 305 | ||
291 | devfreq = devfreq_add_device(dev, | 306 | devfreq = devfreq_add_device(dev, |
292 | &profile->devfreq_profile, | 307 | &profile->devfreq_profile, |