video: tegra: host: gk20a: Don't duplicate freqs
Arto Merilainen [Mon, 9 Sep 2013 05:46:55 +0000 (08:46 +0300)]
gk20a clock frequencies used to be doubled in the clock structure.
This, however, has been changed and therefore the gk20a devfreq
profile has currently too small frequencies.

This patch modifies the scale profile to use clock structure
frequencies "as is".

Bug 1330780

Change-Id: I278c3ab5de23be6dc3c528122b7420aa188947c0
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/271933
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>

drivers/video/tegra/host/gk20a/gk20a_scale.c

index 11735ff..f846eaf 100644 (file)
@@ -66,7 +66,7 @@ static int nvhost_scale_make_freq_table(struct nvhost_device_profile *profile)
 {
        struct gk20a *g = get_gk20a(profile->pdev);
        unsigned long *freqs;
-       int num_freqs, err, i;
+       int num_freqs, err;
 
        /* make sure the clock is available */
        if (!gk20a_clk_get(g))
@@ -78,21 +78,9 @@ static int nvhost_scale_make_freq_table(struct nvhost_device_profile *profile)
        if (err)
                return -ENOSYS;
 
-       /* allocate space for a duplicate table */
-       profile->devfreq_profile.freq_table =
-               kzalloc(num_freqs * sizeof(unsigned int), GFP_KERNEL);
-       if (!profile->devfreq_profile.freq_table)
-               return -ENOMEM;
-
-       /* copy the table */
-       memcpy(profile->devfreq_profile.freq_table, freqs,
-              num_freqs * sizeof(unsigned int));
+       profile->devfreq_profile.freq_table = (unsigned int *)freqs;
        profile->devfreq_profile.max_state = num_freqs;
 
-       /* convert gpc2clk to gpcclk */
-       for (i = 0; i < num_freqs; i++)
-               profile->devfreq_profile.freq_table[i] /= 2;
-
        return 0;
 }