Skip to content

Commit 0ce3884

Browse files
digetxchanwoochoi
authored andcommitted
PM / devfreq: tegra30: Use kHz units uniformly in the code
Part of the code uses Hz units and the other kHz, let's switch to kHz everywhere for consistency. A small benefit from this change (besides code's cleanup) is that now powertop utility correctly displays devfreq's stats, for some reason it expects them to be in kHz. Tested-by: Peter Geis <[email protected]> Reviewed-by: Chanwoo Choi <[email protected]> Signed-off-by: Dmitry Osipenko <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
1 parent 53b4b2a commit 0ce3884

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/devfreq/tegra30-devfreq.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ static int tegra_devfreq_target(struct device *dev, unsigned long *freq,
448448
rate = dev_pm_opp_get_freq(opp);
449449
dev_pm_opp_put(opp);
450450

451-
err = clk_set_min_rate(tegra->emc_clock, rate);
451+
err = clk_set_min_rate(tegra->emc_clock, rate * KHZ);
452452
if (err)
453453
return err;
454454

@@ -477,7 +477,7 @@ static int tegra_devfreq_get_dev_status(struct device *dev,
477477
stat->private_data = tegra;
478478

479479
/* The below are to be used by the other governors */
480-
stat->current_frequency = cur_freq * KHZ;
480+
stat->current_frequency = cur_freq;
481481

482482
actmon_dev = &tegra->devices[MCALL];
483483

@@ -527,7 +527,7 @@ static int tegra_governor_get_target(struct devfreq *devfreq,
527527
target_freq = max(target_freq, dev->target_freq);
528528
}
529529

530-
*freq = target_freq * KHZ;
530+
*freq = target_freq;
531531

532532
return 0;
533533
}
@@ -663,7 +663,7 @@ static int tegra_devfreq_probe(struct platform_device *pdev)
663663
goto remove_opps;
664664
}
665665

666-
err = dev_pm_opp_add(&pdev->dev, rate, 0);
666+
err = dev_pm_opp_add(&pdev->dev, rate / KHZ, 0);
667667
if (err) {
668668
dev_err(&pdev->dev, "Failed to add OPP: %d\n", err);
669669
goto remove_opps;
@@ -686,7 +686,8 @@ static int tegra_devfreq_probe(struct platform_device *pdev)
686686
goto unreg_notifier;
687687
}
688688

689-
tegra_devfreq_profile.initial_freq = clk_get_rate(tegra->emc_clock);
689+
tegra_devfreq_profile.initial_freq = tegra->cur_freq;
690+
690691
devfreq = devfreq_add_device(&pdev->dev, &tegra_devfreq_profile,
691692
"tegra_actmon", NULL);
692693
if (IS_ERR(devfreq)) {

0 commit comments

Comments
 (0)