drm/imx: imx-ldb: honor 'native-mode' property when selecting video mode from DT
authorLothar Waßmann <LW@KARO-electronics.de>
Tue, 24 May 2016 06:31:49 +0000 (08:31 +0200)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Mon, 30 May 2016 07:14:00 +0000 (09:14 +0200)
This patch allows to select a specific video mode from a list of modes
defined in DT by setting the 'native-mode' property appropriately.

This change does not affect the behaviour of existing platforms, since
they either:
   - have just one display-timings subnode
   - have the native-mode property pointing to the first entry
   - let the bootloader select the appropriate timing

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/gpu/drm/imx/imx-ldb.c

index 5f8f0bf45a622c225091b84de56930ebf9889c94..beff793bb717592daf045b45e171ca72dab737bd 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
 #include <linux/of_device.h>
 #include <linux/of_graph.h>
+#include <video/of_display_timing.h>
 #include <video/of_videomode.h>
 #include <linux/regmap.h>
 #include <linux/videodev2.h>
@@ -625,7 +626,7 @@ static int imx_ldb_bind(struct device *dev, struct device *master, void *data)
                                /* fallback to display-timings node */
                                ret = of_get_drm_display_mode(child,
                                                              &channel->mode,
-                                                             0);
+                                                             OF_USE_NATIVE_MODE);
                                if (!ret)
                                        channel->mode_valid = 1;
                        }