mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-10 17:54:13 +00:00
m1n1.adt: Add mtr-polynom-fuse-agx parsing
Signed-off-by: Asahi Lina <lina@asahilina.net>
This commit is contained in:
parent
fbc04995ab
commit
25e1644858
1 changed files with 11 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
import itertools, fnmatch
|
||||
import itertools, fnmatch, sys
|
||||
from construct import *
|
||||
|
||||
from .utils import AddrLookup, FourCC, SafeGreedyRange
|
||||
|
@ -154,6 +154,15 @@ DCBlockerConfig = Struct(
|
|||
"pad" / Hex(Int16ul),
|
||||
)
|
||||
|
||||
Coef = ExprAdapter(Int32ul,
|
||||
lambda x, ctx: (x - ((x & 0x1000000) << 1)) / 65536,
|
||||
lambda x, ctx: int(round(x * 65536)) & 0x1ffffff)
|
||||
|
||||
MTRPolynomFuseAGX = GreedyRange(Struct(
|
||||
"id" / Int32ul,
|
||||
"data" / Prefixed(Int32ul, GreedyRange(Coef)),
|
||||
))
|
||||
|
||||
DEV_PROPERTIES = {
|
||||
"pmgr": {
|
||||
"*": {
|
||||
|
@ -167,6 +176,7 @@ DEV_PROPERTIES = {
|
|||
"device-bridges": PMGRDeviceBridges,
|
||||
"voltage-states*": SafeGreedyRange(Int32ul),
|
||||
"events": PMGREvents,
|
||||
"mtr-polynom-fuse-agx": MTRPolynomFuseAGX,
|
||||
}
|
||||
},
|
||||
"clpc": {
|
||||
|
|
Loading…
Reference in a new issue