Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fdt2, panel: Add ability generate panels from soc node #42

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions fdt2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down