From patchwork Fri Jan 25 09:55:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 2045811 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 311EEE0175 for ; Fri, 25 Jan 2013 15:04:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0786FE5BF9 for ; Fri, 25 Jan 2013 07:04:15 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pb0-f52.google.com (mail-pb0-f52.google.com [209.85.160.52]) by gabe.freedesktop.org (Postfix) with ESMTP id 00BEDE600A for ; Fri, 25 Jan 2013 02:04:15 -0800 (PST) Received: by mail-pb0-f52.google.com with SMTP id uo5so127411pbc.39 for ; Fri, 25 Jan 2013 02:04:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=fQH0zmSh5SZQkksVqOaISdUQlrBv95+hHOQzn1cmIzo=; b=CyGtlzcLmVe4kt1OYk7hcT76MJxrcI/8xQaloJDu7o3yVdN2vzQpz3S1AsaMT4EZpz O28ZAfd/KWO6unkZY+5quqo+qR9pvsaK28lT4FQpsArkK2Mm1DyFMx2pGkUxlOPpmup0 p+ea/6JW2m2cEjfISZbdNOwVYA+p1RrcH0sTJRnn5flxjtxBA4qx5bl2NuCej2hcVVwY ETBwIJDYYANcAjmnfGZB43qqYTwRXLvuxK8j1rjmmHOlisGoUziQt/4SSHrxkNB4UM+n 5uL/xnM6pieD1rJMv8W0jyopINHH30ragv41AHs8y8Qhdj5DU6/K3HPWT/SRdhjjKFb9 680Q== X-Received: by 10.68.236.97 with SMTP id ut1mr12671832pbc.164.1359108255841; Fri, 25 Jan 2013 02:04:15 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id y9sm603085paw.1.2013.01.25.02.04.12 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 25 Jan 2013 02:04:15 -0800 (PST) From: Sachin Kamat To: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree-discuss@lists.ozlabs.org Subject: [PATCH 1/2] [media] s5p-g2d: Add DT based discovery support Date: Fri, 25 Jan 2013 15:25:21 +0530 Message-Id: <1359107722-9974-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQk8c43WCU3AL+687I1ujtHKP5suNuO3EPQ+fU8n9EgvjD48o+0jJBSnZyM3Qv4rieCdchWx X-Mailman-Approved-At: Fri, 25 Jan 2013 06:58:19 -0800 Cc: patches@linaro.org, sachin.kamat@linaro.org, s.nawrocki@samsung.com 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 device tree based discovery support to G2D driver Signed-off-by: Sachin Kamat --- drivers/media/platform/s5p-g2d/g2d.c | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/drivers/media/platform/s5p-g2d/g2d.c b/drivers/media/platform/s5p-g2d/g2d.c index 7e41529..210e142 100644 --- a/drivers/media/platform/s5p-g2d/g2d.c +++ b/drivers/media/platform/s5p-g2d/g2d.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -796,7 +797,8 @@ static int g2d_probe(struct platform_device *pdev) } def_frame.stride = (def_frame.width * def_frame.fmt->depth) >> 3; - dev->variant = g2d_get_drv_data(pdev); + if (!pdev->dev.of_node) + dev->variant = g2d_get_drv_data(pdev); return 0; @@ -844,6 +846,18 @@ static struct g2d_variant g2d_drvdata_v4x = { .hw_rev = TYPE_G2D_4X, /* Revision 4.1 for Exynos4X12 and Exynos5 */ }; +static const struct of_device_id exynos_g2d_match[] = { + { + .compatible = "samsung,g2d-v3", + .data = &g2d_drvdata_v3x, + }, { + .compatible = "samsung,g2d-v41", + .data = &g2d_drvdata_v4x, + }, + {}, +}; +MODULE_DEVICE_TABLE(of, exynos_g2d_match); + static struct platform_device_id g2d_driver_ids[] = { { .name = "s5p-g2d", @@ -863,6 +877,7 @@ static struct platform_driver g2d_pdrv = { .driver = { .name = G2D_NAME, .owner = THIS_MODULE, + .of_match_table = of_match_ptr(exynos_g2d_match), }, };