From patchwork Tue Jan 29 08:12:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leela Krishna Amudala X-Patchwork-Id: 2060601 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id CB1C0DF23E for ; Tue, 29 Jan 2013 09:40:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D9383E6783 for ; Tue, 29 Jan 2013 01:40:08 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id CA2D3E62AC for ; Mon, 28 Jan 2013 23:51:12 -0800 (PST) Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MHD00A2SN4XU7P0@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Tue, 29 Jan 2013 16:51:09 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.126]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id E0.79.03918.C6F77015; Tue, 29 Jan 2013 16:51:08 +0900 (KST) X-AuditID: cbfee61a-b7f7d6d000000f4e-4f-51077f6c77a9 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 60.79.03918.C6F77015; Tue, 29 Jan 2013 16:51:08 +0900 (KST) Received: from chrome-ubuntu.sisodomain.com ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MHD00DY4N4VWE70@mmp1.samsung.com> for dri-devel@lists.freedesktop.org; Tue, 29 Jan 2013 16:51:08 +0900 (KST) From: Leela Krishna Amudala To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/1] video: drm: exynos: Adds display-timing node parsing using video helper function Date: Tue, 29 Jan 2013 03:12:26 -0500 Message-id: <1359447146-23359-2-git-send-email-l.krishna@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1359447146-23359-1-git-send-email-l.krishna@samsung.com> References: <1359447146-23359-1-git-send-email-l.krishna@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrALMWRmVeSWpSXmKPExsWyRsSkTjennj3Q4NgJQ4srX9+zOTB63O8+ zhTAGMVlk5Kak1mWWqRvl8CV8Xv6AeaCq3wVL+Y8Ympg7OHpYuTgkBAwkTj+I7mLkRPIFJO4 cG89G4gtJLCUUWL14TCIuInE16ZjQHEuoPgiRomO+2/ZIZyNTBKvDkxgB6liEzCWuD93MxOI LSKgLPF34ipGEJtZoINRYu5yfZBlwgLpEq+3qIGEWQRUJU4e2w62jFfAVaKvuZEJYpmcxIc9 j8BGcgq4SfR2ToI6yFXi2sf9bBA119kkvj/kgJgjIPFt8iEWiF9kJTYdYIYokZQ4uOIGywRG 4QWMDKsYRVMLkguKk9JzDfWKE3OLS/PS9ZLzczcxAsPv9L9nUjsYVzZYHGIU4GBU4uFtWMAW KMSaWFZcmXuIUYKDWUmE17WWPVCINyWxsiq1KD++qDQntfgQYzLQ8onMUqLJ+cDYyCuJNzQ2 MTc1NrU0MjIzNSVNWEmcl/HUkwAhgfTEktTs1NSC1CKYLUwcnFINjPrd3p6PRZ9kv+mfsaxT 9c0q29Yjjf5JvQyrMhtEpzJrs+7YG7X3QcgjS5FH5VtVmL5eeXVEnvHmA3e58skK+fvkJjDH ifOcO9FxwGx2XMK2lCqF57En+4+/2aRzU8+5yGn9xyOWp6o2H2rjedk8/8xR/smSWv9kvUKm +Xk6cQVyqfybWaK6XImlOCPRUIu5qDgRAHj+6hqDAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEIsWRmVeSWpSXmKPExsVy+t9jAd2cevZAg2mT1S2ufH3P5sDocb/7 OFMAY1QDo01GamJKapFCal5yfkpmXrqtkndwvHO8qZmBoa6hpYW5kkJeYm6qrZKLT4CuW2YO 0FglhbLEnFKgUEBicbGSvh2mCaEhbroWMI0Rur4hQXA9RgZoIGENY8bv6QeYC67yVbyY84ip gbGHp4uRk0NCwETia9MxNghbTOLCvfVANheHkMAiRomO+2/ZIZyNTBKvDkxgB6liEzCWuD93 MxOILSKgLPF34ipGEJtZoINRYu5y/S5GDg5hgXSJ11vUQMIsAqoSJ49tB1vAK+Aq0dfcyASx TE7iw55HYCM5BdwkejsngdUIAdVc+7ifbQIj7wJGhlWMoqkFyQXFSem5hnrFibnFpXnpesn5 uZsYwSH+TGoH48oGi0OMAhyMSjy8DQvYAoVYE8uKK3MPMUpwMCuJ8LrWsgcK8aYkVlalFuXH F5XmpBYfYkwGumois5Rocj4w/vJK4g2NTcxNjU0tTSxMzCxJE1YS52U89SRASCA9sSQ1OzW1 ILUIZgsTB6dUA+OqR2nPCtmu/dwZX3Pef+M+sVkf+lRtPdwjb6y7v6R4v1/DcqcstYsz2yfs kg5L2509OcHIeSrL8W6m2o2hBhcCP87/1GJYKB3iodFSPf2iR2ln5/Onc0wTGT2vx8gmrPZx u9BcEMEycfdCizlvzBQ2aBQ/qD2VKMRjt1Nn5v1ZG4IXZHzK2KPEUpyRaKjFXFScCACRzcvS tQIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Mailman-Approved-At: Tue, 29 Jan 2013 01:31:29 -0800 Cc: linux-samsung-soc@vger.kernel.org, kgene.kim@samsung.com, s.trumtrar@pengutronix.de, vikas.sajjan@linaro.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org This patch adds display-timing node parsing using video helper function Signed-off-by: Leela Krishna Amudala Tested-by: Vikas Sajjan --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 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..19dc842 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -876,6 +876,8 @@ static int fimd_probe(struct platform_device *pdev) struct fimd_context *ctx; struct exynos_drm_subdrv *subdrv; struct exynos_drm_fimd_pdata *pdata; + struct fb_videomode *fbmode; + struct device *disp_dev = &pdev->dev; struct exynos_drm_panel_info *panel; struct resource *res; int win; @@ -883,10 +885,31 @@ 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; + } + + fbmode = devm_kzalloc(dev, sizeof(*fbmode), GFP_KERNEL); + if (!fbmode) { + DRM_ERROR("memory allocation for fbmode failed\n"); + return -ENOMEM; + } + + ret = of_get_fb_videomode(disp_dev->of_node, fbmode, -1); + if (ret) { + DRM_ERROR("failed to get fb_videomode\n"); + return -EINVAL; + } + pdata->panel.timing = (struct fb_videomode) *fbmode; + } else { + pdata = pdev->dev.platform_data; + if (!pdata) { + DRM_ERROR("no platform data specified\n"); + return -EINVAL; + } } panel = &pdata->panel;