From patchwork Thu Feb 14 10:13:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Thomson X-Patchwork-Id: 10812519 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 110056C2 for ; Thu, 14 Feb 2019 11:31:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F374F2D98E for ; Thu, 14 Feb 2019 11:31:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F13E62D996; Thu, 14 Feb 2019 11:31:24 +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.9 required=2.0 tests=BAYES_00,FROM_WORDY, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham 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 48C422D969 for ; Thu, 14 Feb 2019 11:31:24 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 18BEC2679C7; Thu, 14 Feb 2019 11:13:43 +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 B35482679BB; Thu, 14 Feb 2019 11:13:35 +0100 (CET) Received: from mail1.bemta26.messagelabs.com (mail1.bemta26.messagelabs.com [85.158.142.1]) by alsa0.perex.cz (Postfix) with ESMTP id B8E3F267482 for ; Thu, 14 Feb 2019 11:13:32 +0100 (CET) Received: from [85.158.142.98] (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)) by server-1.bemta.az-a.eu-central-1.aws.symcld.net id BD/58-12934-B4F356C5; Thu, 14 Feb 2019 10:13:31 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkleJIrShJLcpLzFFi42IJ73Q4rOttnxp jsPk3q8Wplj3sFlcuHmKymPrwCZvFtysdTBaXd81hs+jc1c9qseH7WkYHdo8Nn5vYPFov/WXz 2DnrLrvHplWdbB773i5j81i/5SqLx+dNcgHsUayZeUn5FQmsGd92r2YraOaseDLjLGMD4wb2L kYuDiGBbYwS+36/h3LWM0o0Luhg7WLkBHIqJOaemgtkc3DwCrhJrOhjBwmzCVhITD7xgA3EZh FQldi27x1YubCAt8SMN0uZQGwRgS5GifNHvUFmMgvMZ5TYtvAqWBGvgKDEyZlPWEBsZgEJiYM vXjBD7DKQOL2gESwuIWAvMf39VWaQvRIC+hKNx2IhwoYS32d9gyoxl2jb2MWMrHwCo+AsJBtm IdmwgJFpFaNFUlFmekZJbmJmjq6hgYGuoaGxrrGupaFeYpVuol5qqW5yal5JUSJQUi+xvFivu DI3OSdFLy+1ZBMjMGpSCpmjdzCuWJp+iFGSg0lJlNf4YkqMEF9SfkplRmJxRnxRaU5q8SFGGQ 4OJQleFZvUGCHBotT01Iq0zBxg/MKkJTh4lER4u22B0rzFBYm5xZnpEKlTjIpS4rx/QBICIIm M0jy4NljKuMQoKyXMy8jAwCDEU5BalJtZgir/ilGcg1FJmHcRyBSezLwSuOmvgBYzAS1+KpIC srgkESEl1cBY9PSmuX9scctd724XxSauCfIOi95saROwVnn+r+fxnTuiC/YUZ4pJd/UlTf256 nvNkfw5bWLZ7sxLVH/aT33XymMqtu7U17/ZB+2fmaZdYe3vP7363cH3SfpKbJczlb8yHhPb8W xZ3gOLhwvn74+dyHB/9SWX/YKdL5VMzSS5PS4///1DbWGEEktxRqKhFnNRcSIAihA7MhQDAAA = X-Env-Sender: Adam.Thomson.Opensource@diasemi.com X-Msg-Ref: server-44.tower-223.messagelabs.com!1550139210!1180341!1 X-Originating-IP: [87.137.64.195] X-SYMC-ESS-Client-Auth: outbound-route-from=pass X-StarScan-Received: X-StarScan-Version: 9.31.5; banners=-,-,- X-VirusChecked: Checked Received: (qmail 16124 invoked from network); 14 Feb 2019 10:13:31 -0000 Received: from unknown (HELO NB-EX-CASHUB02.diasemi.com) (87.137.64.195) by server-44.tower-223.messagelabs.com with AES128-SHA256 encrypted SMTP; 14 Feb 2019 10:13:31 -0000 Received: from SW-EX-CASHUB01.diasemi.com (10.20.16.141) by NB-EX-CASHUB02.diasemi.com (10.1.16.142) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 14 Feb 2019 11:13:29 +0100 Received: from swsrvapps-01.diasemi.com (10.20.28.141) by SW-EX-CASHUB01.diasemi.com (10.20.16.140) with Microsoft SMTP Server id 14.3.408.0; Thu, 14 Feb 2019 10:13:28 +0000 Received: by swsrvapps-01.diasemi.com (Postfix, from userid 22379) id 684E73FBCD; Thu, 14 Feb 2019 10:13:28 +0000 (GMT) Message-ID: From: Adam Thomson Date: Thu, 14 Feb 2019 10:13:28 +0000 To: Mark Brown , Liam Girdwood , Takashi Iwai , Jaroslav Kysela MIME-Version: 1.0 X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-KSE-ServerInfo: sw-ex-cashub01.diasemi.com, 9 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 14/02/2019 07:50:00 X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Support Opensource , Akshu Agrawal Subject: [alsa-devel] [PATCH v2 0/2] ASoC: da7219: BCLK and TDM flexibility improvements 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 This patch set updates the driver to be more flexible regarding the BCLK and TDM configurations of the device. Previously the BCLK rate was fixed at 64 periods per WCLK, when the codec is DAI clock master, but to satisfy devices which prefer a lower rate, and to save power, the BCLK rate is now calculated based on hw_params() data. As a fallout of the BCLK efforts it was also apparent that the TDM code could be made more flexible as well. The device is capable of automatically detecting the BCLK rate when it is clock slave, so previous limitations imposed were not necessary. The mask handling is now used as an input to determine the BCLK offset to align closer with other examples within ALSA. Changes in v2: - Update 0001 patch to use '&&' instead of '&' in hw_params() to decide if BCLK rate should be configured or not. Adam Thomson (2): ASoC: da7219: Add support for master mode BCLK rate adjustment ASoC: da7219: Update TDM usage to be more flexible sound/soc/codecs/da7219.c | 116 +++++++++++++++++++++++++++++----------------- sound/soc/codecs/da7219.h | 1 + 2 files changed, 74 insertions(+), 43 deletions(-)