From patchwork Thu Mar 5 03:07:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 5943131 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7E124BF440 for ; Thu, 5 Mar 2015 03:07:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7022C20320 for ; Thu, 5 Mar 2015 03:07:55 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 1F6F12018E for ; Thu, 5 Mar 2015 03:07:53 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6052026546F; Thu, 5 Mar 2015 04:07:50 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 4F3D52651FF; Thu, 5 Mar 2015 04:07:40 +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 A6D102651FF; Thu, 5 Mar 2015 04:07:35 +0100 (CET) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) by alsa0.perex.cz (Postfix) with ESMTP id C1BF726520E for ; Thu, 5 Mar 2015 04:07:23 +0100 (CET) Received: by labge10 with SMTP id ge10so48665615lab.12 for ; Wed, 04 Mar 2015 19:07:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=81WxSln3IBjkuebwU4qWnaqgdoNkCLEwS63ILfo2hX8=; b=Y6D4ILEiIyLjIKHJ7LbLbVvvKQahqfK2FVEV7OKEJyCyFBXIHIKLPuYsVobt/nPUc/ WhNjkCmxXDr4rp0sR2/E4kUNuT2SJcjotEDgzYF8h+Ut5xMvnjmPgML/nsiI3Imu7Bk3 qBGHtuPhbqdjLuEzlgZyZDCv+1CmkVclJ9hcG3cl6dUdYpxtVWv2OAemsI3oNT1wWGCq JO3SxY3mseUujy+63XFxsM4ULL5G6GvD4XA82npgs1pKI612a97h7Uka6mHM2El0UBJw ChGElcmKBn0x7rGljaaQYRIH9N3cxb09uvD6Vc1QNuQjgqpQEqkI17Zfh/VNtQAlJo5J WUsg== MIME-Version: 1.0 X-Received: by 10.112.25.104 with SMTP id b8mr5873467lbg.69.1425524843239; Wed, 04 Mar 2015 19:07:23 -0800 (PST) Received: by 10.152.20.229 with HTTP; Wed, 4 Mar 2015 19:07:23 -0800 (PST) Date: Thu, 5 Mar 2015 00:07:23 -0300 Message-ID: From: Fabio Estevam To: Mark Brown Cc: Nicolin Chen , "alsa-devel@alsa-project.org" , Lars-Peter Clausen , Kuninori Morimoto Subject: [alsa-devel] Using simple-audio-card with imx6sl-evk 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 Hi, I am trying to get imx6sl-evk to work with simple-audio-card with the following changes: arch/arm/boot/dts/imx6sl-evk.dts | 52 ++++++++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 12 deletions(-) goto err; ,and this allows the probe to succeed. When I try to play I get: root@freescale /home$ aplay clarinet.wav [ 16.424340] wm8962 1-001a: Unsupported sysclk ratio 680 Playing WAVE 'clarinet.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono and the track is played with the wrong frequency and wrong sysclk ratio. Any suggestions as to how to use simple-card on this board? Thanks, Fabio Estevam diff --git a/arch/arm/boot/dts/imx6sl-evk.dts b/arch/arm/boot/dts/imx6sl-evk.dts index fda4932..24b9849 100644 --- a/arch/arm/boot/dts/imx6sl-evk.dts +++ b/arch/arm/boot/dts/imx6sl-evk.dts @@ -10,6 +10,7 @@ #include #include +#include #include "imx6sl.dtsi" / { @@ -92,19 +93,25 @@ }; sound { - compatible = "fsl,imx6sl-evk-wm8962", "fsl,imx-audio-wm8962"; - model = "wm8962-audio"; - ssi-controller = <&ssi2>; - audio-codec = <&codec>; - audio-routing = + compatible = "simple-audio-card"; + simple-audio-card,name = "wm8962-audio"; + simple-audio-card,format = "i2s"; + simple-audio-card,bitclock-master = <&dailink_master>; + simple-audio-card,frame-master = <&dailink_master>; + simple-audio-card,widgets = + "Headphone", "Headphone Jack"; + simple-audio-card,routing = "Headphone Jack", "HPOUTL", - "Headphone Jack", "HPOUTR", - "Ext Spk", "SPKOUTL", - "Ext Spk", "SPKOUTR", - "AMIC", "MICBIAS", - "IN3R", "AMIC"; - mux-int-port = <2>; - mux-ext-port = <3>; + "Headphone Jack", "HPOUTR"; + + simple-audio-card,cpu { + sound-dai = <&ssi2>; + }; + + dailink_master: simple-audio-card,codec { + sound-dai = <&codec>; + }; }; }; @@ -112,6 +119,26 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_audmux3>; status = "okay"; + + ssi2 { + fsl,audmux-port = <1>; + fsl,port-config = < + (IMX_AUDMUX_V2_PTCR_SYN | + IMX_AUDMUX_V2_PTCR_TFSDIR | + IMX_AUDMUX_V2_PTCR_TFSEL(2) | + IMX_AUDMUX_V2_PTCR_TCLKDIR | + IMX_AUDMUX_V2_PTCR_TCSEL(2)) + IMX_AUDMUX_V2_PDCR_RXDSEL(2) + >; + }; + + audmuxpins3 { + fsl,audmux-port = <2>; + fsl,port-config = < + IMX_AUDMUX_V2_PTCR_SYN + IMX_AUDMUX_V2_PDCR_RXDSEL(1) + >; + }; }; &ecspi1 { @@ -255,6 +282,7 @@ compatible = "wlf,wm8962"; reg = <0x1a>; clocks = <&clks IMX6SL_CLK_EXTERN_AUDIO>; + #sound-dai-cells = <0>; DCVDD-supply = <&vgen3_reg>; DBVDD-supply = <®_aud3v>; AVDD-supply = <&vgen3_reg>; Then I get the following probe error: [ 2.030249] input: WM8962 Beep Generator as /devices/soc0/soc/2100000.aips-bus/21a4000.i2c/i2c-1/1-001a/input/input1 [ 2.042388] wm8962 1-001a: simple-card: set_sysclk error [ 2.047805] asoc-simple-card sound: ASoC: failed to init 202c000.ssi-wm8962: -22 [ 2.055242] asoc-simple-card sound: ASoC: failed to instantiate card -22 [ 2.065117] asoc-simple-card: probe of sound failed with error -22 I compared how imx-wm8962 calls snd_soc_dai_set_sysclk and did the same on simple card (quick hack): --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -134,7 +134,7 @@ static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai, } if (set->sysclk) { - ret = snd_soc_dai_set_sysclk(dai, 0, set->sysclk, 0); + ret = snd_soc_dai_set_sysclk(dai, 1, set->sysclk, 0); if (ret && ret != -ENOTSUPP) { dev_err(dai->dev, "simple-card: set_sysclk error\n");