From: Joonyoung Shim <jy0922.shim@samsung.com>
To: Vikas Sajjan <vikas.sajjan@linaro.org>
Cc: dri-devel@lists.freedesktop.org, l.krishna@samsung.com,
kgene.kim@samsung.com, patches@linaro.org,
linux-media@vger.kernel.org
Subject: Re: [PATCH v6 1/1] video: drm: exynos: Add display-timing node parsing using video helper function
Date: Thu, 21 Feb 2013 15:55:16 +0900 [thread overview]
Message-ID: <5125C4D4.5040804@samsung.com> (raw)
In-Reply-To: <1360910587-25548-2-git-send-email-vikas.sajjan@linaro.org>
Hi,
On 02/15/2013 03:43 PM, Vikas Sajjan wrote:
> 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 | 37 ++++++++++++++++++++++++++----
> 1 file changed, 33 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..8b2c0ff 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> @@ -19,7 +19,9 @@
> #include <linux/clk.h>
> #include <linux/of_device.h>
> #include <linux/pm_runtime.h>
> +#include <linux/pinctrl/consumer.h>
>
> +#include <video/of_display_timing.h>
> #include <video/samsung_fimd.h>
> #include <drm/exynos_drm.h>
>
> @@ -877,16 +879,43 @@ static int fimd_probe(struct platform_device *pdev)
> struct exynos_drm_subdrv *subdrv;
> struct exynos_drm_fimd_pdata *pdata;
> struct exynos_drm_panel_info *panel;
> + struct fb_videomode *fbmode;
> + struct pinctrl *pctrl;
> struct resource *res;
> int win;
> int ret = -EINVAL;
>
> 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;
> + }
> +
> + fbmode = &pdata->panel.timing;
> + ret = of_get_fb_videomode(dev->of_node, fbmode,
> + OF_USE_NATIVE_MODE);
fbmode variable can be substituted to &pdata->panel.timing directly then
can remove fbmode variable.
> + if (ret) {
> + DRM_ERROR("failed: of_get_fb_videomode()\n"
> + "with return value: %d\n", ret);
> + return ret;
> + }
> +
> + pctrl = devm_pinctrl_get_select_default(dev);
> + if (IS_ERR_OR_NULL(pctrl)) {
It's enough to "if (IS_ERR(pctrl)) {".
> + DRM_ERROR("failed: devm_pinctrl_get_select_default()\n"
> + "with return value: %d\n", PTR_RET(pctrl));
> + return PTR_RET(pctrl);
It's enough to "return PTR_ERR(pctrl);"
> + }
If this needs, parts for pinctrl should go to another patch.
> +
> + } else {
> + pdata = pdev->dev.platform_data;
> + if (!pdata) {
> + DRM_ERROR("no platform data specified\n");
> + return -EINVAL;
> + }
> }
>
> panel = &pdata->panel;
Thanks.
next prev parent reply other threads:[~2013-02-21 6:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-15 6:43 [PATCH v6 0/1] Add display-timing node parsing to exynos drm fimd Vikas Sajjan
2013-02-15 6:43 ` [PATCH v6 1/1] video: drm: exynos: Add display-timing node parsing using video helper function Vikas Sajjan
2013-02-20 11:15 ` Inki Dae
2013-02-21 4:44 ` Vikas Sajjan
2013-02-21 6:55 ` Joonyoung Shim [this message]
2013-02-21 7:12 ` Vikas Sajjan
2013-02-21 7:18 ` Joonyoung Shim
2013-02-28 1:51 ` Joonyoung Shim
2013-02-28 23:56 ` Linus Walleij
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=5125C4D4.5040804@samsung.com \
--to=jy0922.shim@samsung.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kgene.kim@samsung.com \
--cc=l.krishna@samsung.com \
--cc=linux-media@vger.kernel.org \
--cc=patches@linaro.org \
--cc=vikas.sajjan@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;
as well as URLs for NNTP newsgroup(s).