diff options
author | Vikas Sajjan <vikas.sajjan@linaro.org> | 2013-03-07 01:45:21 -0500 |
---|---|---|
committer | Inki Dae <daeinki@gmail.com> | 2013-04-16 11:06:46 -0400 |
commit | 7f4596f4aebcc9fcf2d50d3fe398508d710c4dd0 (patch) | |
tree | c9d0bb4ea712a90c08f6da5da71a8c4645ba10a7 | |
parent | 7ddcc7364a93d18b80967b3a9b3f6aea107323f6 (diff) |
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: Leela Krishna Amudala <l.krishna@samsung.com>
Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
Acked-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fimd.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 98cc14725ba9..ebb77e46fb19 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/of_device.h> | 20 | #include <linux/of_device.h> |
21 | #include <linux/pm_runtime.h> | 21 | #include <linux/pm_runtime.h> |
22 | 22 | ||
23 | #include <video/of_display_timing.h> | ||
23 | #include <video/samsung_fimd.h> | 24 | #include <video/samsung_fimd.h> |
24 | #include <drm/exynos_drm.h> | 25 | #include <drm/exynos_drm.h> |
25 | 26 | ||
@@ -884,10 +885,25 @@ static int fimd_probe(struct platform_device *pdev) | |||
884 | 885 | ||
885 | DRM_DEBUG_KMS("%s\n", __FILE__); | 886 | DRM_DEBUG_KMS("%s\n", __FILE__); |
886 | 887 | ||
887 | pdata = pdev->dev.platform_data; | 888 | if (pdev->dev.of_node) { |
888 | if (!pdata) { | 889 | pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); |
889 | dev_err(dev, "no platform data specified\n"); | 890 | if (!pdata) { |
890 | return -EINVAL; | 891 | DRM_ERROR("memory allocation for pdata failed\n"); |
892 | return -ENOMEM; | ||
893 | } | ||
894 | |||
895 | ret = of_get_fb_videomode(dev->of_node, &pdata->panel.timing, | ||
896 | OF_USE_NATIVE_MODE); | ||
897 | if (ret) { | ||
898 | DRM_ERROR("failed: of_get_fb_videomode() : %d\n", ret); | ||
899 | return ret; | ||
900 | } | ||
901 | } else { | ||
902 | pdata = pdev->dev.platform_data; | ||
903 | if (!pdata) { | ||
904 | DRM_ERROR("no platform data specified\n"); | ||
905 | return -EINVAL; | ||
906 | } | ||
891 | } | 907 | } |
892 | 908 | ||
893 | panel = &pdata->panel; | 909 | panel = &pdata->panel; |