From patchwork Tue Mar 4 15:43:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jyri Sarha X-Patchwork-Id: 3762771 X-Patchwork-Delegate: broonie@sirena.org.uk Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 83661BF13A for ; Tue, 4 Mar 2014 15:44:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A3A63203DF for ; Tue, 4 Mar 2014 15:44:24 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 4C90E203DC for ; Tue, 4 Mar 2014 15:44:23 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 24757265801; Tue, 4 Mar 2014 16:44:22 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id BED5D2657CD; Tue, 4 Mar 2014 16:44:11 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2B2C02657CF; Tue, 4 Mar 2014 16:44:10 +0100 (CET) Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by alsa0.perex.cz (Postfix) with ESMTP id C74B52657A9 for ; Tue, 4 Mar 2014 16:44:02 +0100 (CET) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s24Fi0qH000336; Tue, 4 Mar 2014 09:44:00 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s24Fi0wm018117; Tue, 4 Mar 2014 09:44:00 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Tue, 4 Mar 2014 09:44:00 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s24FhxI5004182; Tue, 4 Mar 2014 09:43:59 -0600 From: Jyri Sarha To: Date: Tue, 4 Mar 2014 17:43:51 +0200 Message-ID: <1393947831-26116-1-git-send-email-jsarha@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <5315DF41.1090302@metafoo.de> References: <5315DF41.1090302@metafoo.de> MIME-Version: 1.0 Cc: peter.ujfalusi@ti.com, detheridge@ti.com, lars@metafoo.de, Jyri Sarha , liam.r.girdwood@linux.intel.com, broonie@kernel.org Subject: [alsa-devel] [PATCH v3] ASoC: davinci-evm: Add AM43xx-EPOS-EVM audio support X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Add machine driver support for AM43xx-ePOS-EVM and update associated device tree binding document. Signed-off-by: Jyri Sarha --- .../bindings/sound/davinci-evm-audio.txt | 9 +++-- sound/soc/davinci/davinci-evm.c | 42 ++++++++++++++++++++ 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/davinci-evm-audio.txt b/Documentation/devicetree/bindings/sound/davinci-evm-audio.txt index 865178d..356cba1 100644 --- a/Documentation/devicetree/bindings/sound/davinci-evm-audio.txt +++ b/Documentation/devicetree/bindings/sound/davinci-evm-audio.txt @@ -2,8 +2,10 @@ Required properties: - compatible : "ti,da830-evm-audio" : forDM365/DA8xx/OMAPL1x/AM33xx + : "ti,am43xx-epos-evm-audio" : for am43xx-epos-evm - ti,model : The user-visible name of this sound complex. -- ti,audio-codec : The phandle of the TLV320AIC3x audio codec +- ti,audio-codec : The phandle of the TLV320AIC3x audio codec, + or the TLV320AIC31xx audio codec. - ti,mcasp-controller : The phandle of the McASP controller - ti,codec-clock-rate : The Codec Clock rate (in Hz) applied to the Codec - ti,audio-routing : A list of the connections between audio components. @@ -14,9 +16,10 @@ Required properties: Board connectors: * Headphone Jack - * Line Out + * Line Out - "ti,da830-evm-audio" only * Mic Jack - * Line In + * Line In - "ti,da830-evm-audio" only + * Speaker - "ti,am43xx-epos-evm-audio" only Example: diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c index 5e3bc3c..75a6165 100644 --- a/sound/soc/davinci/davinci-evm.c +++ b/sound/soc/davinci/davinci-evm.c @@ -128,6 +128,34 @@ static int evm_aic3x_init(struct snd_soc_pcm_runtime *rtd) return 0; } +static const struct snd_soc_dapm_widget aic31xx_dapm_widgets[] = { + SND_SOC_DAPM_HP("Headphone Jack", NULL), + SND_SOC_DAPM_SPK("Speaker", NULL), + SND_SOC_DAPM_MIC("Mic Jack", NULL), +}; + +/* Logic for EVMs with an aic31xx */ +static int evm_aic31xx_init(struct snd_soc_pcm_runtime *rtd) +{ + struct snd_soc_codec *codec = rtd->codec; + struct snd_soc_card *card = rtd->card; + struct snd_soc_dapm_context *dapm = &card->dapm; + struct device_node *np = card->dev->of_node; + int ret; + + snd_soc_dapm_new_controls(dapm, aic31xx_dapm_widgets, + ARRAY_SIZE(aic31xx_dapm_widgets)); + + if (np) { + ret = snd_soc_of_parse_audio_routing(codec->card, + "ti,audio-routing"); + if (ret) + return ret; + } + + return 0; +} + /* davinci-evm digital audio interface glue - connects codec <--> CPU */ static struct snd_soc_dai_link dm6446_evm_dai = { .name = "TLV320AIC3X", @@ -326,11 +354,25 @@ static struct snd_soc_dai_link evm_dai_tlv320aic3x = { SND_SOC_DAIFMT_IB_NF, }; +static struct snd_soc_dai_link evm_dai_tlv320aic3111 = { + .name = "TLV320AIC3111", + .stream_name = "AIC3111", + .codec_dai_name = "tlv320aic31xx-hifi", + .ops = &evm_ops, + .init = evm_aic31xx_init, + .dai_fmt = (SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_DSP_B | + SND_SOC_DAIFMT_IB_NF), +}; + static const struct of_device_id davinci_evm_dt_ids[] = { { .compatible = "ti,da830-evm-audio", .data = (void *) &evm_dai_tlv320aic3x, }, + { + .compatible = "ti,am43xx-epos-evm-audio", + .data = &evm_dai_tlv320aic3111, + }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, davinci_evm_dt_ids);