From patchwork Wed Jul 11 08:55:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martin X-Patchwork-Id: 1180951 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id C19193FC5A for ; Wed, 11 Jul 2012 08:55:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752078Ab2GKIzW (ORCPT ); Wed, 11 Jul 2012 04:55:22 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:47317 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751737Ab2GKIzS (ORCPT ); Wed, 11 Jul 2012 04:55:18 -0400 Received: by wibhr14 with SMTP id hr14so885135wib.1 for ; Wed, 11 Jul 2012 01:55:17 -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=D78C8awwpgfzfeyaH4mPj2BAytqqWzkG5zl78Q0wgFU=; b=bbz/kdRDi3mcUl353iJQM1RhE3mdfv9kGte8WQrG9uyVTMpGjYPPyCSyd5kb4NsLhx Qb48dQ6rimi1A5VdZHlNj+4ST9eWb6AUG3BnnvEzdV3NEaL0oi51ZEMGmCqpFtsWHbtW D4MMPWxUimi3AN0I8fznZBeeJvcccMlQoWckihi3AzUFwQCT2mCu5CpvPnEfjRsvitbu JALTMtiaQSTf+4g91I726rs98jPDihdpMCLiDYbq8KlZfgykVJo9cfZvExpq+JPOXdY0 GmD8oneez4U8psX3Yg5IO06dj3S3VFmyL8Zy0mko/8li11g2YsZIi7CARPtZD0V11UFD h9ww== Received: by 10.216.180.197 with SMTP id j47mr7487417wem.35.1341996917590; Wed, 11 Jul 2012 01:55:17 -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 ep14sm9941926wid.0.2012.07.11.01.55.15 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 Jul 2012 01:55:17 -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, linux@arm.linux.org.uk, Javier Martin Subject: [PATCH 2/2] i.MX27: Visstrim_M10: Add support for deinterlacing driver. Date: Wed, 11 Jul 2012 10:55:04 +0200 Message-Id: <1341996904-22893-3-git-send-email-javier.martin@vista-silicon.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1341996904-22893-1-git-send-email-javier.martin@vista-silicon.com> References: <1341996904-22893-1-git-send-email-javier.martin@vista-silicon.com> X-Gm-Message-State: ALoCoQmCRl360bHOIcVE3N8pD9qNkUSxx/58U/0568RaEdve1hbhK2HD0NS+q7seH3VvMk9v4fIA 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. --- arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 31 ++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c index 214e4ff..1566126 100644 --- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c +++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c @@ -192,8 +192,8 @@ static struct soc_camera_link iclink_tvp5150 = { .bus_id = 0, .board_info = &visstrim_i2c_camera, .i2c_adapter_id = 0, - .power = visstrim_camera_power, - .reset = visstrim_camera_reset, +// .power = visstrim_camera_power, +// .reset = visstrim_camera_reset, }; static struct mx2_camera_platform_data visstrim_camera = { @@ -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(); }