From patchwork Mon Oct 15 14:03:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olivier MOYSAN X-Patchwork-Id: 10641901 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 E6670109C for ; Mon, 15 Oct 2018 14:03:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D444929A2A for ; Mon, 15 Oct 2018 14:03:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C808029D74; Mon, 15 Oct 2018 14:03:58 +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=-2.9 required=2.0 tests=BAYES_00,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 2751E29A2A for ; Mon, 15 Oct 2018 14:03:58 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 84525267864; Mon, 15 Oct 2018 16:03:50 +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 CC2B5267861; Mon, 15 Oct 2018 16:03:46 +0200 (CEST) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by alsa0.perex.cz (Postfix) with ESMTP id 9DD122677F0 for ; Mon, 15 Oct 2018 16:03:43 +0200 (CEST) Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w9FDx0Dt004467; Mon, 15 Oct 2018 16:03:40 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2n48sh58y4-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 15 Oct 2018 16:03:40 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B2BFA31; Mon, 15 Oct 2018 14:03:39 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas23.st.com [10.75.90.46]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5545C4E65; Mon, 15 Oct 2018 14:03:39 +0000 (GMT) Received: from SAFEX1HUBCAS21.st.com (10.75.90.44) by SAFEX1HUBCAS23.st.com (10.75.90.46) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 15 Oct 2018 16:03:39 +0200 Received: from localhost (10.201.23.16) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 15 Oct 2018 16:03:38 +0200 From: Olivier Moysan To: , , , , , , , , , , , , , , , Date: Mon, 15 Oct 2018 16:03:32 +0200 Message-ID: <1539612216-12602-1-git-send-email-olivier.moysan@st.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.201.23.16] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-10-15_08:, , signatures=0 Subject: [alsa-devel] [PATCH 0/4] ASoC: stm32: sai: add mclk clock provider 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 allows to use STM32 SAI interface as a master clock provider. The Cirrus cs42l51 codec patch gives the example of the source code required on codec side, to use SAI mclk provider. These patches allow to cover the following use cases: - SAI is master or slave and is master clock provider - SAI is master or slave and is not master clock provider (another sai provides the mclk clock) Implementation overview: - mclk configuration SAI is registered in clock framework: - either as a mclk provider (optional in DT). SAI generates mclk when requested by DAPM - or as a mclk consumer (optional in DT). cs42l51 codec is configured as a mclk consumer (optional in DT) - mclk power A DAPM is registered in codec to handle mclk enable/disable (DAPM route is set in soundcard node) - mclk rate: mclk rate is computed at runtime from stream rate and mclk-fs ratio provided in DT mclk rate is propagated through sysclk callback to the SAI which is mclk consumer. The mclk rate is set exclusively to avoid concurrent rate requests on SAI master. Regards Olivier Olivier Moysan (4): ASoC: dt-bindings: add mclk provider support to stm32 sai ASoC: dt-bindings: add mclk support to cs42l51 ASoC: stm32: sai: set sai as mclk clock provider ASoC: cs42l51: add mclk support .../devicetree/bindings/sound/cs42l51.txt | 17 ++ .../devicetree/bindings/sound/st,stm32-sai.txt | 7 + .../devicetree/bindings/trivial-devices.txt | 1 - sound/soc/codecs/cs42l51.c | 8 + sound/soc/stm/stm32_sai.h | 3 + sound/soc/stm/stm32_sai_sub.c | 275 ++++++++++++++++++--- 6 files changed, 274 insertions(+), 37 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/cs42l51.txt