diff --git a/fdt2.py b/fdt2.py index 7d4834d..cca4191 100644 --- a/fdt2.py +++ b/fdt2.py @@ -15,6 +15,14 @@ def find_by_compatible(self, compatible): break yield offset + def find_by_path(self, path): + offset = check_err( + fdt_path_offset(self._fdt, path), + [FDT_ERR_NOTFOUND]) + if offset == -FDT_ERR_NOTFOUND: + return None + yield offset + def subnodes(self, parent): offset = self.first_subnode(parent, [FDT_ERR_NOTFOUND]) while offset != -FDT_ERR_NOTFOUND: diff --git a/panel.py b/panel.py index eb4774a..ce02d97 100644 --- a/panel.py +++ b/panel.py @@ -340,6 +340,9 @@ def find(fdt: Fdt2) -> Iterator[int]: for sub in fdt.subnodes(mdp): yield sub + for mdp in fdt.find_by_path("/soc"): + for sub in fdt.subnodes(mdp): + yield sub # Newer device trees do not necessarily have panels below MDP, # search for qcom,dsi-display node instead panel_phandles = set()