Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7f4596f4 authored by Vikas Sajjan's avatar Vikas Sajjan Committed by Inki Dae
Browse files

drm/exynos: Add display-timing node parsing using video helper function



Add support for parsing the display-timing node using video helper
function.

The DT node parsing is done only if 'dev.of_node'
exists and the NON-DT logic is still maintained under the 'else' part.

Signed-off-by: default avatarLeela Krishna Amudala <l.krishna@samsung.com>
Signed-off-by: default avatarVikas Sajjan <vikas.sajjan@linaro.org>
Acked-by: default avatarJoonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent 7ddcc736
Loading
Loading
Loading
Loading
+20 −4
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <linux/of_device.h>
#include <linux/pm_runtime.h>

#include <video/of_display_timing.h>
#include <video/samsung_fimd.h>
#include <drm/exynos_drm.h>

@@ -884,11 +885,26 @@ static int fimd_probe(struct platform_device *pdev)

	DRM_DEBUG_KMS("%s\n", __FILE__);

	if (pdev->dev.of_node) {
		pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
		if (!pdata) {
			DRM_ERROR("memory allocation for pdata failed\n");
			return -ENOMEM;
		}

		ret = of_get_fb_videomode(dev->of_node, &pdata->panel.timing,
					OF_USE_NATIVE_MODE);
		if (ret) {
			DRM_ERROR("failed: of_get_fb_videomode() : %d\n", ret);
			return ret;
		}
	} else {
		pdata = pdev->dev.platform_data;
		if (!pdata) {
		dev_err(dev, "no platform data specified\n");
			DRM_ERROR("no platform data specified\n");
			return -EINVAL;
		}
	}

	panel = &pdata->panel;
	if (!panel) {