From patchwork Wed Apr 27 09:06:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 8953971 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 7E606BF29F for ; Wed, 27 Apr 2016 09:07:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9789320225 for ; Wed, 27 Apr 2016 09:07:12 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 44C1F201EC for ; Wed, 27 Apr 2016 09:07:08 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4AF0A265A89; Wed, 27 Apr 2016 11:07:06 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, NO_DNS_FOR_FROM,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 86183265D01; Wed, 27 Apr 2016 11:06:56 +0200 (CEST) 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 64767265D37; Wed, 27 Apr 2016 11:06:55 +0200 (CEST) Received: from emea01-db3-obe.outbound.protection.outlook.com (mail-db3on0143.outbound.protection.outlook.com [157.55.234.143]) by alsa0.perex.cz (Postfix) with ESMTP id 81725265A72 for ; Wed, 27 Apr 2016 11:06:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axentiatech.onmicrosoft.com; s=selector1-axentia-se; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=IfWIu43hk0j28Q1tvxngsXO9gfUrKPxTec+qTMFtdoE=; b=GlAoIum5zQec//poN/ZqYn+A0GBIpdrTlB5GVkGCJpoeopVVZXlYAmPJpps8TGQ3nM3IdzGIK015mgAIZWt34NaNmsamt0ZqwxLeMxttojeDkp5HpbSDd790zMepj11fuxPOSiSCf9E2C3ZNF4BS5BnaJNyUsgSZuJX5Idv+xts= Authentication-Results: atmel.com; dkim=none (message not signed) header.d=none; atmel.com; dmarc=none action=none header.from=axentia.se; Received: from localhost.localdomain (217.210.101.82) by HE1PR02MB1306.eurprd02.prod.outlook.com (10.169.115.152) with Microsoft SMTP Server (TLS) id 15.1.477.8; Wed, 27 Apr 2016 09:06:46 +0000 From: Peter Rosin To: Nicolas Ferre Date: Wed, 27 Apr 2016 11:06:33 +0200 Message-ID: <1461747993-11516-1-git-send-email-peda@axentia.se> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-Originating-IP: [217.210.101.82] X-ClientProxiedBy: DB5PR09CA0032.eurprd09.prod.outlook.com (10.161.191.42) To HE1PR02MB1306.eurprd02.prod.outlook.com (10.169.115.152) X-MS-Office365-Filtering-Correlation-Id: 70724354-359a-4c02-0bb1-08d36e7b4341 X-Microsoft-Exchange-Diagnostics: 1; HE1PR02MB1306; 2:+YW1sDdEGlpcNziP6Tv/iUlJm4PHHfxuEbIJRcoc9YVOGJe4Z8RBJvIEYkgnAo6Wf4gSy0kcZm8ijoYSCQj+bnBUsrvFu0KrONmmjZ7TphHVxUNCsBSYQ5XMTJHhlbZ3sLKHl9AZswoB5qUHVdPko5WMTx7vtNdx8vsl2f0muhnNlwYCjCQync0CzZ6rv4IJ; 3:PvMg9J/kTPtojFYNWQ5GKQu0an1AbH939CNIJWTlj13IRnKE3laYqeXk4W9dEJ2wZ6ZT404H9iAPQWE+r+hsvjkhD3RPYm2Z0JvVChmMwu6hk7PWNqpjZdF9B82EHva6; 25:ndEMJdvZ2xBUsxQ8/xwNNcxtRY2vexK+udg4AtGdIIUnyLDudYRFWQBI+usAn6U+yQa/YhbiknbTkE+wBop+JHLWpoELlbSeFUYJ+fmK/zavPRgE0KIgIsNijwOpGoj/uM/OKqXzf8gwZUOcsMaLDk8up0zI6Ghh6js/uWklFqSqaq/msnXyYwejK+H+wUz1LyQuFnS0xl+QF8SDZi3iLqhFzY6WRA5PqVOWPR1xbF1n8YHFzxMvj/z5NNw5nXHRx0Gr+SgndvIVStMl9TgA4ABk+wgV0kdSAH985qLf0SP8Zaulc1795xOWUc7piwZxQl24I/HSX+Xzj/t/LVnpPw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HE1PR02MB1306; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(9101521072)(6040130)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041072)(6043046); SRVR:HE1PR02MB1306; BCL:0; PCL:0; RULEID:; SRVR:HE1PR02MB1306; X-Microsoft-Exchange-Diagnostics: 1; HE1PR02MB1306; 4:KRiuBxLFNoLLlnU1lxx43k6C8qqgKBb2fWlPxUikfLpI/KxMKVcyTrMq/8AsZar2gggSS5UM30PEtcGRocDHnYWtBeM0uxiWiNY6sv97NUTuYO/SQb2BMmAE4ze50+Mf+3OhXoQWWQYoQJOjj5y6xxj6lAAS+Cs/3DX3CJHs7BWjZLLrTCkIKiN3KObliv9C/sxsSFnxJI8k/iL3IXc6JyJ8eQxAyi79V3lUFcwrhfE7JKQ7cB7Jdg1rFAGMk1xewiHccRhE0cL6PMe20RptGI5pmWS/tqUvRSIH/P1MBBorzMu0OATAnFl+HynuFOApiGTfbApcPMZurPMGJw5P8nZ3wnlXjloZMGBvY4uMYbcEdccUA4GvK6L5jn4FKktfqIeT1j1OeSPHMtmbk3Q2907yh1dPHy91LSLWIZa+0XodZBS0Iq1mcV7DKsBFQ8oWaq+SS8xqIVa6OtyuMGc+XA== X-Forefront-PRVS: 0925081676 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6069001)(66066001)(5003940100001)(19580405001)(33646002)(19580395003)(5004730100002)(48376002)(189998001)(36756003)(50226002)(110136002)(47776003)(1096002)(3846002)(6116002)(5008740100001)(586003)(92566002)(42186005)(77096005)(86362001)(81166005)(2906002)(229853001)(4326007)(74482002)(50466002)(50986999)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR02MB1306; H:localhost.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; HE1PR02MB1306; 23:X4pX51VFcNXGi0aZQ81ZbcuwDRSy7py+YGSuea5n0emOUpItkhmRnUCvUoRWs26g5AqP3r5ER/iO6h53stWb6IdNYgocs7ugBwvaLcrYMfb+LmVUMCqn2jSkbedzHqa9XHcL2aMEl+AfIe0ng81b76C2A/d6XyO+SVF8xPEo1kKsJ/M/aW9KzHywyI+jqIKDTSuW3t6qIMsIeUiEz5DdWZygkOsmkNoBZby68J9f1deqJR0t7L4ooN6iDyM8G0qrxw8Km5BehUGcqNIKZwiisPTbpjBpJbz+yQgbAhToRr/NhB9F6GJqSnklrUCt8uznjK8+nbktEs71ggndCXkeC9TZziEbD95B0plZ2UKlVdIwZclmaDpnRDO6RYxKN8SoaedVCWG7nzCxFf4iKyacg2BkiHZrPprX3qh/SWgOD7M3r4YZAYppxWXbmowu2YpSwWIVRW1YKvj0EuvykCpZNell+eYnjCzByZOpGBdp7zuvv2f9LymbEe1GNhYPLC9u/Y7iADVp2Uuel7TbJU9C+b53fFfY/OoXnRjFEXOHkQddkP6gm84zNR5ISSpOphv79m7yG/eri3Hg/GC+6yo/Z8ILp5JG8e6D1QW8YtB9QYbEeu1Oj/o4fy5zcjKOXY0RW4RTdXpFA9MZ5s/czhzCZxX4Ii0xxUfhlMysdD5Zyb6mTFHP17AY5N/EeX4vdxrs7RpJtB0QuwC9Eh0tynEB49hugnlDKTCJmURH+wPwzAJ3DSF7byhSwRfJvjDpgt1PEcb6X7/NtQo/eLZSpSPZLzFpnl1Cnmw+JDgmgYIMOW05Py9/KDJpYdfDreJuLbgrfmPTKYNDM6nVwQvDQ7pVkndgDECMae1DQagFzenshyfHsyghqxws162ruzO41ba4 X-Microsoft-Exchange-Diagnostics: 1; HE1PR02MB1306; 5:YQ9anuq/KQlWU79lZN+ZQw9jrYRrG1mzm0RpYLzOMXiRiB6gjuvLFhV0Ng7TNEj0LPlYyo4L5ShSDZzoBI70b7MBrdNKxl+z/MNMx8Ns39KUjshPQIzGLykXhbLdktxHg8DcqQFZ84p58RM1JaOEnA==; 24:SVGAEEouduNQEoCuGzlse9jGJI+w2705zhG5urIeNUvuQQ1Oz2w008+7GKCDgvch77I8tx/HzQOHZuBcEuA22UQ1ce0Bq6xemZB2rPkeQME=; 7:GKhPiebiA4qkZzCgP55Ueu/odFInxLdTODHq3deXMjNkkJw+CSO1bpGMQH9W1zBp1aMGuXEx8gABeAO75dbkuFFp0oIpVAtnyFmAeXncHie6pRwGzJPP8fzlGZivDoa1BOkARtBMMOVOXS/oBRZ5oQpVjZAG5TlWNE9Uf00cdX5KGXZUtTfUZ31jCQRzw0Ew SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2016 09:06:46.3521 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR02MB1306 Cc: alsa-devel@alsa-project.org, Takashi Iwai , linux-kernel@vger.kernel.org, Liam Girdwood , Mark Brown , Peter Rosin Subject: [alsa-devel] [PATCH] ASoC: atmel_ssc_dai: note buggy I2S support when the codec masters LRCLK 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 The only difference in register settings between I2S and DSP mode A, for the SND_SOC_DAIFMT_CBM_CFM case, is the start condition (which is SSC_START_FALLING_RF for I2S and SSC_START_RISING_RF for DSP mode A). As this is not the only difference between the two formats, it is an indicator that something is seriously wrong. And it is the I2S support that is broken. While the start condition is correct for the left channel word in the I2S case, it is not correct that the right channel word follows immediately after the left channel word. The start of the right channel word should be triggered by a rising edge on LRCLK in the I2S case, something which simply does not happen. The correct thing to do would be to simply remove the alleged support for I2S/CBM_CFM, but that is likely to cause regressions. So, just make a note about the buggy I2S support in the source. Signed-off-by: Peter Rosin --- sound/soc/atmel/atmel_ssc_dai.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 4ab1e2013238..3108c6e20ad5 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -558,7 +558,15 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, break; case SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM: - /* I2S format, CODEC supplies BCLK and LRC clocks. */ + /* + * I2S format, CODEC supplies BCLK and LRC clocks. + * NOTE! This is not really I2S, as the SSC does not allow + * for any extra empty BCLK cycles after the left channel + * word. I.e. the SSC is only looking at the falling edge + * of LRCLK and ignores the rising edge. + * In reality, this is DSP mode A with inverted LRCLK. + * Use DSP mode A instead, if your codec supports it. + */ rcmr = SSC_BF(RCMR_PERIOD, 0) | SSC_BF(RCMR_STTDLY, START_DELAY) | SSC_BF(RCMR_START, SSC_START_FALLING_RF)