Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752801AbdCNQ5R (ORCPT ); Tue, 14 Mar 2017 12:57:17 -0400 Received: from mail-he1eur01on0041.outbound.protection.outlook.com ([104.47.0.41]:52688 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751820AbdCNQ5P (ORCPT ); Tue, 14 Mar 2017 12:57:15 -0400 Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=nxp.com; From: Daniel Baluta To: , , CC: , , , , , , Subject: [RFC PATCH] ASoC: wm8960: Use physical width for bclk Date: Tue, 14 Mar 2017 18:57:02 +0200 Message-ID: <1489510622-30981-1-git-send-email-daniel.baluta@nxp.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.88.146.1] X-ClientProxiedBy: VI1PR09CA0059.eurprd09.prod.outlook.com (10.174.49.27) To AMSPR04MB503.eurprd04.prod.outlook.com (10.242.107.152) X-MS-Office365-Filtering-Correlation-Id: f708fe04-7f85-46b0-c29d-08d46afb28bb X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(48565401081);SRVR:AMSPR04MB503; X-Microsoft-Exchange-Diagnostics: 1;AMSPR04MB503;3:9h0EIWSX+TBGEbHjfsz9OvWa4FB52yPZ7/qN9OLvif8KSOO5ZRa7VFoDhA6zaQzzzHI9UUBq88ce+9kYn34QhizjNuE5+jY3juW9aswt1miITC5gD3ZEi9EzwD86xS3FmVOxOtFbDSQlOA977vEwMKhc6A2BOU4dnyzR/NDGDWJJOkdVSxIrwK0J7qVi04GiOZmQl17UPHVz9Um6npN7PmOlqaDssyGJRAP/Nv29UsSReCHDEoBLeU8QDff1LyCPBG4I5t3oq9XxaRb4Ew487NyMZ6+3HjHZ0Zlb7KXYppM=;25:wp/BkbvKncMs7A5/uIq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1Db57EnIUQNVxX/KPiiV6vdk06Lbj8tap8UXUj5cB3aCgLfK49kcUvUTdZo6Ozox81ofYwIPgAh+PYjO02KBCrHcmMyOJhdFoRr9iRZph3wwILbq4V7C3HxLwQHaN43d+1bm08uh6Pg/Am81oaOtLpWktr5QgBSYy5PhWrUGAeFOvxg6/l456pzWv4rFqROdWRODVnAKnnPDbYOJo3yB+odQyh X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123564025)(20161123562025)(20161123555025)(20161123558025)(6072148);SRVR:AMSPR04MB503;BCL:0;PCL:0;RULEID:;SRVR:AMSPR04MB503; X-Microsoft-Exchange-Diagnostics: 1;AMSPR04MB503;4:kcR43hvCgazJvKjLzqm4jPH8fYlA2jLDYRx9m6xtd6ZGxNVeP5ffZIqb93zAOgJa85+2xT+NDxbJp3tGF00n8l+66ndiE57DYEdBqAXzedXCMkvhmJk1zEmjIwXI3zufnuoS0HHCg4YqzQu8UZPnzhZf9jUIpU476JHO1x5wHhiQramU6K9bPoqkU5TiIQSlf2eDUpDErdwRT9Styn5aMVMOZeB6xUeJHl1gJL1shGoWxArU8CALk52M+KAMtS8IVz/sH4pFsGYGU3jYql+5JgjzkmAxiwZaBF8MarAlb3jl9fcu4nA/OfanQf5a9dzZaFgKQQhJEa6D3reqlOi00a1zywLnma1l6LVLBwbSEFiAcrRylDPHlNxc7ZMHMktNc9k9bSm/gad5P7va1L/hl++3XGBcpBuiHfFYmAbgvsZlzHN2dE0aQQMerR1AM1EBqpUPu8kL8OX/utkkUGwAuq6BkTAvaV+seSLq2CeM+rrPo+s9XoDM8gQva6pGl6GNPJkeBDfjJwMLh1qUrU48QoLZX3MIeP4Vt0FwygDH2aT7sjt0L4pvawxLMvL9tc7Uiwffr4XK9fdutcOTdySRj6nvdYIfWMKwwPYWIKOLvknRIVpfvFO/1QecYdp4Hp8mawCQ6XcbqsXD9wySvxyH2V5jsmFypji6nyRSXrGPV6g= X-Forefront-PRVS: 02462830BE X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(39450400003)(39860400002)(39410400002)(39840400002)(39850400002)(38730400002)(2906002)(8676002)(25786008)(305945005)(86362001)(81166006)(5003940100001)(7736002)(47776003)(4326008)(2201001)(3846002)(6116002)(50466002)(33646002)(6666003)(50986999)(54906002)(42186005)(6486002)(6512007)(66066001)(48376002)(50226002)(189998001)(36756003)(5660300001)(53936002)(6506006);DIR:OUT;SFP:1101;SCL:1;SRVR:AMSPR04MB503;H:fsr-ub1664-118.ea.freescale.net;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;AMSPR04MB503;23:rCZybbH+PopTO5yyM47K7PUtnHKceTSFx9FCAZf25db3Xa/i1Ml47SYNwcFKkfZ5oOMh22XMrtFynZ5IskNJBUD4AsUMY/6/FLQUZsyUX+LIyjH8h2hLkiM2IdEoUgBoHrPhip+gweNnDg7bmZ+9Q7No9gxvJktNqiZGz+XTy84fbpBek83Jq64TRSFiIFs3E8zniHJWjgwUR0aKbftWz1dNZ/Pl2/ly8KX1N4T3/NE2CfzkE4xUj83r2olg7N8o15TNQTJeYasE13NHhC0HhoUqXolTAtT1EFaZV4EC2d00s8gTZnng71q51o8XVOdYdT+zTFagNwEWyF/LfwxbPbsbNTUIMrqiPPLyg5DT1NIfyolvXzoJ35iUUA7t+r4SIR0fKH0BJTPJ4sS+TxSqFoIQJPi9ROx6D5EnxinOhOuH0yjFbB7+zHGfpTePxBZqGu4gYrZKZ/UIdH7krWBI7Y5KfiGbqr+CrP5lGE0yzzuUq53D2kRE0v62763g75oIG5yXj8vgHsglIaQ+NDMbk8srBslRYeermZOX69Uulticos+pw/dNuTnpx9ZYXCnGeW1sUXpdt7Xa6LMAplll7pQywNRf4okiBCv+i5opqFXasM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amDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;AMSPR04MB503;7:mgghbLYfuiz+QustZLdG3fyDD5QYsS/ezYEHbTqCItD3IQqCQneRQ38nMZ6WP359Ve9yAGIBIA+wQD5+KWUNFy/ps2KnkwvxGYluJcOpaoPFcYkpxOxe4tzCb6VLjoM1F8CAQDYR0WH553jl/T3/8vBMBr2JFWYhUXvDcDEBWkQHIUntzRY3emAWYx0h+3hIrYyRhKVgp2VMtx9+noEtF2vMO4tx3e/6VpLhrLnR/GHCkIdCw13eS7sHExq+0vhlAmkgbNcVvEBTPeR8RCmSbVTsgAG8JgvY7CT0ac7RN6houpukrZNZlVGMefcpgveg4eM1M0YMnFQpYUFX5XGVow== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2017 16:57:10.9436 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AMSPR04MB503 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1050 Lines: 31 bclk is derived from sysclk with the help of bclk_divs. Anyhow, for S20_3LE format there is no bclk_divs that could be used to derive an exact bclk. We can fix this by using storage size instead the exact number of bits of the sample when computing bclk. With this approach we can play S20_3LE encoded files at the cost of some unused BCLK cycles for S20_3LE and S24_LE. Signed-off-by: Daniel Baluta --- sound/soc/codecs/wm8960.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c index e1429e3..18ca5fc 100644 --- a/sound/soc/codecs/wm8960.c +++ b/sound/soc/codecs/wm8960.c @@ -722,7 +722,8 @@ static int wm8960_hw_params(struct snd_pcm_substream *substream, bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; int i; - wm8960->bclk = snd_soc_params_to_bclk(params); + wm8960->bclk = params_physical_width(params) * + params_channels(params) * params_rate(params); if (params_channels(params) == 1) wm8960->bclk *= 2; -- 2.7.4