From patchwork Tue Sep 22 19:30:49 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: 49396 Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8MJX4Rv026235 for ; Tue, 22 Sep 2009 19:33:04 GMT Received: from dlep35.itg.ti.com ([157.170.170.118]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id n8MJVWti032293; Tue, 22 Sep 2009 14:31:32 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id n8MJVWXb008376; Tue, 22 Sep 2009 14:31:32 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 1F7918062A; Tue, 22 Sep 2009 14:31:32 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id 3FD4F80626 for ; Tue, 22 Sep 2009 14:31:29 -0500 (CDT) Received: from neches.ext.ti.com (localhost [127.0.0.1]) by dflp51.itg.ti.com (8.13.7/8.13.7) with ESMTP id n8MJVSJA020395 for ; Tue, 22 Sep 2009 14:31:29 -0500 (CDT) Received: from mail110-va3-R.bigfish.com (mail-va3.bigfish.com [216.32.180.113]) by neches.ext.ti.com (8.13.7/8.13.7) with ESMTP id n8MJVSAh024667 for ; Tue, 22 Sep 2009 14:31:28 -0500 Received: from mail110-va3 (localhost.localdomain [127.0.0.1]) by mail110-va3-R.bigfish.com (Postfix) with ESMTP id 7C29E1203EC for ; Tue, 22 Sep 2009 19:31:28 +0000 (UTC) X-SpamScore: 7 X-BigFish: vps7(zza4b1ozz1202hzzz2fh62h) X-Spam-TCS-SCL: 1:0 X-MS-Exchange-Organization-Antispam-Report: OrigIP: 74.208.67.6; Service: EHS Received: by mail110-va3 (MessageSwitch) id 1253647859886297_25637; Tue, 22 Sep 2009 19:30:59 +0000 (UCT) Received: from mail.navvo.net (mail.navvo.net [74.208.67.6]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail110-va3.bigfish.com (Postfix) with ESMTP id 32F611D0052; Tue, 22 Sep 2009 19:30:56 +0000 (UTC) Received: from [201.198.127.70] (helo=localhost.localdomain) by mail.navvo.net with esmtpa (Exim 4.63) (envelope-from ) id 1MqB4e-0003uS-SF; Tue, 22 Sep 2009 14:30:54 -0500 From: miguel.aguilar@ridgerun.com To: nsnehaprabha@ti.com, davinci-linux-open-source@linux.davincidsp.com, alsa-devel@alsa-project.org Date: Tue, 22 Sep 2009 13:30:49 -0600 Message-Id: <1253647849-32727-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) Cc: santiago.nunez@ridgerun.com, todd.fischer@ridgerun.com, clark.becker@ridgerun.com, Miguel Aguilar Subject: [PATCH 4/4] DaVinci: DM365: Add voice codec support for DM365 EVM 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 This patch enables the voice codec support for the DM365 EVM. For the DM365 EVM only one codec is able to be enabled at time, external (AIC3101) or internal (Voice Codec CQ0093). Either internal or external codec can be selected in the configuration menu. This patch was created based on the temp/asoc branch of the DaVinci git and it assumes that the patch "[PATCH v4 2/2] ASoC: Davinci: Add audio codec support for DM365 EVM" is applied. This patch was tested on the DM365 EVM rev C. Signed-off-by: Miguel Aguilar --- arch/arm/mach-davinci/board-dm365-evm.c | 4 +++ sound/soc/davinci/davinci-evm.c | 42 +++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index 77f815c..083b8d7 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c @@ -482,7 +482,11 @@ static __init void dm365_evm_init(void) /* maybe setup mmc1/etc ... _after_ mmc0 */ evm_init_cpld(); +#if defined(CONFIG_SND_DM365_EXTERNAL_CODEC) dm365_init_asp(&dm365_evm_snd_data); +#elif defined(CONFIG_SND_DM365_INTERNAL_CODEC) + dm365_init_vcif(&dm365_evm_snd_data); +#endif } static __init void dm365_evm_irq_init(void) diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c index 7ccbe66..e826a80 100644 --- a/sound/soc/davinci/davinci-evm.c +++ b/sound/soc/davinci/davinci-evm.c @@ -28,9 +28,11 @@ #include #include "../codecs/tlv320aic3x.h" +#include "../codecs/cq93vc.h" #include "../codecs/spdif_transciever.h" #include "davinci-pcm.h" #include "davinci-i2s.h" +#include "davinci-vcif.h" #include "davinci-mcasp.h" #define AUDIO_FORMAT (SND_SOC_DAIFMT_DSP_B | \ @@ -151,6 +153,15 @@ static struct snd_soc_dai_link evm_dai = { .ops = &evm_ops, }; +#ifdef CONFIG_SND_DM365_INTERNAL_CODEC +static struct snd_soc_dai_link cq93vc_evm_dai = { + .name = "CQ93VC", + .stream_name = "CQ93", + .cpu_dai = &davinci_vcif_dai, + .codec_dai = &cq93vc_dai, +}; +#endif + static struct snd_soc_dai_link dm6467_evm_dai[] = { { .name = "TLV320AIC3X", @@ -177,7 +188,7 @@ static struct snd_soc_dai_link da8xx_evm_dai = { .ops = &evm_ops, }; -/* davinci dm6446, dm355 or dm365 evm audio machine driver */ +/* davinci dm6446, dm355 evm audio machine driver */ static struct snd_soc_card snd_soc_card_evm = { .name = "DaVinci EVM", .platform = &davinci_soc_platform, @@ -185,6 +196,19 @@ static struct snd_soc_card snd_soc_card_evm = { .num_links = 1, }; +/* davinci dm365 evm audio machine driver external or internal */ +static struct snd_soc_card dm365_snd_soc_card_evm = { +#if defined(CONFIG_SND_DM365_EXTERNAL_CODEC) + .name = "DaVinci DM365 EVM", + .dai_link = &evm_dai, +#elif defined(CONFIG_SND_DM365_INTERNAL_CODEC) + .name = "On-chip Voice Codec", + .dai_link = &cq93vc_evm_dai, +#endif + .platform = &davinci_soc_platform, + .num_links = 1, +}; + /* davinci dm6467 evm audio machine driver */ static struct snd_soc_card dm6467_snd_soc_card_evm = { .name = "DaVinci DM6467 EVM", @@ -217,6 +241,17 @@ static struct snd_soc_device evm_snd_devdata = { }; /* evm audio subsystem */ +static struct snd_soc_device dm365_evm_snd_devdata = { + .card = &dm365_snd_soc_card_evm, +#if defined(CONFIG_SND_DM365_EXTERNAL_CODEC) + .codec_dev = &soc_codec_dev_aic3x, + .codec_data = &aic3x_setup, +#elif defined(CONFIG_SND_DM365_INTERNAL_CODEC) + .codec_dev = &soc_codec_dev_cq93vc, +#endif +}; + +/* evm audio subsystem */ static struct snd_soc_device dm6467_evm_snd_devdata = { .card = &dm6467_snd_soc_card_evm, .codec_dev = &soc_codec_dev_aic3x, @@ -244,12 +279,15 @@ static int __init evm_init(void) int index; int ret; - if (machine_is_davinci_evm() || machine_is_davinci_dm365_evm()) { + if (machine_is_davinci_evm()) { evm_snd_dev_data = &evm_snd_devdata; index = 0; } else if (machine_is_davinci_dm355_evm()) { evm_snd_dev_data = &evm_snd_devdata; index = 1; + } else if (machine_is_davinci_dm365_evm()) { + evm_snd_dev_data = &dm365_evm_snd_devdata; + index = 0; } else if (machine_is_davinci_dm6467_evm()) { evm_snd_dev_data = &dm6467_evm_snd_devdata; index = 0;