From: Vikas Sajjan <vikas.sajjan@linaro.org>
To: dri-devel@lists.freedesktop.org
Cc: linux-media@vger.kernel.org, kgene.kim@samsung.com,
joshi@samsung.com, inki.dae@samsung.com, l.krishna@samsung.com,
patches@linaro.org, linaro-dev@lists.linaro.org
Subject: [PATCH v8 1/2] video: drm: exynos: Add display-timing node parsing using video helper function
Date: Wed, 27 Feb 2013 17:19:55 +0530 [thread overview]
Message-ID: <1361965796-16117-2-git-send-email-vikas.sajjan@linaro.org> (raw)
In-Reply-To: <1361965796-16117-1-git-send-email-vikas.sajjan@linaro.org>
Add support for parsing the display-timing node using video helper
function.
The DT node parsing and pinctrl selection 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>
---
drivers/gpu/drm/exynos/exynos_drm_fimd.c | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 9537761..7932dc2 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -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>
@@ -883,10 +884,26 @@ static int fimd_probe(struct platform_device *pdev)
DRM_DEBUG_KMS("%s\n", __FILE__);
- pdata = pdev->dev.platform_data;
- if (!pdata) {
- dev_err(dev, "no platform data specified\n");
- return -EINVAL;
+ 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()\n"
+ "with return value: %d\n", ret);
+ return ret;
+ }
+ } else {
+ pdata = pdev->dev.platform_data;
+ if (!pdata) {
+ DRM_ERROR("no platform data specified\n");
+ return -EINVAL;
+ }
}
panel = &pdata->panel;
--
1.7.9.5
next prev parent reply other threads:[~2013-02-27 11:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-27 11:49 [PATCH v8 0/2] Add display-timing node parsing to exynos drm fimd Vikas Sajjan
2013-02-27 11:49 ` Vikas Sajjan [this message]
2013-02-27 19:21 ` [PATCH v8 1/2] video: drm: exynos: Add display-timing node parsing using video helper function Stéphane Marchesin
2013-02-27 20:35 ` Stéphane Marchesin
2013-02-28 2:37 ` Joonyoung Shim
2013-02-28 2:45 ` Vikas Sajjan
2013-02-28 2:51 ` Joonyoung Shim
2013-02-28 2:56 ` Vikas Sajjan
2013-02-27 11:49 ` [PATCH v8 2/2] video: drm: exynos: Add pinctrl support to fimd Vikas Sajjan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1361965796-16117-2-git-send-email-vikas.sajjan@linaro.org \
--to=vikas.sajjan@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=inki.dae@samsung.com \
--cc=joshi@samsung.com \
--cc=kgene.kim@samsung.com \
--cc=l.krishna@samsung.com \
--cc=linaro-dev@lists.linaro.org \
--cc=linux-media@vger.kernel.org \
--cc=patches@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox