diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2016-05-12 09:00:44 -0400 |
---|---|---|
committer | Philipp Zabel <p.zabel@pengutronix.de> | 2016-05-23 06:35:11 -0400 |
commit | 310944d148e3600dcff8b346bee7fa01d34903b1 (patch) | |
tree | ca14e1344f6122ee02f005e5e67bf8d9a75f8f80 /drivers/gpu/drm/imx/imx-drm-core.c | |
parent | 2dcd0af568b0cf583645c8a317dd12e344b1c72a (diff) |
drm/imx: Match imx-ipuv3-crtc components using device node in platform data
The component master driver imx-drm-core matches component devices using
their of_node. Since commit 950b410dd1ab ("gpu: ipu-v3: Fix imx-ipuv3-crtc
module autoloading"), the imx-ipuv3-crtc dev->of_node is not set during
probing. Before that, of_node was set and caused an of: modalias to be
used instead of the platform: modalias, which broke module autoloading.
On the other hand, if dev->of_node is not set yet when the imx-ipuv3-crtc
probe function calls component_add, component matching in imx-drm-core
fails. While dev->of_node will be set once the next component tries to
bring up the component master, imx-drm-core component binding will never
succeed if one of the crtc devices is probed last.
Add of_node to the component platform data and match against the
pdata->of_node instead of dev->of_node in imx-drm-core to work around
this problem.
Cc: <stable@vger.kernel.org> # 4.4.x
Fixes: 950b410dd1ab ("gpu: ipu-v3: Fix imx-ipuv3-crtc module autoloading")
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
Tested-by: Lothar Waßmann <LW@KARO-electronics.de>
Tested-by: Heiko Schocher <hs@denx.de>
Tested-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
Diffstat (limited to 'drivers/gpu/drm/imx/imx-drm-core.c')
-rw-r--r-- | drivers/gpu/drm/imx/imx-drm-core.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c index e26dcdec2aba..05229b960e0c 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <drm/drm_fb_cma_helper.h> | 25 | #include <drm/drm_fb_cma_helper.h> |
26 | #include <drm/drm_plane_helper.h> | 26 | #include <drm/drm_plane_helper.h> |
27 | #include <drm/drm_of.h> | 27 | #include <drm/drm_of.h> |
28 | #include <video/imx-ipu-v3.h> | ||
28 | 29 | ||
29 | #include "imx-drm.h" | 30 | #include "imx-drm.h" |
30 | 31 | ||
@@ -444,6 +445,13 @@ static int compare_of(struct device *dev, void *data) | |||
444 | { | 445 | { |
445 | struct device_node *np = data; | 446 | struct device_node *np = data; |
446 | 447 | ||
448 | /* Special case for DI, dev->of_node may not be set yet */ | ||
449 | if (strcmp(dev->driver->name, "imx-ipuv3-crtc") == 0) { | ||
450 | struct ipu_client_platformdata *pdata = dev->platform_data; | ||
451 | |||
452 | return pdata->of_node == np; | ||
453 | } | ||
454 | |||
447 | /* Special case for LDB, one device for two channels */ | 455 | /* Special case for LDB, one device for two channels */ |
448 | if (of_node_cmp(np->name, "lvds-channel") == 0) { | 456 | if (of_node_cmp(np->name, "lvds-channel") == 0) { |
449 | np = of_get_parent(np); | 457 | np = of_get_parent(np); |