diff options
author | MyungJoo Ham <myungjoo.ham@samsung.com> | 2012-03-16 16:54:53 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-03-17 16:51:34 -0400 |
commit | ab5f299f51259fd2466cf35c89d79bd960e0fc32 (patch) | |
tree | 2c8b409511e48e04833b57457acdb98207201b0b /drivers/devfreq/exynos4_bus.c | |
parent | e4c9d8efe6bdc844071d68960dfa2003c5cf6449 (diff) |
PM / devfreq: add relation of recommended frequency.
The semantics of "target frequency" given to devfreq driver from
devfreq framework has always been interpretted as "at least" or GLB
(greatest lower bound). However, the framework might want the
device driver to limit its max frequency (LUB: least upper bound),
especially if it is given by thermal framework (it's too hot).
Thus, the target fuction should have another parameter to express
whether the framework wants GLB or LUB. And, the additional parameter,
"u32 flags", does it.
With the update, devfreq_recommended_opp() is also updated.
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Mike Turquette <mturquette@ti.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/devfreq/exynos4_bus.c')
-rw-r--r-- | drivers/devfreq/exynos4_bus.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/devfreq/exynos4_bus.c b/drivers/devfreq/exynos4_bus.c index 590d6865e388..1a361e99965a 100644 --- a/drivers/devfreq/exynos4_bus.c +++ b/drivers/devfreq/exynos4_bus.c | |||
@@ -619,13 +619,19 @@ static int exynos4_bus_setvolt(struct busfreq_data *data, struct opp *opp, | |||
619 | return err; | 619 | return err; |
620 | } | 620 | } |
621 | 621 | ||
622 | static int exynos4_bus_target(struct device *dev, unsigned long *_freq) | 622 | static int exynos4_bus_target(struct device *dev, unsigned long *_freq, |
623 | u32 flags) | ||
623 | { | 624 | { |
624 | int err = 0; | 625 | int err = 0; |
625 | struct busfreq_data *data = dev_get_drvdata(dev); | 626 | struct platform_device *pdev = container_of(dev, struct platform_device, |
626 | struct opp *opp = devfreq_recommended_opp(dev, _freq); | 627 | dev); |
627 | unsigned long old_freq = opp_get_freq(data->curr_opp); | 628 | struct busfreq_data *data = platform_get_drvdata(pdev); |
629 | struct opp *opp = devfreq_recommended_opp(dev, _freq, flags); | ||
628 | unsigned long freq = opp_get_freq(opp); | 630 | unsigned long freq = opp_get_freq(opp); |
631 | unsigned long old_freq = opp_get_freq(data->curr_opp); | ||
632 | |||
633 | if (IS_ERR(opp)) | ||
634 | return PTR_ERR(opp); | ||
629 | 635 | ||
630 | if (old_freq == freq) | 636 | if (old_freq == freq) |
631 | return 0; | 637 | return 0; |