1 From 814af1a008845b61a08111f2f9cf7e66511ab362 Mon Sep 17 00:00:00 2001
2 From: popcornmix <popcornmix@gmail.com>
3 Date: Fri, 13 Sep 2019 13:45:11 +0100
4 Subject: [PATCH] raspberrypi-cpufreq: Only report integer pll divisor
8 drivers/cpufreq/raspberrypi-cpufreq.c | 7 ++++++-
9 1 file changed, 6 insertions(+), 1 deletion(-)
11 --- a/drivers/cpufreq/raspberrypi-cpufreq.c
12 +++ b/drivers/cpufreq/raspberrypi-cpufreq.c
14 #include <linux/clk.h>
15 #include <linux/cpu.h>
16 #include <linux/cpufreq.h>
17 +#include <linux/math64.h>
18 #include <linux/module.h>
19 #include <linux/platform_device.h>
20 #include <linux/pm_opp.h>
21 @@ -22,6 +23,7 @@ static int raspberrypi_cpufreq_probe(str
22 unsigned long min, max;
28 cpu_dev = get_cpu_device(0);
29 @@ -44,7 +46,10 @@ static int raspberrypi_cpufreq_probe(str
30 max = roundup(clk_round_rate(clk, ULONG_MAX), RASPBERRYPI_FREQ_INTERVAL);
33 - for (rate = min; rate <= max; rate += RASPBERRYPI_FREQ_INTERVAL) {
34 + for (div = 2; ; div++) {
35 + rate = div_u64((u64)max * 2, div);
38 ret = dev_pm_opp_add(cpu_dev, rate, 0);