overlay: Fix min frequency detection on BYT/BSW

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2015-08-16 12:12:53 +01:00
parent 64590c7b76
commit 9b73ce43fe

View File

@ -91,11 +91,14 @@ int gpu_freq_init(struct gpu_freq *gf)
if (strstr(buf, "PUNIT_REG_GPU_FREQ_STS")) { if (strstr(buf, "PUNIT_REG_GPU_FREQ_STS")) {
/* Baytrail is special, ofc. */ /* Baytrail is special, ofc. */
gf->is_byt = 1; gf->is_byt = 1;
s = strstr(buf, "max"); s = strstr(buf, "max");
if (s == NULL) if (s != NULL)
goto err; sscanf(s, "max GPU freq: %d MHz", &gf->max);
sscanf(s, "max GPU freq: %d MHz", &gf->max);
sscanf(s, "min GPU freq: %d MHz", &gf->min); s = strstr(buf, "min");
if (s != NULL)
sscanf(s, "min GPU freq: %d MHz", &gf->min);
gf->rp0 = gf->rp1 = gf->max; gf->rp0 = gf->rp1 = gf->max;
gf->rpn = gf->min; gf->rpn = gf->min;