From fdd207b12f08194a3e2c00ab6f78cc0dd170b885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20Cz=C3=A9m=C3=A1n?= Date: Mon, 18 Mar 2024 19:05:43 +0100 Subject: [PATCH] fdt2, panel: Add ability generate panels from soc node MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are some soc (msm8996) where panel related information placed under /soc. Signed-off-by: Barnabás Czémán --- fdt2.py | 8 ++++++++ panel.py | 3 +++ 2 files changed, 11 insertions(+) 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()