ofnode: support panel-timings in ofnode_decode_display_timing

The "Display Timings" in panel-common.yaml can be provided by 2 properties
- panel-timing: when display panels are restricted to a single resolution
                the "panel-timing" node expresses the required timings.
- display-timings: several resolutions with different timings are supported
                   with several timing subnode of "display-timings" node

This patch update the parsing function to handle this 2 possibility
when index = 0.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Yannick Fertre <yannick.fertre@foss.st.com>
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
This commit is contained in:
Raphael Gallais-Pou 2025-09-04 14:53:05 +02:00 committed by Tom Rini
parent 75defb7fbf
commit 1a7ea0280e

View File

@ -1221,14 +1221,17 @@ int ofnode_decode_display_timing(ofnode parent, int index,
int ret = 0; int ret = 0;
timings = ofnode_find_subnode(parent, "display-timings"); timings = ofnode_find_subnode(parent, "display-timings");
if (!ofnode_valid(timings)) if (ofnode_valid(timings)) {
return -EINVAL;
i = 0; i = 0;
ofnode_for_each_subnode(node, timings) { ofnode_for_each_subnode(node, timings) {
if (i++ == index) if (i++ == index)
break; break;
} }
} else {
if (index != 0)
return -EINVAL;
node = ofnode_find_subnode(parent, "panel-timing");
}
if (!ofnode_valid(node)) if (!ofnode_valid(node))
return -EINVAL; return -EINVAL;