From patchwork Thu Jul 12 11:35:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martin X-Patchwork-Id: 170641 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7A1982C0080 for ; Thu, 12 Jul 2012 21:41:39 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SpHga-0005g1-25; Thu, 12 Jul 2012 11:35:56 +0000 Received: from mail-wg0-f49.google.com ([74.125.82.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SpHgQ-0005ff-G9 for linux-arm-kernel@lists.infradead.org; Thu, 12 Jul 2012 11:35:48 +0000 Received: by wgbez12 with SMTP id ez12so900613wgb.18 for ; Thu, 12 Jul 2012 04:35:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=WuCRSRl1gHu8OwreeH79hkbh/7mnHkeMM1wSoWm8fj8=; b=TtqbuYGnaRQ4hb5yRB1g2gr086/DreI153gZsIfHjrkl9G8Y34nCPYMgEahjeXUpjx j26g5bJk82JWHlPl+81xsAe7yRSbVByqxPRK4ZuKlsPggMRQpJ6JBphL8xQliXgJtjTn YsAKDyomNCWE1y1oFx4deIkj+S8u24v4qjYc19kLXOzumCXK8rMwyJluEKUZUDBZpZqF zMqNskzyea/EmF6SsPWLKExNj2BMjh1ZHtGjXaHLJFMUIC09IcmJm+9Vjr09CZtd++W2 L0EfW+msURrIjReHQ/xZHp77VicqMIXg45bnw0zIZgwRhcM+6DW6x0tLzEEx5isGOkBp Qxfw== Received: by 10.180.81.165 with SMTP id b5mr55074309wiy.17.1342092942146; Thu, 12 Jul 2012 04:35:42 -0700 (PDT) Received: from piscis.vsilicon.net (96.252.106.212.dynamic.jazztel.es. [212.106.252.96]) by mx.google.com with ESMTPS id n6sm12736999wie.7.2012.07.12.04.35.40 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 12 Jul 2012 04:35:41 -0700 (PDT) From: Javier Martin To: linux-media@vger.kernel.org Subject: [PATCH 2/2 v2] i.MX27: Visstrim_M10: Add support for deinterlacing driver. Date: Thu, 12 Jul 2012 13:35:29 +0200 Message-Id: <1342092929-31590-2-git-send-email-javier.martin@vista-silicon.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1342092929-31590-1-git-send-email-javier.martin@vista-silicon.com> References: <1342092929-31590-1-git-send-email-javier.martin@vista-silicon.com> X-Gm-Message-State: ALoCoQkMGXXFld0PdVdXzmbOSBelVlU1S7SfQtdeq2V2sJs+eDj87VhOHVBrs3qyuBzqtFsrxY3b X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.49 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: sakari.ailus@maxwell.research.nokia.com, kernel@pengutronix.de, mchehab@infradead.org, kyungmin.park@samsung.com, laurent.pinchart@ideasonboard.com, s.nawrocki@samsung.com, linux-arm-kernel@lists.infradead.org, Javier Martin X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Visstrim_M10 have a tvp5150 whose video output must be deinterlaced. The new mem2mem deinterlacing driver is very useful for that purpose. Signed-off-by: Javier Martin --- Changes since v1: - Removed commented out code. --- arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c index 214e4ff..dbef59d 100644 --- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c +++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c @@ -232,7 +232,7 @@ static void __init visstrim_camera_init(void) static void __init visstrim_reserve(void) { /* reserve 4 MiB for mx2-camera */ - mx2_camera_base = arm_memblock_steal(2 * MX2_CAMERA_BUF_SIZE, + mx2_camera_base = arm_memblock_steal(3 * MX2_CAMERA_BUF_SIZE, MX2_CAMERA_BUF_SIZE); } @@ -419,6 +419,30 @@ static void __init visstrim_coda_init(void) return; } +/* DMA deinterlace */ +static struct platform_device visstrim_deinterlace = { + .name = "m2m-deinterlace", + .id = 0, +}; + +static void __init visstrim_deinterlace_init(void) +{ + int ret = -ENOMEM; + struct platform_device *pdev = &visstrim_deinterlace; + int dma; + + ret = platform_device_register(pdev); + + dma = dma_declare_coherent_memory(&pdev->dev, + mx2_camera_base + 2 * MX2_CAMERA_BUF_SIZE, + mx2_camera_base + 2 * MX2_CAMERA_BUF_SIZE, + MX2_CAMERA_BUF_SIZE, + DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE); + if (!(dma & DMA_MEMORY_MAP)) + return; +} + + static void __init visstrim_m10_revision(void) { int exp_version = 0; @@ -481,6 +505,7 @@ static void __init visstrim_m10_board_init(void) platform_device_register_resndata(NULL, "soc-camera-pdrv", 0, NULL, 0, &iclink_tvp5150, sizeof(iclink_tvp5150)); gpio_led_register_device(0, &visstrim_m10_led_data); + visstrim_deinterlace_init(); visstrim_camera_init(); visstrim_coda_init(); }