From patchwork Tue Sep 22 19:30:03 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: miguel.aguilar@ridgerun.com X-Patchwork-Id: 49395 Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8MJWV4x026099 for ; Tue, 22 Sep 2009 19:32:32 GMT Received: from dlep33.itg.ti.com ([157.170.170.112]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id n8MJUQup003395; Tue, 22 Sep 2009 14:30:26 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id n8MJUQav013138; Tue, 22 Sep 2009 14:30:26 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 854588062A; Tue, 22 Sep 2009 14:30:24 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id 45C5C80626 for ; Tue, 22 Sep 2009 14:30:23 -0500 (CDT) Received: from medina.ext.ti.com (localhost [127.0.0.1]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id n8MJUNtY011621 for ; Tue, 22 Sep 2009 14:30:23 -0500 (CDT) Received: from mail109-tx2-R.bigfish.com (mail-tx2.bigfish.com [65.55.88.113]) by medina.ext.ti.com (8.13.7/8.13.7) with ESMTP id n8MJUMdI013310 for ; Tue, 22 Sep 2009 14:30:23 -0500 Received: from mail109-tx2 (localhost.localdomain [127.0.0.1]) by mail109-tx2-R.bigfish.com (Postfix) with ESMTP id E139ECE8569 for ; Tue, 22 Sep 2009 19:30:22 +0000 (UTC) X-SpamScore: 7 X-BigFish: vps7(zza4b1ozz1202hzzz2fh6bh65h) X-Spam-TCS-SCL: 4:0 X-FB-SS: 5, X-MS-Exchange-Organization-Antispam-Report: OrigIP: 74.208.67.6; Service: EHS Received: by mail109-tx2 (MessageSwitch) id 1253647812542309_6763; Tue, 22 Sep 2009 19:30:12 +0000 (UCT) Received: from TX2EHSMHS041.bigfish.com (unknown [10.9.14.239]) by mail109-tx2.bigfish.com (Postfix) with ESMTP id 6910A1790068; Tue, 22 Sep 2009 19:30:12 +0000 (UTC) Received: from mail.navvo.net (74.208.67.6) by TX2EHSMHS041.bigfish.com (10.9.99.141) with Microsoft SMTP Server (TLS) id 14.0.482.32; Tue, 22 Sep 2009 19:30:09 +0000 Received: from [201.198.127.70] (helo=localhost.localdomain) by mail.navvo.net with esmtpa (Exim 4.63) (envelope-from ) id 1MqB3v-0003tL-89; Tue, 22 Sep 2009 14:30:08 -0500 From: To: nsnehaprabha@ti.com, davinci-linux-open-source@linux.davincidsp.com, alsa-devel@alsa-project.org Date: Tue, 22 Sep 2009 13:30:03 -0600 Message-ID: <1253647803-32633-1-git-send-email-miguel.aguilar@ridgerun.com> X-Mailer: git-send-email 1.6.0.4 X-SA-Exim-Connect-IP: 201.198.127.70 X-SA-Exim-Mail-From: miguel.aguilar@ridgerun.com X-Spam-Checker-Version: SpamAssassin 3.1.7-deb (2006-10-05) on mail.navvo.net X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, NO_REAL_NAME autolearn=ham version=3.1.7-deb X-SA-Exim-Version: 4.2.1 (built Tue, 09 Jan 2007 17:23:22 +0000) X-SA-Exim-Scanned: Yes (on mail.navvo.net) MIME-Version: 1.0 X-Reverse-DNS: mail.navvo.net Cc: santiago.nunez@ridgerun.com, todd.fischer@ridgerun.com, clark.becker@ridgerun.com, Miguel Aguilar Subject: [PATCH 3/4] DaVinci: DM365: Add resources for voice codec and platform device for VCIF X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.4 Precedence: list List-Id: davinci-linux-open-source.linux.davincidsp.com List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com From: Miguel Aguilar 1) Add the resources needed by the CQ0093 voice codec. 2) Add platform device for the voice codec interface. Signed-off-by: Miguel Aguilar --- arch/arm/mach-davinci/dm365.c | 46 ++++++++++++++++++++++++++++ arch/arm/mach-davinci/include/mach/dm365.h | 5 +++ arch/arm/mach-davinci/include/mach/mux.h | 2 + 3 files changed, 53 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index 2674438..80dc35b 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c @@ -605,6 +605,8 @@ INT_CFG(DM365, INT_IMX1_DISABLE, 24, 1, 0, false) INT_CFG(DM365, INT_NSF_ENABLE, 25, 1, 1, false) INT_CFG(DM365, INT_NSF_DISABLE, 25, 1, 0, false) +EVT_CFG(DM365, EVT2_VC_TX, 0, 1, 1, false) +EVT_CFG(DM365, EVT3_VC_RX, 1, 1, 1, false) EVT_CFG(DM365, EVT2_ASP_TX, 0, 1, 0, false) EVT_CFG(DM365, EVT3_ASP_RX, 1, 1, 0, false) #endif @@ -835,6 +837,42 @@ static struct platform_device dm365_asp_device = { .resource = dm365_asp_resources, }; +static struct resource dm365_vcif_resources[] = { + /* The first are of Voice Codec registers before 0x80 belongs to VCIF */ + { + .start = DAVINCI_DM365_VC_BASE, + .end = DAVINCI_DM365_VC_BASE + (SZ_1K>>4) - 1, + .flags = IORESOURCE_MEM, + }, + { + .start = DAVINCI_DMA_VC_TX, + .end = DAVINCI_DMA_VC_TX, + .flags = IORESOURCE_DMA, + }, + { + .start = DAVINCI_DMA_VC_RX, + .end = DAVINCI_DMA_VC_RX, + .flags = IORESOURCE_DMA, + }, +}; + +static struct platform_device dm365_vcif_device = { + .name = "voice_codec", + .id = -1, + .num_resources = ARRAY_SIZE(dm365_vcif_resources), + .resource = dm365_vcif_resources, +}; + +struct resource cq93vc_resources[] = { + /* The base address for the Voice Codec registers is shifted by 0x80 */ + { + .start = DAVINCI_DM365_VC_BASE + 0x80, + .end = DAVINCI_DM365_VC_BASE + 0x80 + (SZ_1K>>3) - 1, + .flags = IORESOURCE_MEM, + }, +}; +EXPORT_SYMBOL_GPL(cq93vc_resources); + static struct map_desc dm365_io_desc[] = { { .virtual = IO_VIRT, @@ -950,6 +988,14 @@ void __init dm365_init_asp(struct snd_platform_data *pdata) platform_device_register(&dm365_asp_device); } +void __init dm365_init_vcif(struct snd_platform_data *pdata) +{ + davinci_cfg_reg(DM365_EVT2_VC_TX); + davinci_cfg_reg(DM365_EVT3_VC_RX); + dm365_vcif_device.dev.platform_data = pdata; + platform_device_register(&dm365_vcif_device); +} + void __init dm365_init(void) { davinci_common_init(&davinci_soc_info_dm365); diff --git a/arch/arm/mach-davinci/include/mach/dm365.h b/arch/arm/mach-davinci/include/mach/dm365.h index 2291c0d..b78ec55 100644 --- a/arch/arm/mach-davinci/include/mach/dm365.h +++ b/arch/arm/mach-davinci/include/mach/dm365.h @@ -25,7 +25,12 @@ #define DM365_EMAC_MDIO_OFFSET (0x4000) #define DM365_EMAC_CNTRL_RAM_SIZE (0x2000) +#define DAVINCI_DM365_VC_BASE (0x01D0C000) +#define DAVINCI_DMA_VC_TX 2 +#define DAVINCI_DMA_VC_RX 3 + void __init dm365_init(void); void __init dm365_init_asp(struct snd_platform_data *pdata); +void __init dm365_init_vcif(struct snd_platform_data *pdata); #endif /* __ASM_ARCH_DM365_H */ diff --git a/arch/arm/mach-davinci/include/mach/mux.h b/arch/arm/mach-davinci/include/mach/mux.h index 7732832..b01b5c4 100644 --- a/arch/arm/mach-davinci/include/mach/mux.h +++ b/arch/arm/mach-davinci/include/mach/mux.h @@ -311,6 +311,8 @@ enum davinci_dm365_index { DM365_INT_NSF_DISABLE, /* EDMA event muxing */ + DM365_EVT2_VC_TX, + DM365_EVT3_VC_RX, DM365_EVT2_ASP_TX, DM365_EVT3_ASP_RX, DM365_EVT26_MMC0_RX,