staging: imx-drm: Make IPU KMS parse display-timings
authorMarek Vasut <marex@denx.de>
Wed, 3 Apr 2013 15:36:28 +0000 (12:36 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2013 18:04:08 +0000 (11:04 -0700)
This patch adds support for parsing of the DT display-timings prop
to IPU KMS driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/imx-drm/parallel-display.c

index a8064fcc03d154264ceffd93448578493efe3865..2a252020b0a5186a1fc763fa3adc2ab52edc8877 100644 (file)
@@ -57,6 +57,7 @@ static void imx_pd_connector_destroy(struct drm_connector *connector)
 static int imx_pd_connector_get_modes(struct drm_connector *connector)
 {
        struct imx_parallel_display *imxpd = con_to_imxpd(connector);
+       struct device_node *np = imxpd->dev->of_node;
        int num_modes = 0;
 
        if (imxpd->edid) {
@@ -72,6 +73,15 @@ static int imx_pd_connector_get_modes(struct drm_connector *connector)
                num_modes++;
        }
 
+       if (np) {
+               struct drm_display_mode *mode = drm_mode_create(connector->dev);
+               of_get_drm_display_mode(np, &imxpd->mode, 0);
+               drm_mode_copy(mode, &imxpd->mode);
+               mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
+               drm_mode_probed_add(connector, mode);
+               num_modes++;
+       }
+
        return num_modes;
 }