From patchwork Fri Jul 10 21:28:24 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 35113 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6ALTxbx031079 for ; Fri, 10 Jul 2009 21:29:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752936AbZGJV3B (ORCPT ); Fri, 10 Jul 2009 17:29:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757191AbZGJV26 (ORCPT ); Fri, 10 Jul 2009 17:28:58 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:58995 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755346AbZGJV2r (ORCPT ); Fri, 10 Jul 2009 17:28:47 -0400 Received: from dlep33.itg.ti.com ([157.170.170.112]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id n6ALSQq3013162; Fri, 10 Jul 2009 16:28:32 -0500 Received: from dlep20.itg.ti.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id n6ALSQs5007833; Fri, 10 Jul 2009 16:28:26 -0500 (CDT) Received: from dlee74.ent.ti.com (localhost [127.0.0.1]) by dlep20.itg.ti.com (8.12.11/8.12.11) with ESMTP id n6ALSQuJ002254; Fri, 10 Jul 2009 16:28:26 -0500 (CDT) Received: from dlee06.ent.ti.com ([157.170.170.11]) by dlee74.ent.ti.com ([157.170.170.8]) with mapi; Fri, 10 Jul 2009 16:28:26 -0500 From: "Karicheri, Muralidharan" To: "rmk@arm.linux.org.uk" CC: Mauro Carvalho Chehab , "linux-media@vger.kernel.org" , Hans Verkuil Date: Fri, 10 Jul 2009 16:28:24 -0500 Subject: [PATCH 8/11 - v3] ARM: DM6446 platform changes for vpfe capture driver Thread-Topic: [PATCH 8/11 - v3] ARM: DM6446 platform changes for vpfe capture driver Thread-Index: AcoBpVtW68jVV6FgQoaREn1lMhDKqA== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Hello Russell, This patch is part of the vpfe capture driver (V4L) that adds platform code for the driver on DM6446 which is an ARM based SoC. I have attached the original pull request to this email. Please review this and Let us know your comments. Thanks. Murali Karicheri m-karicheri2@ti.com From: m-karicheri2@ti.com To: hverkuil@xs4all.nl, mchehab@infradead.org Cc: Muralidharan Karicheri Subject: [PATCH 8/11 - v3] DM6446 platform changes for vpfe capture driver Date: Mon, 6 Jul 2009 13:32:37 -0400 From: Muralidharan Karicheri DM644x platform and board setup This adds plarform and board setup changes required to support vpfe capture driver on DM644x Reviewed by: Hans Verkuil Reviewed by: Laurent Pinchart Reviewed by: Kevin Hilman Reviewed by: David Brownell Signed-off-by: Muralidharan Karicheri --- Applies to Linus' GIT Tree arch/arm/mach-davinci/board-dm644x-evm.c | 72 ++++++++++++++++++++++++++- arch/arm/mach-davinci/dm644x.c | 56 +++++++++++++++++++++ arch/arm/mach-davinci/include/mach/dm644x.h | 2 + 3 files changed, 128 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c index d9d4045..151a622 100644 --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c @@ -28,7 +28,8 @@ #include #include #include - +#include +#include #include #include @@ -195,6 +196,72 @@ static struct platform_device davinci_fb_device = { .num_resources = 0, }; +static struct tvp514x_platform_data tvp5146_pdata = { + .clk_polarity = 0, + .hs_polarity = 1, + .vs_polarity = 1 +}; + +#define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL) +/* Inputs available at the TVP5146 */ +static struct v4l2_input tvp5146_inputs[] = { + { + .index = 0, + .name = "Composite", + .type = V4L2_INPUT_TYPE_CAMERA, + .std = TVP514X_STD_ALL, + }, + { + .index = 1, + .name = "S-Video", + .type = V4L2_INPUT_TYPE_CAMERA, + .std = TVP514X_STD_ALL, + }, +}; + +/* + * this is the route info for connecting each input to decoder + * ouput that goes to vpfe. There is a one to one correspondence + * with tvp5146_inputs + */ +static struct vpfe_route tvp5146_routes[] = { + { + .input = INPUT_CVBS_VI2B, + .output = OUTPUT_10BIT_422_EMBEDDED_SYNC, + }, + { + .input = INPUT_SVIDEO_VI2C_VI1C, + .output = OUTPUT_10BIT_422_EMBEDDED_SYNC, + }, +}; + +static struct vpfe_subdev_info vpfe_sub_devs[] = { + { + .name = "tvp5146", + .grp_id = 0, + .num_inputs = ARRAY_SIZE(tvp5146_inputs), + .inputs = tvp5146_inputs, + .routes = tvp5146_routes, + .can_route = 1, + .ccdc_if_params = { + .if_type = VPFE_BT656, + .hdpol = VPFE_PINPOL_POSITIVE, + .vdpol = VPFE_PINPOL_POSITIVE, + }, + .board_info = { + I2C_BOARD_INFO("tvp5146", 0x5d), + .platform_data = &tvp5146_pdata, + }, + }, +}; + +static struct vpfe_config vpfe_cfg = { + .num_subdevs = ARRAY_SIZE(vpfe_sub_devs), + .sub_devs = vpfe_sub_devs, + .card_name = "DM6446 EVM", + .ccdc = "DM6446 CCDC", +}; + static struct platform_device rtc_dev = { .name = "rtc_davinci_evm", .id = -1, @@ -560,7 +627,6 @@ static struct i2c_board_info __initdata i2c_info[] = { }, /* ALSO: * - tvl320aic33 audio codec (0x1b) - * - tvp5146 video decoder (0x5d) */ }; @@ -591,6 +657,8 @@ static struct davinci_uart_config uart_config __initdata = { static void __init davinci_evm_map_io(void) { + /* setup input configuration for VPFE input devices */ + dm644x_set_vpfe_config(&vpfe_cfg); dm644x_init(); } diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index fb5449b..cc8fc78 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c @@ -530,6 +530,59 @@ static struct platform_device dm644x_edma_device = { .resource = edma_resources, }; +static struct resource dm644x_vpss_resources[] = { + { + /* VPSS Base address */ + .name = "vpss", + .start = 0x01c73400, + .end = 0x01c73400 + 0xff, + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device dm644x_vpss_device = { + .name = "vpss", + .id = -1, + .dev.platform_data = "dm644x_vpss", + .num_resources = ARRAY_SIZE(dm644x_vpss_resources), + .resource = dm644x_vpss_resources, +}; + +static struct resource vpfe_resources[] = { + { + .start = IRQ_VDINT0, + .end = IRQ_VDINT0, + .flags = IORESOURCE_IRQ, + }, + { + .start = IRQ_VDINT1, + .end = IRQ_VDINT1, + .flags = IORESOURCE_IRQ, + }, + { + .start = 0x01c70400, + .end = 0x01c70400 + 0xff, + .flags = IORESOURCE_MEM, + }, +}; + +static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32); +static struct platform_device vpfe_capture_dev = { + .name = CAPTURE_DRV_NAME, + .id = -1, + .num_resources = ARRAY_SIZE(vpfe_resources), + .resource = vpfe_resources, + .dev = { + .dma_mask = &vpfe_capture_dma_mask, + .coherent_dma_mask = DMA_BIT_MASK(32), + }, +}; + +void dm644x_set_vpfe_config(struct vpfe_config *cfg) +{ + vpfe_capture_dev.dev.platform_data = cfg; +} + /*----------------------------------------------------------------------*/ static struct map_desc dm644x_io_desc[] = { @@ -652,6 +705,9 @@ static int __init dm644x_init_devices(void) platform_device_register(&dm644x_edma_device); platform_device_register(&dm644x_emac_device); + platform_device_register(&dm644x_vpss_device); + platform_device_register(&vpfe_capture_dev); + return 0; } postcore_initcall(dm644x_init_devices); diff --git a/arch/arm/mach-davinci/include/mach/dm644x.h b/arch/arm/mach-davinci/include/mach/dm644x.h index 15d42b9..0066db3 100644 --- a/arch/arm/mach-davinci/include/mach/dm644x.h +++ b/arch/arm/mach-davinci/include/mach/dm644x.h @@ -25,6 +25,7 @@ #include #include #include +#include #define DM644X_EMAC_BASE (0x01C80000) #define DM644X_EMAC_CNTRL_OFFSET (0x0000) @@ -34,5 +35,6 @@ #define DM644X_EMAC_CNTRL_RAM_SIZE (0x2000) void __init dm644x_init(void); +void dm644x_set_vpfe_config(struct vpfe_config *cfg); #endif /* __ASM_ARCH_DM644X_H */