Currently the imx-drm-core driver builds up a list of device nodes
found via the 'ports' property in DT. The DRM subsystem builds a
similar list of all drivers for the individual display-subsystem
components (crtc, ldb, ...) via the component_add() call.
The ldb driver presents a special case, since it supports two channels
which are represented in DT as two separate nodes.
When both LVDS channels are enabled, the component list in the
imx-drm-core driver will contain one element more than the component
list in the DRM subsystem. Thus, the DRM subsystem will never reach
the state in which all components are assembled and won't ever
initialize the display-subsystem.
Rather than registering all device nodes found in DT and handling the
'lvds-channel' special case in imx_drm_add_components() which is
called by the DRM subsystem once for each component added there, do it
in imx_drm_add_component(), which builds up the list of components in
the imx-drm-core driver.
This way both lists will have a matching number of entries and the DRM
subsystem will be properly initialized.
static int compare_of(struct device *dev, void *data)
{
struct device_node *np = data;
-
- /* Special case for LDB, one device for two channels */
- if (of_node_cmp(np->name, "lvds-channel") == 0) {
- np = of_get_parent(np);
- of_node_put(np);
- }
-
return dev->of_node == np;
}
{
struct imx_drm_component *component;
+ /* Special case for LDB, one device for two channels */
+ if (of_node_cmp(node->name, "lvds-channel") == 0) {
+ node = of_get_parent(node);
+ of_node_put(node);
+ }
if (imx_drm_find_component(dev, node))
return 0;