video: sunxi: de2: fix SimpleFB node creation when DE2 not probed
authorIcenowy Zheng <icenowy@aosc.io>
Fri, 27 Jul 2018 15:50:53 +0000 (23:50 +0800)
committerJagan Teki <jagan@amarulasolutions.com>
Tue, 31 Jul 2018 06:09:47 +0000 (11:39 +0530)
Sometimes when a monitor without EDID information is plugged, the DE2
won't be probed (because of lack of timing information), but the HDMI
node is probed, thus a SimpleFB node with invalid information will be
populated.

Also detect whether DE2 is probed when creating SimpleFB node.

Fixes: be5b96f0e411 ("sunxi: setup simplefb for Allwinner DE2")
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Acked-by: Jagan Teki <jagan@openedev.com>
drivers/video/sunxi/sunxi_de2.c

index 4ed035d556a852d49903374a1d19bdf92838a772..8333ddc44c08d49c8ac11d41cf082a06c8fdce0b 100644 (file)
@@ -347,6 +347,9 @@ int sunxi_simplefb_setup(void *blob)
        if (ret) {
                debug("DE2 not present\n");
                return 0;
+       } else if (!device_active(de2)) {
+               debug("DE2 present but not probed\n");
+               return 0;
        }
 
        ret = uclass_find_device_by_name(UCLASS_DISPLAY,