<div dir="auto">Hi Raphael,<br>
<br>
On Sun, 2 Nov 2025 at 02:10, Raphaël Gallais-Pou <<a href="mailto:rgallaispou@gmail.com" target="_blank" rel="noreferrer">rgallaispou@gmail.com</a>> wrote:<br>
><br>
> Le Sat, Nov 01, 2025 at 10:03:59AM +0100, Simon Glass a écrit :<br>
> > Hi Raphael,<br>
> ><br>
> > On Thu, 4 Sept 2025 at 14:53, Raphael Gallais-Pou<br>
> > <<a href="mailto:raphael.gallais-pou@foss.st.com" target="_blank" rel="noreferrer">raphael.gallais-pou@foss.st.com</a>> wrote:<br>
> > ><br>
> > > The "Display Timings" in panel-common.yaml can be provided by 2 properties<br>
> > > - panel-timing: when display panels are restricted to a single resolution<br>
> > > the "panel-timing" node expresses the required timings.<br>
> > > - display-timings: several resolutions with different timings are supported<br>
> > > with several timing subnode of "display-timings" node<br>
> > ><br>
> > > This patch update the parsing function to handle this 2 possibility<br>
> > > when index = 0.<br>
> > ><br>
> > > Reviewed-by: Patrice Chotard <<a href="mailto:patrice.chotard@foss.st.com" target="_blank" rel="noreferrer">patrice.chotard@foss.st.com</a>><br>
> > > Reviewed-by: Yannick Fertre <<a href="mailto:yannick.fertre@foss.st.com" target="_blank" rel="noreferrer">yannick.fertre@foss.st.com</a>><br>
> > > Signed-off-by: Raphael Gallais-Pou <<a href="mailto:raphael.gallais-pou@foss.st.com" target="_blank" rel="noreferrer">raphael.gallais-pou@foss.st.com</a>><br>
> > > ---<br>
> > > drivers/core/ofnode.c | 17 ++++++++++-------<br>
> > > 1 file changed, 10 insertions(+), 7 deletions(-)<br>
> > ><br>
> > > diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c<br>
> > > index e040e3f2806ffe74c58dcd82f36307351acd5a99..5a721b46e5a3214e7bd437739776362c2d22a3c9 100644<br>
> > > --- a/drivers/core/ofnode.c<br>
> > > +++ b/drivers/core/ofnode.c<br>
> > > @@ -1221,13 +1221,16 @@ int ofnode_decode_display_timing(ofnode parent, int index,<br>
> > > int ret = 0;<br>
> > ><br>
> > > timings = ofnode_find_subnode(parent, "display-timings");<br>
> > > - if (!ofnode_valid(timings))<br>
> > > - return -EINVAL;<br>
> > > -<br>
> > > - i = 0;<br>
> > > - ofnode_for_each_subnode(node, timings) {<br>
> > > - if (i++ == index)<br>
> > > - break;<br>
> > > + if (ofnode_valid(timings)) {<br>
> > > + i = 0;<br>
> > > + ofnode_for_each_subnode(node, timings) {<br>
> > > + if (i++ == index)<br>
> > > + break;<br>
> > > + }<br>
> > > + } else {<br>
> > > + if (index != 0)<br>
> > > + return -EINVAL;<br>
> > > + node = ofnode_find_subnode(parent, "panel-timing");<br>
> > > }<br>
> > ><br>
> > > if (!ofnode_valid(node))<br>
> > ><br>
> > > --<br>
> > > 2.25.1<br>
> > ><br>
> ><br>
> > Please add a test for this in test/dm/ofnode.c<br>
><br>
> Hi Simon,<br>
><br>
> I'll gladly do that, but I haven't write and use any test in U-Boot. So<br>
> it is a bit foggy how to implement it.<br>
<br>
There is some info here:<br>
<br>
<a href="https://docs.u-boot.org/en/latest/develop/testing.html" rel="noreferrer noreferrer" target="_blank">https://docs.u-boot.org/en/latest/develop/testing.html</a><br>
<br>
><br>
> Do we want to create a fake device-tree and test each configuration or<br>
> do we want to test in the _current_ device-tree if timings are correctly<br>
> set according to the index value ?<br>
<br>
It looks like there is a 'display-timings' node in test.dts, with three subnodes, so you should just be able to get an ofnode for that and then read out one of them and check it.<br>
<br>
Regards,<br>
Simon<br></div>