From patchwork Thu Feb 25 18:06:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 387694 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99124C433DB for ; Thu, 25 Feb 2021 18:09:22 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E7AB164F37 for ; Thu, 25 Feb 2021 18:09:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E7AB164F37 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 31FCA167A; Thu, 25 Feb 2021 19:08:30 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 31FCA167A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1614276560; bh=epooql0FMpO3WipZpYM8q3+kN511KeDs0sQiMlQLkXY=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=O7TlXyLu/vPR6v1nPVmSGuCnLTR13O7sbIRuudvTRrlqt6IBSyj16jYanHEZJCr0/ chutB9FplC3CYavu072evU5+kEP9X6q36pAC9UngEvm3Udwe8xVpf+5z2McJT3lkrF pt9+ttNOQFvwu2SdFVUE4Nb9/gynkU2tm1MQgJzU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 80FD2F8032B; Thu, 25 Feb 2021 19:07:04 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9A055F802E3; Thu, 25 Feb 2021 19:07:00 +0100 (CET) Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 53C4BF802D2 for ; Thu, 25 Feb 2021 19:06:46 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 53C4BF802D2 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="Qj6u+1Pv" Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 25 Feb 2021 10:06:44 -0800 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 25 Feb 2021 18:06:44 +0000 Received: from audio.nvidia.com (172.20.145.6) by mail.nvidia.com (172.20.187.13) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 25 Feb 2021 18:06:41 +0000 From: Sameer Pujar To: , Subject: [RFC PATCH 3/5] ASoC: audio-graph-card: Add bindings for sysclk and pll Date: Thu, 25 Feb 2021 23:36:02 +0530 Message-ID: <1614276364-13655-4-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614276364-13655-1-git-send-email-spujar@nvidia.com> References: <1614276364-13655-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1614276404; bh=9ywFTvkZa5lV3oP3sSlaxK8fYTSk9Azn5gp12WflYbY=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Type; b=Qj6u+1PvzAC8CJJTxccDuj8mUtADkD1O1knBKonobjhCb55KhvR6Y4u1SL7K9D9HR wga4vy8FOYy5+kqukd/ferK5IYIPCvoX+YgWS/BkqqLgQmgeAkH+hRJFjKoBLZbcrn uF/TJl0UmXUKplNpKq9wQVnZF34dQ1s1PbK6h+1hI3QkOWrEG9DL17x+heAnwgTpY1 DLybd+5UkVt0NzFl7cmHe/5TEKHQDk7X93dGKxAhROS4aM7pa3HshhxwNN85Iu9KQm MnLqzxFspfZZiJeQ+FR32RV9xQDzQGQvMq2VMTCLLaTR80arQqdSl+up4shNzfg583 cnYxLXWFtNvkg== Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, kuninori.morimoto.gx@renesas.com, Sameer Pujar , linux-kernel@vger.kernel.org, jonathanh@nvidia.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" ASoC core provides callbacks snd_soc_dai_set_sysclk() and snd_soc_dai_set_pll() for system clock (sysclk) and pll configurations respectively. Add bindings for flexible sysclk or pll configurations which can be driven from CPU/Codec DAI or endpoint subnode from DT. This in turn helps to avoid hard codings in driver and makes it more generic. Also add system-clock related bindings, "system-clock-direction-out" and "system-clock-frequency", which are already supported. Cc: Kuninori Morimoto Cc: Rob Herring Signed-off-by: Sameer Pujar --- .../bindings/sound/audio-graph-port.yaml | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml index 766e910..4f50291 100644 --- a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml +++ b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml @@ -71,6 +71,77 @@ properties: description: CPU to Codec rate channels. $ref: /schemas/types.yaml#/definitions/uint32 + system-clock-frequency: + description: | + Specify system clock (sysclk) frequency for CPU or Codec + component. Or if a clock is specified in the CPU or Codec + device node and a scaling factor is given with "mclk-fs", + sysclk will be calculated as a multiple of stream sample + rate and "mclk-fs". The rate is updated when stream starts. + $ref: /schemas/types.yaml#/definitions/uint32 + + system-clock-direction-out: + description: | + Specifies clock direction as "out" on initialization. It + is useful for some CPUs with fixed clocks. + $ref: /schemas/types.yaml#/definitions/flag + + system-clock-id: + description: | + CPU or Codec component may have multiple clocks. A specific + clock may have to be configured. In such cases the clock + ID needs to be specified. + $ref: /schemas/types.yaml#/definitions/uint32 + + system-clock-source: + description: | + CPU or Codec component may have multiple sources for its + system clock (sysclk). In such cases the sysclk source + needs to be specified. + $ref: /schemas/types.yaml#/definitions/uint32 + + pll-id: + description: | + Specify PLL that needs to be configured. This is useful + when the CPU or Codec component has multiple PLLs. + $ref: /schemas/types.yaml#/definitions/uint32 + + pll-source: + description: | + When PLL has multiple reference clock sources, the exact + source needs to be specified for the required configuration. + $ref: /schemas/types.yaml#/definitions/uint32 + + pll-input-reference: + description: | + Specify how to calculate input frequency for the PLL. + Depending on the identifier, input frequency can be + calculated at runtime. For example if I2S bit clock is used + as reference, rate depends on actual PCM parameters (rate, + channels and bits) during an audio session. If a fixed rate + is used, then "pll-input-frequency" can be used instead. + $ref: /schemas/types.yaml#/definitions/uint32 + const: 2 + + pll-input-frequency: + description: Specify fixed input frequency + $ref: /schemas/types.yaml#/definitions/uint32 + + pll-output-reference: + description: | + Specify how to calculate output frequency for the PLL. + Depending on the identifier, output frequency can be + calculated at runtime. If output clock is used for MCLK purpose, + then it may depend on "mclk-fs" scale factor. In such cases it + needs to be calculated at runtime. If a fixed output frequency + is needed, then "pll-output-frequency" can be used instead. + $ref: /schemas/types.yaml#/definitions/uint32 + const: 1 + + pll-output-frequency: + description: Specify fixed output frequency + $ref: /schemas/types.yaml#/definitions/uint32 + ports: description: multi OF-Graph subnode type: object