From patchwork Wed Nov 9 18:54:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 9420353 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F06DF601C0 for ; Wed, 9 Nov 2016 23:57:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE0CE29371 for ; Wed, 9 Nov 2016 23:57:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D20E9293B3; Wed, 9 Nov 2016 23:57:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACA1729371 for ; Wed, 9 Nov 2016 23:57:33 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 9D5F52665FA; Thu, 10 Nov 2016 00:57:31 +0100 (CET) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 14CBD2667F9; Thu, 10 Nov 2016 00:55:10 +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 126F126718E; Wed, 9 Nov 2016 19:54:54 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0127.outbound.protection.outlook.com [104.47.1.127]) by alsa0.perex.cz (Postfix) with ESMTP id 48AE4267186 for ; Wed, 9 Nov 2016 19:54:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axentiatech.onmicrosoft.com; s=selector1-axentia-se; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=LPm4SXple8WOPZN08z1ZpQo7/a3hd5Zzv3mKcy1rvZ0=; b=dNffjx2HhKy7sU+7FYqEPk8aMF/nxBALNVNXuF8Q+6FtACgQD6RIv4f16M6u8DDisJjQHWrEQW6LR1DvItTNO4U5z9P0sGzu5/yFSFnu8WzhMCJj8u6sD1jRMhV8HZQ7E2T2pomOu3CKKJFvhtmNeuIm+cDPblxqdQBp1Vfj6cc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; Received: from [192.168.0.125] (217.210.101.82) by AM5PR0201MB2307.eurprd02.prod.outlook.com (10.169.242.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.707.6; Wed, 9 Nov 2016 18:54:44 +0000 To: Mark Brown References: <1478622057-12426-1-git-send-email-peda@axentia.se> <1478622057-12426-3-git-send-email-peda@axentia.se> <20161109133852.nvlyiqow2xpbc6ga@sirena.org.uk> <3d6b99e8-f19f-51fd-1676-c3a4549ec312@axentia.se> From: Peter Rosin Organization: Axentia Technologies AB Message-ID: Date: Wed, 9 Nov 2016 19:54:39 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <3d6b99e8-f19f-51fd-1676-c3a4549ec312@axentia.se> X-Originating-IP: [217.210.101.82] X-ClientProxiedBy: HE1PR05CA0038.eurprd05.prod.outlook.com (10.162.181.48) To AM5PR0201MB2307.eurprd02.prod.outlook.com (10.169.242.151) X-MS-Office365-Filtering-Correlation-Id: 17a10859-87bb-45f5-83dd-08d408d1df6a X-Microsoft-Exchange-Diagnostics: 1; AM5PR0201MB2307; 2:WmHKW74Aj7FVJQ0AIlLMuiLENJy0kbZ2NR0v4GxuxWrQFNwhLzF90e5tVxZbNHVjlZBJ+oSGyhod3JbmfPkvq5Iot+ZE01j7e+CMQTv6tCo9BF1QBja5tpeEekojEHPVkLbgVi8HPkzPePy7AlMLWiTGL1Pzb5nqmkXfyJGvftGIG6UhaT+Qj4vRJM/VHSSaLcMgtsyr//KQaGAw7vfYvw==; 3:yJq7OMc0oL8K28GrGkDzIUqOZF0MPGeOpLlD2kzlcR8hlO0/6qp1yIJ5cJaMZs2orSCLa1orf70b2xqPUd+WN52WPjRTxMb8erjglwoKom9GPR03s52YxniMuqoqmO7YNZlVBo4A/U2g1wAQBjCrWw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM5PR0201MB2307; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0201MB2307; 25:BXPSFrNPuj8MVZl/P2FPq1PQ428Atvf04e7e4tTSRfbhQsLJOKUNhuFALh2xMd7Q/Xhn0aj26wYCJ5iNo8klDyeOq7904kXsVVy7+ntjxFhi9vn+G/g75iHwivEibsuHncFUrveXpri2aEwvIT3W9Hx+wN16caXIVBNQtgrnJxHcaFGqPNUryXdX9zRbdNn9bAKAtcf2t4Huaslo7Kfcwia2OwuWkIHWBc8ydLXkqvyfYT8TNbu6KzE+/mQpTiMVatlU2gL1IJ74McKbmcImgYS2AKfRGDjJgF5IRpIOH3ToW/96b+LE9rfZzt0Wod/RVRLVM7xguG42EUB9KUrgOSvQ6PgIZuTLmn4DPS68sUlyv6MZIZy+kMtsJ12IKf7rgkcLfEXlB0OZUq2/+XNGJHFRUva+RxRT6dWwSLM5XxjX14VcrJERnqDrqP4rmyDy0rerCEVBGxWPbmRJc5nrm8gxipIbFMGtcqQntagNsrn/VGNypORG1ClpCqzXRXPLymZxJVt78IZO6s9uwFEyLG1crVHI7uzFnJjS06nIXYRL2JWdInV8OvBZ/yCHg1G+Qm2j7KOHPzh3q4sKUN9MfIUGlzDM5EQPgo7cT9F9tKD420XlukI4l54SfokNeYqaKhNSsDksO/1qbSyA0r+X3baegA9//Vty9MLc1rDmwQ8GC/4nrfZt85iBc6Sc1poybh00fuwb47MYd98reZ/sxQ== X-Microsoft-Exchange-Diagnostics: 1; AM5PR0201MB2307; 31:0ieoRZhYCDYBVq9l4qVoH2+Xnz3na1/34ijptAoosNWJe0ysDA6HOwFDcSD7b/QEymOuOzTjjNhqbib7j33RlAyCemHV9ghCzC2ceDQNJzHIP6NDzaXebUcfiJ17NQp9hL4Hc1k8u/GK8GpZ2j1yBi3GS3ykvUoqgGcetpijzgXlrimJw5Ui7gnnD6/VdOFiEHK7l/UwUEY3NKaex2G6AoMGswkdelEv7QMTMX1pzJKy0CckGseBa5nrdgT0Vu1T; 4:CrVKuARRaD8/VH3LfNg5XpKQ+HtX9WsTqbHZKCrBsi2p+exhhv0brAKid3LIB9P7uzVC1a9uIScId1tbD6Tg69r1tQdyroweC3qZRQenUxewFaYlip/G+qH3K8XDOF3BwpjL4lbUSNCJkkdMTaXR43kAmWWvK766qPllUclfSIb8O0K3OYxEcf/jwGmvvbrCwUZh8sdjRzw4ZTFjYMd5bMhwrMDNruO8jnS2bEPOXltqOlSB0vKefTuy+Pnnfqq9PdqRuYbuxO77OIGwBIn7i5l4I2rk2XuL7fsn+3N6tnNoxrrXCoUc1Hqmz+aiomvUm8F1YYDPvIjSKaxfPXjiM/Xpq5u5eq9hpTDC1sG1LOgAANMkYpiB+FrrTp8siFv9o9T6qsty/dObfXh6MOuCE1ipS7QGLMugCFfndLCEYLUpcBKcLSNKqh+AcvfikOLX X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6043046)(6042046); SRVR:AM5PR0201MB2307; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0201MB2307; X-Forefront-PRVS: 0121F24F22 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6049001)(7916002)(199003)(24454002)(189002)(377424004)(110136003)(83506001)(97736004)(305945005)(93886004)(189998001)(65826007)(47776003)(117156001)(92566002)(586003)(65956001)(66066001)(6116002)(50986999)(7736002)(54356999)(4001350100001)(64126003)(77096005)(3846002)(6916009)(101416001)(31696002)(5660300001)(36756003)(33646002)(65806001)(575784001)(7846002)(2950100002)(86362001)(76176999)(68736007)(7416002)(50466002)(6666003)(31686004)(230700001)(4326007)(23746002)(42186005)(81166006)(8676002)(105586002)(74482002)(81156014)(106356001)(229853002)(2906002)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM5PR0201MB2307; H:[192.168.0.125]; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: axentia.se does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; AM5PR0201MB2307; 23:ITwmcHhLUhbAjzg46/A0ez3NFJeoesWNKHJ?= =?Windows-1252?Q?03ws8uERy/tO7scbz91Y+Be5Ss+gFSC/0B7FGb+VPgp299Qsaf+pnpfH?= =?Windows-1252?Q?lJK4rmZzKk08UMZBs2pis0hwCJK3257wk16zlMSK/UZuacEaiInVIxMz?= =?Windows-1252?Q?nt20h8mSLKRsUAXVVFCUmvY5mQdFqjmKG/QG67s46xlhW2S1CuVtZEXt?= =?Windows-1252?Q?EIphuY2osfHNaqhhjezodH1HmQd+HMseGln8FPb6LLbT+TWOnbtbEqpK?= =?Windows-1252?Q?Lp5TmlyAOLPvyrHuosKwgjeKzLWMV//7jrJe9suf9UFoLnKAOsyzDb/X?= =?Windows-1252?Q?0zKNu7ovfC9rqAIlCsDsl3LSE+fXNQnFnU2/QMVNyIYdC/Jf7T6ThrJJ?= =?Windows-1252?Q?KemhAAwaW6tbaPZsbdo1uWXO3qkN38kQE/YxVYBNU1HVQcb1gzpg0krF?= =?Windows-1252?Q?vBG17U2MWA9Wp6+4BSvGOHwX9jw+Y71PrBOGsPnLiRgs/TDyRZIyWZqQ?= =?Windows-1252?Q?5IZywGtyc4xsWUSIV4ngrpZfjj0kwr5NiNaMeB0eOEoSARc2Z3gR1Vmz?= =?Windows-1252?Q?wWETQx4hzM/T7X9C+DgzwJThkRYo/G89ci/BoXtVG9cNz3rDRhX+YL0w?= =?Windows-1252?Q?u4rAzgwDUf/QBB5scMvIWRjhcDLsE7RvkZyCUtVyqJlwXqsqTqnCNQJm?= =?Windows-1252?Q?itKqEsio94qzCntaLLLxBCXFKgZkr7ckFzpvdaVYHdY7Q3c4egi7Odm0?= =?Windows-1252?Q?eygm1wS3pl6VyM7NnPUBppQydib42OW9hHziPtVVifoT+U0Qf17EVpf6?= =?Windows-1252?Q?pO8gFcz6B+aMbYyK1ChUx7Jaf4Aow6fFSnj3jTQ3B4bWkSt2ExECnrmV?= =?Windows-1252?Q?daZaUcZjynO6Wu7Tb+XxbepQWthmNLtI0sv2zOUX4aCjiBAeEKGROeex?= =?Windows-1252?Q?8Eiy6UHvdqLjV017p3YzI1Ff4X0YaJr3f1VbIvlvGH+AXQhPEq7JApU6?= =?Windows-1252?Q?dbXPLEJOnIzctuJB6QgtJRkySTEnrwVSa8p7t85WpWSyhXrcDnHbeTwf?= =?Windows-1252?Q?H1dBkDA4P4FuEb+2yDBvZsejMBiT/icr1Cn4szTNckZRMO6z00xrQI7J?= =?Windows-1252?Q?YYGt45RRqe3/e6mRC+QtV4Sa6bsvJEl/BSDkP0WqTeVVzlw0NOQ44LTV?= =?Windows-1252?Q?5B8tD3lwRVJ+Lm42/qAaWfapaP+C47uGl99CO+LcEBNZVRFtUu9SN8tZ?= =?Windows-1252?Q?xLd7bTgiAcOYfotLjx2ONbKvTf6Y/T+eYKJNBYCdrQT6xC7HtJwRGKK5?= =?Windows-1252?Q?Am8fox6ysdJ+cZ949+eW0OwXArU6PTnNCzqiDjkSo+f+JaujVVE6U+lT?= =?Windows-1252?Q?gk+VQf5DKdgYpCg+mCJzow0mJRJDm/o3ig7kQ8O+Rf+FRqcdSRdvzA7V?= =?Windows-1252?Q?pg1LA5oT2DY5qNGBMIuKzKCtaAoqhkrjhTrB7hBfAQkIn1FpGnm8wFkX?= =?Windows-1252?Q?qI1OV5BnzoY64b1RnF8fS/o22Sf0n?= X-Microsoft-Exchange-Diagnostics: 1; AM5PR0201MB2307; 6:OafWDRkVnPvczjxXiUdognPJ7yFj7bzDt6Y7gKoqo3eKtHZNM6iPCUyPSKPbor4SqnuCmEW1GgOyFZg3LwJb9MP/PeEu3QU8RRtL0T0vctev9BfPOkxn+ls9jA4wxJ2wQTlAHkHprcEixoG3f05o/alVDDNzzlDZtLwDNnFwURcHk2b0ws+ari5YNC9XB5CdhR3m0HpUiR4y4PZwBw6d8MTG4xY/zCpx3WPzEbPDha3z7CPriqIfHSc8W0L30P9puZ+RL8sQ9+Ui2Vsx3QXPJdF5oAJlw46hd2DKwit4Qe51141h+z/VTQnjvjr+vXIstYsOVC/uBJJP5Rcs8CZy1w==; 5:cKm6/Sm20pSS96ztjWuVOwM2uHxABsLVikmWxNkiKj2ukRotjW1oBqaOs1HQ8slN4m527UYGzCvRDZIX0gSMV1hUsOOCMM4IQwELhRGa9IagdMqkFAYydg1nfMmmGQ5+KTTV1Nfk+92D6+opP0Sv3A==; 24:swsZ8P0SSA4NcI3su5rZHjptYRJzm87CmnQ73yOFbSJmFyZ0Gu/4JSS2oGswgc+qp4TcNNgmLo2tQd3a2uzNuyFiozfQf7HRpJAm7P5e1UU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0201MB2307; 7:M1rQgTswJJFaxgMcJVzDiPAfcAN8cQRmASLL9JIjnHuth3loc4ZIC6276IZlPluroZW2PO+DfAsL5u3nBkkzhblaaxttuHAvhM6WlgbQC9/LB+vdCLXSZqQ+K2pH5gXgE/rGzyLe5pfbDVUelxYjtYKsdjAvqq797F+1zV45IqFkppy35QrrN+xHF4LY+kBUg4E4KWEhzZRskEADxSxX7i2YOawyL/A513gV/3VuQ1xOvqdNYRfqWOfIpX13EcfTKo15qYJ+SRoIqxqKaQS9GgKTmfRmAnuIVFxn0B9/C8LCAG5upAmYRTCC89TGbE0lA2tKl23xA/vDH10+CkWgs/JV4zIXeELN5f7WVoCb23o= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2016 18:54:44.2918 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0201MB2307 Cc: Mark Rutland , devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Liam Girdwood , linux-kernel@vger.kernel.org, Nicolas Ferre , Takashi Iwai , Rob Herring Subject: Re: [alsa-devel] [PATCH 2/2] ASoC: axentia: tse850: add ASoC driver for the Axentia TSE-850 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 On 2016-11-09 17:27, Peter Rosin wrote: > On 2016-11-09 14:38, Mark Brown wrote: >> On Tue, Nov 08, 2016 at 05:20:57PM +0100, Peter Rosin wrote: >>> + struct snd_soc_pcm_runtime *rtd = substream->private_data; >>> + struct device *dev = rtd->dev; >>> + struct snd_soc_dai *cpu_dai = rtd->cpu_dai; >>> + int dir = substream->stream != SNDRV_PCM_STREAM_PLAYBACK; >>> + int div_id = dir ? ATMEL_SSC_RCMR_PERIOD : ATMEL_SSC_TCMR_PERIOD; >>> + int period = snd_soc_params_to_frame_size(params) / 2 - 1; >> >> Please write the logic out as normal if statements for legibility. It's >> a bit concerning that we even need this function, it looks like pretty >> basic stuff that I'd expect the CPU DAI to just be doing - why can't >> this be the default behaviour of the CPU DAI? > > I don't know and obviously don't have all the relevant HW to test > changes. Do you want me to attempt such a change anyway? > Adding Cc: Nicolas Ferre Something like this, perhaps? Cheers, Peter diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 16e459aedffe..059b0b63bd51 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -380,6 +380,7 @@ static void atmel_ssc_shutdown(struct snd_pcm_substream *substream, ssc_writel(ssc_p->ssc->regs, CR, SSC_BIT(CR_SWRST)); /* Clear the SSC dividers */ ssc_p->cmr_div = ssc_p->tcmr_period = ssc_p->rcmr_period = 0; + ssc_p->forced_divider = 0; } spin_unlock_irq(&ssc_p->lock); @@ -429,10 +430,12 @@ static int atmel_ssc_set_dai_clkdiv(struct snd_soc_dai *cpu_dai, break; case ATMEL_SSC_TCMR_PERIOD: + ssc_p->forced_divider |= BIT(ATMEL_SSC_TCMR_PERIOD); ssc_p->tcmr_period = div; break; case ATMEL_SSC_RCMR_PERIOD: + ssc_p->forced_divider |= BIT(ATMEL_SSC_RCMR_PERIOD); ssc_p->rcmr_period = div; break; @@ -459,6 +462,8 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, u32 tfmr, rfmr, tcmr, rcmr; int ret; int fslen, fslen_ext; + u32 tcmr_period; + u32 rcmr_period; /* * Currently, there is only one set of dma params for @@ -470,6 +475,13 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, else dir = 1; + tcmr_period = ssc_p->tcmr_period; + if (!(ssc_p->forced_divider & BIT(ATMEL_SSC_TCMR_PERIOD))) + tcmr_period = snd_soc_params_to_frame_size(params) / 2 - 1; + rcmr_period = ssc_p->rcmr_period; + if (!(ssc_p->forced_divider & BIT(ATMEL_SSC_RCMR_PERIOD))) + rcmr_period = snd_soc_params_to_frame_size(params) / 2 - 1; + dma_params = ssc_p->dma_params[dir]; channels = params_channels(params); @@ -524,7 +536,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, fslen_ext = (bits - 1) / 16; fslen = (bits - 1) % 16; - rcmr = SSC_BF(RCMR_PERIOD, ssc_p->rcmr_period) + rcmr = SSC_BF(RCMR_PERIOD, rcmr_period) | SSC_BF(RCMR_STTDLY, START_DELAY) | SSC_BF(RCMR_START, SSC_START_FALLING_RF) | SSC_BF(RCMR_CKI, SSC_CKI_RISING) @@ -540,7 +552,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, | SSC_BF(RFMR_LOOP, 0) | SSC_BF(RFMR_DATLEN, (bits - 1)); - tcmr = SSC_BF(TCMR_PERIOD, ssc_p->tcmr_period) + tcmr = SSC_BF(TCMR_PERIOD, tcmr_period) | SSC_BF(TCMR_STTDLY, START_DELAY) | SSC_BF(TCMR_START, SSC_START_FALLING_RF) | SSC_BF(TCMR_CKI, SSC_CKI_FALLING) @@ -606,7 +618,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, fslen_ext = (bits - 1) / 16; fslen = (bits - 1) % 16; - rcmr = SSC_BF(RCMR_PERIOD, ssc_p->rcmr_period) + rcmr = SSC_BF(RCMR_PERIOD, rcmr_period) | SSC_BF(RCMR_STTDLY, START_DELAY) | SSC_BF(RCMR_START, SSC_START_FALLING_RF) | SSC_BF(RCMR_CKI, SSC_CKI_RISING) @@ -623,7 +635,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, | SSC_BF(RFMR_LOOP, 0) | SSC_BF(RFMR_DATLEN, (bits - 1)); - tcmr = SSC_BF(TCMR_PERIOD, ssc_p->tcmr_period) + tcmr = SSC_BF(TCMR_PERIOD, tcmr_period) | SSC_BF(TCMR_STTDLY, START_DELAY) | SSC_BF(TCMR_START, SSC_START_FALLING_RF) | SSC_BF(TCMR_CKI, SSC_CKI_FALLING) @@ -650,7 +662,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, * MCK divider, and the BCLK signal is output * on the SSC TK line. */ - rcmr = SSC_BF(RCMR_PERIOD, ssc_p->rcmr_period) + rcmr = SSC_BF(RCMR_PERIOD, rcmr_period) | SSC_BF(RCMR_STTDLY, 1) | SSC_BF(RCMR_START, SSC_START_RISING_RF) | SSC_BF(RCMR_CKI, SSC_CKI_RISING) @@ -665,7 +677,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, | SSC_BF(RFMR_LOOP, 0) | SSC_BF(RFMR_DATLEN, (bits - 1)); - tcmr = SSC_BF(TCMR_PERIOD, ssc_p->tcmr_period) + tcmr = SSC_BF(TCMR_PERIOD, tcmr_period) | SSC_BF(TCMR_STTDLY, 1) | SSC_BF(TCMR_START, SSC_START_RISING_RF) | SSC_BF(TCMR_CKI, SSC_CKI_FALLING) diff --git a/sound/soc/atmel/atmel_ssc_dai.h b/sound/soc/atmel/atmel_ssc_dai.h index 80b153857a88..75194f582131 100644 --- a/sound/soc/atmel/atmel_ssc_dai.h +++ b/sound/soc/atmel/atmel_ssc_dai.h @@ -113,6 +113,7 @@ struct atmel_ssc_info { unsigned short cmr_div; unsigned short tcmr_period; unsigned short rcmr_period; + unsigned int forced_divider; struct atmel_pcm_dma_params *dma_params[2]; struct atmel_ssc_state ssc_state; unsigned long mck_rate;