From patchwork Wed Nov 29 18:59:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 120047 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp4725491edl; Wed, 29 Nov 2017 11:00:48 -0800 (PST) X-Google-Smtp-Source: AGs4zMZDjTMhWp8X4ZZBKCG/j7W9XRlBdFsjrL4B2BO2FBVn2wHys+fpA5fWpJWZcgu8AoTboDvH X-Received: by 10.223.147.133 with SMTP id 5mr3218884wrp.230.1511982048187; Wed, 29 Nov 2017 11:00:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511982048; cv=none; d=google.com; s=arc-20160816; b=qa9nmCH/LeGavF3O6pXJxH+lM7LQHwnz//Oa9ZhnGmYV5Kohc/4wHEjqiWZxXwf41x loCHnuzeoDaL+OmLx+B/8QPdAqoueXlFXYHRU8cilbvaEAWiVrR1rlCSSut2IGajaLlK rEcr8jmINIdPRgUxpKf/++H9iemBmI8oTUupOb/iyeL+S+58v1xDfXgZUQSoRTs+yG28 iAJDNUNTXzAUKdNK5A5zTMcJZ+ma/QikQSyZr9h10wufectHeLJRKCls8NkOeyZucATw i2U15bTpZR9YQFiIjtcHcP3KIESnVGi61sdGSCGweoIuEgYvYT2H1NR2CzAx9y60EdTr jwFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=7p0/MK6UnYnw8A30d+eW0xM/vohXOQa16aNmiV/FLLU=; b=nzZhXu+meSCdN92tNj81aoCDEfqvsBShWABAReJUMaZubY30pIc9pVhQI5F15WkZvK mbTS2XMQgzoZsRcQinnMtw2ubh0Gol1Njnd7uu3ZF4K7+6Ls3tUVptB6TpQrRM6fBO+y 1AxAYuV2zUl5TJe6kOobp3VXpCp0i9RfFBJVdQNRR6xeeft8rNU5CmnNzTCp+gtjUbpw K4Uy0Ke2ze98rD52z7oHLFfo0eS0++5dzGo1sPg2xX1MYxGszq9g6WNYeOCoccNU/DOK jXJNR1GIyMtl4bWJFM0w2RfiFBzhSXmnEPw5C9D6isfdv78J3ovKOKxbE/DwCK4LWJ73 ggXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=cud4fX3U; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id r125si1777152wmg.70.2017.11.29.11.00.47; Wed, 29 Nov 2017 11:00:48 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=cud4fX3U; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 8234F26797D; Wed, 29 Nov 2017 20:00:32 +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 C433326797C; Wed, 29 Nov 2017 20:00:30 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 26E0E267964 for ; Wed, 29 Nov 2017 20:00:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=wMpg3JQkyAL5Oaq/1J4nX5Qh6gDscKivLWmX9gUArgQ=; b=cud4fX3UQyE3 +ZVNrDr2tPb411rAg858tv8uYsnZPeuBlGaHrg4rbEnwz9bgT8F4bliNyTpWx8g9D2Te/O9+VGT0T Zown3ymIdK4k1LGxJjMR2GQ307nbI8HonAQFVawvrdfxdnMB9hk4ia03jm4Jw7BDa/7G3MCzsq7w5 tA84A=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1eK7aQ-0001cJ-Nm; Wed, 29 Nov 2017 18:59:58 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1eK7aQ-0004hM-AY; Wed, 29 Nov 2017 18:59:58 +0000 From: Mark Brown To: Maciej S. Szmigiero In-Reply-To: Message-Id: Date: Wed, 29 Nov 2017 18:59:58 +0000 Cc: alsa-devel@alsa-project.org, Xiubo Li , Liam Girdwood , Takashi Iwai , linux-kernel , Timur Tabi , Nicolin Chen , Mark Brown , Fabio Estevam , linuxppc-dev@lists.ozlabs.org Subject: [alsa-devel] Applied "ASoC: fsl_ssi: add 20-bit sample format for AC'97 and use it for capture" to the asoc tree 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: fsl_ssi: add 20-bit sample format for AC'97 and use it for capture has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 10582635dc8f4f99448c5dcddac38cc18a72dfde Mon Sep 17 00:00:00 2001 From: "Maciej S. Szmigiero" Date: Mon, 27 Nov 2017 23:34:44 +0100 Subject: [PATCH] ASoC: fsl_ssi: add 20-bit sample format for AC'97 and use it for capture When testing AC'97 capture on UDOO board (currently the only user of fsl_ssi driver in the AC'97 mode) it become obvious that there is a massive distortion above certain, small input signal. This problem has been traced to silicon errata ERR003778: "In AC97, 16-bit mode, received data is shifted by 4-bit locations" that has "No fix scheduled". This errata suggests a workaround of doing a 4-bit shift back in SDMA script for this specific operation mode, however our SDMA scripts are shared between various SoC peripherals so we can't really modify them. There is a simple way to avoid this problem, however, that is to disallow recording in 16-bit mode and only support it in AC'97-native 20-bit mode. We have to use a 4-byte format for this since SSI FIFOs do not allow 3-byte accesses (and these aren't supported by imx-sdma driver anyway). With this change the capture distortion is gone. We can also add this format as an additional one supported for playback, using this opportunity to make sure that we use CPU-endian-native formats in AC'97 mode as we already do in I2S mode. There is no problem in using different bit widths in playback and capture in AC'97 mode so allow this, too. Signed-off-by: Maciej S. Szmigiero Signed-off-by: Mark Brown --- sound/soc/fsl/fsl_ssi.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 2.15.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 20ef09e1a395..c350117c8e31 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -1278,14 +1278,15 @@ static struct snd_soc_dai_driver fsl_ssi_ac97_dai = { .channels_min = 2, .channels_max = 2, .rates = SNDRV_PCM_RATE_8000_48000, - .formats = SNDRV_PCM_FMTBIT_S16_LE, + .formats = SNDRV_PCM_FMTBIT_S16 | SNDRV_PCM_FMTBIT_S20, }, .capture = { .stream_name = "AC97 Capture", .channels_min = 2, .channels_max = 2, .rates = SNDRV_PCM_RATE_48000, - .formats = SNDRV_PCM_FMTBIT_S16_LE, + /* 16-bit capture is broken (errata ERR003778) */ + .formats = SNDRV_PCM_FMTBIT_S20, }, .ops = &fsl_ssi_dai_ops, }; @@ -1557,11 +1558,12 @@ static int fsl_ssi_probe(struct platform_device *pdev) /* Are the RX and the TX clocks locked? */ if (!of_find_property(np, "fsl,ssi-asynchronous", NULL)) { - if (!fsl_ssi_is_ac97(ssi_private)) + if (!fsl_ssi_is_ac97(ssi_private)) { ssi_private->cpu_dai_drv.symmetric_rates = 1; + ssi_private->cpu_dai_drv.symmetric_samplebits = 1; + } ssi_private->cpu_dai_drv.symmetric_channels = 1; - ssi_private->cpu_dai_drv.symmetric_samplebits = 1; } /* Determine the FIFO depth. */