From patchwork Wed Feb 26 09:14:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jyri Sarha X-Patchwork-Id: 3722611 Return-Path: X-Original-To: patchwork-linux-omap@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 14C23BF13A for ; Wed, 26 Feb 2014 09:15:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3F41D2017B for ; Wed, 26 Feb 2014 09:15:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4792820173 for ; Wed, 26 Feb 2014 09:15:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752355AbaBZJOx (ORCPT ); Wed, 26 Feb 2014 04:14:53 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:50518 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751497AbaBZJOt (ORCPT ); Wed, 26 Feb 2014 04:14:49 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s1Q9Ek68024603; Wed, 26 Feb 2014 03:14:46 -0600 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s1Q9Ejan028951; Wed, 26 Feb 2014 03:14:46 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Wed, 26 Feb 2014 03:14:45 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s1Q9EilO019561; Wed, 26 Feb 2014 03:14:45 -0600 From: Jyri Sarha To: , , , , CC: , , Jyri Sarha Subject: [PATCH RFC 4/5] ASoC: davinci-evm: Add AM43xx-EPOS-EVM audio support Date: Wed, 26 Feb 2014 11:14:28 +0200 Message-ID: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.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 | 41 ++++++++++++++++++++ 2 files changed, 47 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..d4d965e 100644 --- a/sound/soc/davinci/davinci-evm.c +++ b/sound/soc/davinci/davinci-evm.c @@ -128,6 +128,33 @@ 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_dapm_context *dapm = &codec->dapm; + struct device_node *np = codec->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 +353,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);