Skip to content

Commit cdb2cd1

Browse files
committed
proxyclient: pmu: support finding pmu on iOS 12-13
Signed-off-by: Nick Chan <[email protected]>
1 parent fdc02f0 commit cdb2cd1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

proxyclient/m1n1/hw/pmu.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self, u, adt_path=None):
1818
self.bus_type = bus_type
1919
if bus_type == "spmi":
2020
self.spmi = SPMI(u, adt_path.rpartition('/')[0])
21-
self.primary = u.adt[adt_path].is_primary == 1
21+
self.primary = u.adt[adt_path].compatible[0] in ("pmu,d2422", "pmu,d2449") or u.adt[adt_path].is_primary == 1
2222
elif bus_type == "i2c":
2323
self.i2c = I2C(u, adt_path.rpartition('/')[0])
2424
self.primary = u.adt[adt_path].name == "pmu"
@@ -48,7 +48,7 @@ def find_primary_pmu(adt):
4848
for pmu in child:
4949
compat = getattr(pmu, "compatible")[0] if hasattr(pmu, "compatible") else "unset"
5050
primary = (getattr(pmu, "is-primary") == 1) if hasattr(pmu, "is-primary") else False
51-
if compat in ("pmu,spmi", "pmu,d2422", "pmu,d2449") and primary:
51+
if compat == "pmu,spmi" and primary or compat in ("pmu,d2422", "pmu,d2449"):
5252
return (pmu._path.removeprefix('/device-tree'), "spmi")
5353
elif child.name.startswith("i2c"):
5454
for dev in child:

0 commit comments

Comments
 (0)