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: 1188481 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id CCA51E0004 for ; Thu, 12 Jul 2012 11:36:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030631Ab2GLLfo (ORCPT ); Thu, 12 Jul 2012 07:35:44 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:60797 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030566Ab2GLLfn (ORCPT ); Thu, 12 Jul 2012 07:35:43 -0400 Received: by weyx8 with SMTP id x8so1629761wey.19 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=F1A5ywm1soNRqsLOarGospzPbqRpYHfJU7ThaW2ZK0JHppXWcLBbyjxjDvCVAYuTym Veq66UOPqHbY9nnhydjiwI/NwlM/DZsri+SmpNJCqV0MJO/EOdHV798t1uky+cWz1Ngl aReTeVxVxKcT4sbMPRSscLTRQceTJJ6y2yT9hZEG1++tjLZPPlmmpipqh0rzXbF6Ai/2 HhmB69JFJMsiG2gnkA4s8PkHn5WppbMI12oSGMeVMa0Z8pvekGpE+0aOWOboWE1iBRJt 1QQEYzFXP+fE2m5wioqUEG7gj76h+PNomYGTiTBvN3GeAmQKgcJcwd36vVzCaDGRe3aT nhuQ== 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 Cc: linux-arm-kernel@lists.infradead.org, sakari.ailus@maxwell.research.nokia.com, kyungmin.park@samsung.com, s.nawrocki@samsung.com, laurent.pinchart@ideasonboard.com, mchehab@infradead.org, kernel@pengutronix.de, Javier Martin 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: ALoCoQlozYJrqdkXVrBdxel2law6tjbs5i0/yx5aX/gIUKtNcZ3J8hWLy6SPlOE/LeVBzDK+s9zj Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.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(); }