diff options
Diffstat (limited to 'drivers/cpufreq/intel_pstate.c')
-rw-r--r-- | drivers/cpufreq/intel_pstate.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index c788abf1c457..e90816105921 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c | |||
@@ -34,8 +34,10 @@ | |||
34 | 34 | ||
35 | #define SAMPLE_COUNT 3 | 35 | #define SAMPLE_COUNT 3 |
36 | 36 | ||
37 | #define BYT_RATIOS 0x66a | 37 | #define BYT_RATIOS 0x66a |
38 | #define BYT_VIDS 0x66b | 38 | #define BYT_VIDS 0x66b |
39 | #define BYT_TURBO_RATIOS 0x66c | ||
40 | |||
39 | 41 | ||
40 | #define FRAC_BITS 8 | 42 | #define FRAC_BITS 8 |
41 | #define int_tofp(X) ((int64_t)(X) << FRAC_BITS) | 43 | #define int_tofp(X) ((int64_t)(X) << FRAC_BITS) |
@@ -357,7 +359,7 @@ static int byt_get_min_pstate(void) | |||
357 | { | 359 | { |
358 | u64 value; | 360 | u64 value; |
359 | rdmsrl(BYT_RATIOS, value); | 361 | rdmsrl(BYT_RATIOS, value); |
360 | return value & 0xFF; | 362 | return (value >> 8) & 0xFF; |
361 | } | 363 | } |
362 | 364 | ||
363 | static int byt_get_max_pstate(void) | 365 | static int byt_get_max_pstate(void) |
@@ -367,6 +369,13 @@ static int byt_get_max_pstate(void) | |||
367 | return (value >> 16) & 0xFF; | 369 | return (value >> 16) & 0xFF; |
368 | } | 370 | } |
369 | 371 | ||
372 | static int byt_get_turbo_pstate(void) | ||
373 | { | ||
374 | u64 value; | ||
375 | rdmsrl(BYT_TURBO_RATIOS, value); | ||
376 | return value & 0x3F; | ||
377 | } | ||
378 | |||
370 | static void byt_set_pstate(struct cpudata *cpudata, int pstate) | 379 | static void byt_set_pstate(struct cpudata *cpudata, int pstate) |
371 | { | 380 | { |
372 | u64 val; | 381 | u64 val; |
@@ -469,7 +478,7 @@ static struct cpu_defaults byt_params = { | |||
469 | .funcs = { | 478 | .funcs = { |
470 | .get_max = byt_get_max_pstate, | 479 | .get_max = byt_get_max_pstate, |
471 | .get_min = byt_get_min_pstate, | 480 | .get_min = byt_get_min_pstate, |
472 | .get_turbo = byt_get_max_pstate, | 481 | .get_turbo = byt_get_turbo_pstate, |
473 | .set = byt_set_pstate, | 482 | .set = byt_set_pstate, |
474 | .get_vid = byt_get_vid, | 483 | .get_vid = byt_get_vid, |
475 | }, | 484 | }, |