diff options
| author | Nicholas Troast <ntroast@codeaurora.org> | 2016-08-25 10:59:21 -0700 |
|---|---|---|
| committer | Nicholas Troast <ntroast@codeaurora.org> | 2016-09-27 19:55:54 -0700 |
| commit | 9d4164b5e808c3d45a19ef803d5eaf0df0a4faf3 (patch) | |
| tree | 5164f0487d2e7c61ed1cddb09f0d64933649bbac /tools/perf/scripts/python | |
| parent | 654b1238efbf670034721649b9fd5ad5b4f0fad6 (diff) | |
qcom-charger: fg-util: add float decode function
Some SRAM registers are encoded using a floating point representation.
Add a function to decode these registers into signed micro-unit
integers.
The exponent and mantissa are signed integers represented by two's
complement, and the exponent value is offset by -9. This is a half
float representation stored as:
EEEEE MMMMMMMMMMM
Where E are the exponent bits, and M are the mantissa bits.
To decode this representation the following formula is applied:
2^(exponent - 9) * mantissa
Change-Id: Id9f28a0eeb2a904aca41eb46d0215d80287e0b88
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
