On 2013-12-12 01:19, Laurent Pinchart wrote: > Hi Tomi, > > On Wednesday 04 December 2013 14:28:37 Tomi Valkeinen wrote: >> Add helpers to get ports and endpoints from DT data. >> >> While all the functions in dss-of.c might be useful for panel drivers if >> they need to parse full port/endpoint data, at the moment we only need a >> few of them outside dss-of.c, so only those functions are exported. > > I totally understand that it was easier to add this code to the OMAP DSS > driver, but I believe we should refactor the existing drivers/media/v4l2- > core/v4l2-of.c and move it to a non V4L2-specific location (what about > drivers/media ?) sooner rather than later. That's on my to-do list for > Saturday. I agree. I just didn't want to go that way yet =). Have you thought of the API? You had one version in your CDF series, but I think that was a bit too limited (I don't remember right now how), so I wrote my own versions. What I tried to do here is to add simple ways for the drivers to iterate the ports and endpoints with omapdss_of_get_next_port and omapdss_of_get_next_endpoint. But I'm not sure what the use pattern would be. If in most of the cases the driver always goes through all the ports and all the endpoints, we could as well have a helper function that goes through all the endpoints in all the ports, and returns both the port and endpoint for each iteration. Tomi