summaryrefslogtreecommitdiff
path: root/overlay
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-08-16 12:12:53 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2015-08-16 12:13:29 +0100
commit9b73ce43fecc71533603849f35dd3bd1233a0eea (patch)
tree3d5acf11fbda080304b7a243c2a0b19f677e90e0 /overlay
parent64590c7b768dc8d8dd962f812d5ff5a39e7e8b54 (diff)
overlay: Fix min frequency detection on BYT/BSW
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'overlay')
-rw-r--r--overlay/gpu-freq.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/overlay/gpu-freq.c b/overlay/gpu-freq.c
index a2d8f084..321c9388 100644
--- a/overlay/gpu-freq.c
+++ b/overlay/gpu-freq.c
@@ -91,11 +91,14 @@ int gpu_freq_init(struct gpu_freq *gf)
if (strstr(buf, "PUNIT_REG_GPU_FREQ_STS")) {
/* Baytrail is special, ofc. */
gf->is_byt = 1;
+
s = strstr(buf, "max");
- if (s == NULL)
- goto err;
- sscanf(s, "max GPU freq: %d MHz", &gf->max);
- sscanf(s, "min GPU freq: %d MHz", &gf->min);
+ if (s != NULL)
+ sscanf(s, "max GPU freq: %d MHz", &gf->max);
+
+ s = strstr(buf, "min");
+ if (s != NULL)
+ sscanf(s, "min GPU freq: %d MHz", &gf->min);
gf->rp0 = gf->rp1 = gf->max;
gf->rpn = gf->min;