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: 14284 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 2CDFB23EAD for ; Fri, 25 Jan 2013 10:04:18 +0000 (UTC) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by fiordland.canonical.com (Postfix) with ESMTP id D0E42A1802A for ; Fri, 25 Jan 2013 10:04:17 +0000 (UTC) Received: by mail-ve0-f170.google.com with SMTP id ox1so74528veb.15 for ; Fri, 25 Jan 2013 02:04:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=fQH0zmSh5SZQkksVqOaISdUQlrBv95+hHOQzn1cmIzo=; b=FFIPzQk5xQ5a9OyvIEypJiMZAjaP+V9srjBEONMJuUZgjw4dtbtIw2tsVvmIJu3wK8 fIZKxXiARYm4SvgCTEVjFngs60OaHxYUVCHnfx/EeHgAWHlUw0khOc4hMd9oZ0IGhhka D8Wok71qqMZj8Rzog3+JW7vM5qVgTG4f+V2TDetKZGbGanIU33KDaL6Q4i6vk8q08zs4 URBgpPLJ7aUTubXzOgj0tS2F7Pi264zBzEle/Kyn229tSxuKOoBBspdHqKtG0ZWXzaLb tlucBQ2pz91b4epKAeSIrLgTc/rD0SX/0+J1qBs6ZiHmi2O9jlVIlKtTF6IyRZH7ou23 2e9A== X-Received: by 10.52.18.147 with SMTP id w19mr4657256vdd.94.1359108257368; Fri, 25 Jan 2013 02:04:17 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp108183veb; Fri, 25 Jan 2013 02:04:16 -0800 (PST) X-Received: by 10.68.197.9 with SMTP id iq9mr12638775pbc.130.1359108256333; Fri, 25 Jan 2013 02:04:16 -0800 (PST) Received: from mail-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by mx.google.com with ESMTPS id l6si701080pax.7.2013.01.25.02.04.15 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Jan 2013 02:04:16 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.44 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.44; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.44 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-pb0-f44.google.com with SMTP id uo1so126483pbc.31 for ; Fri, 25 Jan 2013 02:04:15 -0800 (PST) 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 Cc: k.debski@samsung.com, inki.dae@samsung.com, sachin.kamat@linaro.org, ajaykumar.rs@samsung.com, patches@linaro.org, s.nawrocki@samsung.com 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: ALoCoQkxmTE0ylwgpTpcaCHFowSwcOCymSFRb6w/I/MzWIb6IEdLqDaV1DzTd8cEaoq67bvXlYHD 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), }, };