From 6d3c917e8988979e1328103c5f030371a854e5b1 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Tue, 8 Oct 2013 21:18:14 +0300 Subject: [PATCH] intel_opregion_decode: decipher bclm table Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi --- tools/intel_opregion_decode.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/intel_opregion_decode.c b/tools/intel_opregion_decode.c index e5f79df..8a9ef20 100644 --- a/tools/intel_opregion_decode.c +++ b/tools/intel_opregion_decode.c @@ -258,8 +258,18 @@ static void decode_asle(const void *buffer) printf("\tcblv:\t0x%08x\n", asle->cblv); printf("\tbclm:\n"); - for (i = 0; i < ARRAY_SIZE(asle->bclm); i++) - printf("\t\tbclm[%d]:\t0x%04x\n", i, asle->bclm[i]); + for (i = 0; i < ARRAY_SIZE(asle->bclm); i++) { + int valid = asle->bclm[i] & (1 << 15); + int percentage = (asle->bclm[i] & 0x7f00) >> 8; + int duty_cycle = asle->bclm[i] & 0xff; + + printf("\t\tbclm[%d]:\t0x%04x", i, asle->bclm[i]); + if (valid) + printf(" (%3d%% -> 0x%02x)\n", percentage, duty_cycle); + else + printf("\n"); + + } printf("\tcpfm:\t0x%08x\n", asle->cpfm); printf("\tepfm:\t0x%08x\n", asle->epfm); -- 2.7.4