[RFC PATCH v4 1/8] staging: imx-drm-core: Use OF graph to find components and connections between encoder and crtcs (original) (raw)

Philipp Zabel p.zabel at pengutronix.de
Tue Feb 25 06:23:16 PST 2014


From: Philipp Zabel <philipp.zabel at gmail.com>

This patch adds support to find the involved components connected to the IPU display interface ports using the OF graph bindings documented in Documentation/devicetree/bindings/media/video-interfaces.txt. It makes use of the of_graph (formerly v4l2_of) parsing helpers and thus depends on the patch that moves those out to drivers/of.

Each display interface needs to have an associated port node in the device tree. We can associate this node with the crtc platform device and use it to find the crtc corresponding to a given port node instead of using a combination of parent device node and id number, as before.

Explicitly converting the void* cookie to the port device tree node allows to get rid of the ipu_id and di_id fields. The multiplexer setting on i.MX6 now can be obtained from the port id (reg property) in the device tree.

The imx-drm node now needs a ports property that contains phandles to each of the IPU display interface port nodes. From there, all attached encoders are scanned and enabled encoders are added to a waiting list. The bind order makes sure that once all components are probed, crtcs are bound before encoders, so that imx_drm_encoder_parse_of can be called from the encoder bind callbacks.

For parsing the OF graph, temporary copies of the V4L2 OF graph helpers are used, that can be removed again once those are available at a generic place.

Signed-off-by: Philipp Zabel <p.zabel at pengutronix.de>

Changes since v3: - Retain -EPROBE_DEFER behavior in imx_drm_encoder_parse_of - Use of_graph helpers in drivers/of

drivers/staging/imx-drm/imx-drm-core.c | 215 +++++++++++++++++++++++---------- drivers/staging/imx-drm/imx-drm.h | 5 +- drivers/staging/imx-drm/imx-hdmi.c | 2 +- drivers/staging/imx-drm/imx-ldb.c | 4 +- drivers/staging/imx-drm/ipuv3-crtc.c | 47 +++++-- 5 files changed, 198 insertions(+), 75 deletions(-)

static int compare_of(struct device *dev, void *data) { - return dev->of_node == data; -}

-static int imx_drm_add_components(struct device *master, struct master *m) -{ - struct device_node *np = master->of_node; - unsigned i; - int ret; + struct device_node *np = data; - for (i = 0; ; i++) { - struct of_phandle_args args;

1.8.5.3



More information about the dri-devel mailing list