From patchwork Mon Mar 28 06:14:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 555006 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id E1FF0C433F5 for ; Mon, 28 Mar 2022 06:17:10 +0000 (UTC) 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 10ADA16C1; Mon, 28 Mar 2022 08:16:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 10ADA16C1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1648448229; bh=cv1h0KTmaqXiU48ZPuzlTuOlcBMTVzsabMw7+UOPuNA=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=buCN0VRDWADzcgQZEaA/3mSodar6C/sPulwfXAuRMBZi5Sj4k6p0aJDXrfy68dAuO lAqhHo3FSOhBAnIZqdfrwKL7wH70aRVYqqKklFd3iEecWkMZh0ocKyN8qVQa9RiuHH 5+S3OhTwZiLfIuulVoBqBumF2J5oObGEAyO2Etvc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3E908F80271; Mon, 28 Mar 2022 08:15:54 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 305C4F804CF; Mon, 28 Mar 2022 08:15:52 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2062c.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5a::62c]) (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 239C0F800CB for ; Mon, 28 Mar 2022 08:15:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 239C0F800CB Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="UYVYgdfc" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ly0qxNq0KQUx5yOl1hZb4jRnMxqiUz1ti3VFjHwYWPPkJZruLe+GuNvaLGtIHlB/4c+Gle3E3e7L14euIvUaLZbwH0NWxN3Y2beP7y52RfvzUZL9Be2kcuqQX5Tm/P4ZI/isynIzL9J05S+5wxB/do+KUJMnfNGi+bG7o4X3P4DfSEglKP6M7fAD5hvIyjBeg2ivJiSFjiAbEwa6I8Hsnlbc+tncP5heClqqiKuRixSO6muf2THOxPUDaJJKocZrIG/76mII2nWsAKJaqn+LpBTZe+xEES0tn90Cn6X5UcRtOl4yXZxz9Rsmc3d4/NdR6a3tvZffRN0QFsoN8N8/rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tBNYOo3hbnzsQeZv5Tz8giYwmCgw8Rgciit6wd8T64Q=; b=ScM9hc6EcohbZNcbVfPVjMiLgnUktvZRIlN4tnTk4MjEerwlOzb8i+lSM02MdzFd5zH4KiSGFw1C/YP6rfuGKTo5Vj5Hc6qb/qvjvi8EZvxE6TzGJSDtBK1iGfAn3YvtV/BxMoyZaOTdP++lkukr1eQx+Ay0swb4euI7dmxTgJ7XyC2UKfyiwsgpjKHk1TBM7N5OsYG+G974qCtvB1ytqgKJGb+RjRdS4OfpP44WQGyXh6Z5Au38JZfJXyx05PHMOANusJFiekks2BxDJaDzEv81iA62haiS7xtzprbwvOziLdwPviijC4HVGrMaedyw38XRR7ya7ibr4hwn6WjYDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) smtp.rcpttodomain=gmail.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tBNYOo3hbnzsQeZv5Tz8giYwmCgw8Rgciit6wd8T64Q=; b=UYVYgdfci5KX11IuLyJ/sYqpgAHvCuCtXCg5oRY2zYHqAFvMVBi28PvynsvDyEYs2mC14F5TEUydmcveU0wz3HIp5ryunFs8nOikIW95z3O6aLPrrbUU3BSpQRfwdM99CebwLXm1fjYttVi/vtyddr/ADekansFrlAHGFbnfRIGi0dpsWHT9AzFnz5ZwqN83CN6EV+InTM03z7WQPN5LVckv8OhzOybe8m3dqUfY9xR/USeFfZPwXMd4CDpaHAKSJ2syGvx97MKcu/ZGT3Z7sLEWNnCNCYkwaxXD32QDng/0cmFx3zuNlgKYeYqDYGpVcJlz9L24x8LsIgDxGvlnyg== Received: from MW4PR04CA0098.namprd04.prod.outlook.com (2603:10b6:303:83::13) by DM6PR12MB4339.namprd12.prod.outlook.com (2603:10b6:5:2af::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.19; Mon, 28 Mar 2022 06:15:39 +0000 Received: from CO1NAM11FT003.eop-nam11.prod.protection.outlook.com (2603:10b6:303:83:cafe::46) by MW4PR04CA0098.outlook.office365.com (2603:10b6:303:83::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.17 via Frontend Transport; Mon, 28 Mar 2022 06:15:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.235) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.235 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.235; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.235) by CO1NAM11FT003.mail.protection.outlook.com (10.13.175.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5102.17 via Frontend Transport; Mon, 28 Mar 2022 06:15:39 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Mon, 28 Mar 2022 06:15:38 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Sun, 27 Mar 2022 23:15:37 -0700 Received: from audio.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.22 via Frontend Transport; Sun, 27 Mar 2022 23:15:33 -0700 From: Sameer Pujar To: , , , , , , , Subject: [RFC PATCH v2 1/6] ASoC: dt-bindings: Convert rt5659 bindings to YAML schema Date: Mon, 28 Mar 2022 11:44:05 +0530 Message-ID: <1648448050-15237-2-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1648448050-15237-1-git-send-email-spujar@nvidia.com> References: <1648448050-15237-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ff7cb7e4-eb39-44b0-3eb6-08da10826170 X-MS-TrafficTypeDiagnostic: DM6PR12MB4339:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Tukb/HflDEajp2Cj1eH0lDmBexfeajsMH2sZXUSDfQ0YnS4F/2PMEjeCRedDv2yMgCRKnnZAIv83iMSXiF0AA56k9sypijkY+xUXbp7rZNTSv0mmknSrMCqBvE7r/6rXag/fxP3Q8FP0nijKfKRAx+1Fgfjq4QTRzejLqyhYOTb3ZVxjLQ+062e9li+GKf15+oiM5Ns/lZsDWRm3OwMs/dL3ImdJsmfxT6hDL8JqRLIKMorOr+oTxhtrz9ZBBmH4DnxEZLow1qPsY2jimcMLNzU2kbikjBiflGAU3vNI9VFrVPwGYsN5/e1O5qFBkSqhXQKzu816X00RaBinCZtO1z0D3G5oLVCnKs3p1lcb589JoLBoG4HoVTC2PAv6ltx8Ew6Sdoo2mfNZfX/jrbe6H/TeQ3dhXeMwVMKk53f0e4vQd3IXQDF9RITtDaJX6jZQgHtXIhfG5p4lvjN2mYcp94mcGpXlXd5iY4F/GQSGzQBWT784eRRSiIDkrXlAcO87VMRJ86Spth2Mee61u6TPceA5BdENjvgwLM0iaerDFTQRRObT2Pz7+MTV2SzNYl/dMbDNxABGjX4jYnn1M59gMF5nzIF5Ts7gSzBof4pyb1UXB6JfE4Xnz3alqISX+N26Ox7qQnDffw8nudVzYxJw+IRmvlUWIjYyz/YKNDCOuxm1Fh/J/u7rtljYlIBzOi/JcMUPUKf4tR0PPZ/RlHhG+JtqYung8AOm1koIK5OAEpx8rg/OukJSF6SVG9uTk0tlSh963jzfvzkMupsp7NKokwOI5D+35CNpcrcbATK4LtHCsC8mIVPk51oE9jPWqDLnnNRfA2JT4pVUraND//bBdA== X-Forefront-Antispam-Report: CIP:12.22.5.235; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(356005)(40460700003)(186003)(110136005)(54906003)(81166007)(316002)(8676002)(508600001)(966005)(47076005)(36756003)(86362001)(5660300002)(2906002)(4326008)(70206006)(70586007)(2616005)(8936002)(7416002)(426003)(82310400004)(336012)(7696005)(36860700001)(83380400001)(26005)(107886003)(6666004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2022 06:15:39.1791 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ff7cb7e4-eb39-44b0-3eb6-08da10826170 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.235]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT003.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4339 Cc: oder_chiou@realtek.com, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Sameer Pujar , linux-kernel@vger.kernel.org, jonathanh@nvidia.com, thierry.reding@gmail.com, linux-tegra@vger.kernel.org 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" Convert rt5659.txt DT binding to YAML schema. This binding is applicable to rt5658 and rt5659 audio CODECs. Signed-off-by: Sameer Pujar Cc: Oder Chiou --- .../devicetree/bindings/sound/realtek,rt5659.yaml | 112 +++++++++++++++++++++ Documentation/devicetree/bindings/sound/rt5659.txt | 89 ---------------- 2 files changed, 112 insertions(+), 89 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/realtek,rt5659.yaml delete mode 100644 Documentation/devicetree/bindings/sound/rt5659.txt diff --git a/Documentation/devicetree/bindings/sound/realtek,rt5659.yaml b/Documentation/devicetree/bindings/sound/realtek,rt5659.yaml new file mode 100644 index 0000000..3bd9b6f --- /dev/null +++ b/Documentation/devicetree/bindings/sound/realtek,rt5659.yaml @@ -0,0 +1,112 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/realtek,rt5659.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: RT5658 and RT5659 audio CODECs + +description: This device supports I2C only. + +maintainers: + - Oder Chiou + +allOf: + - $ref: name-prefix.yaml# + +properties: + compatible: + enum: + - realtek,rt5658 + - realtek,rt5659 + + reg: + description: The I2C address of the device + maxItems: 1 + + interrupts: + description: The CODEC's interrupt output + maxItems: 1 + + clocks: + items: + - description: Master clock (MCLK) to the CODEC + + clock-names: + items: + - const: mclk + + realtek,in1-differential: + description: MIC1 input is differntial and not single-ended. + type: boolean + + realtek,in3-differential: + description: MIC3 input is differntial and not single-ended. + type: boolean + + realtek,in4-differential: + description: MIC3 input is differntial and not single-ended. + type: boolean + + realtek,dmic1-data-pin: + description: DMIC1 data pin usage + $ref: /schemas/types.yaml#/definitions/uint32 + enum: + - 0 # dmic1 is not used + - 1 # using IN2N pin as dmic1 data pin + - 2 # using GPIO5 pin as dmic1 data pin + - 3 # using GPIO9 pin as dmic1 data pin + - 4 # using GPIO11 pin as dmic1 data pin + + realtek,dmic2-data-pin: + description: DMIC2 data pin usage + $ref: /schemas/types.yaml#/definitions/uint32 + enum: + - 0 # dmic2 is not used + - 1 # using IN2P pin as dmic2 data pin + - 2 # using GPIO6 pin as dmic2 data pin + - 3 # using GPIO10 pin as dmic2 data pin + - 4 # using GPIO12 pin as dmic2 data pin + + realtek,jd-src: + description: Jack detect source + $ref: /schemas/types.yaml#/definitions/uint32 + enum: + - 0 # No JD is used + - 1 # using JD3 as JD source + - 2 # JD source for Intel HDA header + + realtek,ldo1-en-gpios: + description: The GPIO that controls the CODEC's LDO1_EN pin. + + realtek,reset-gpios: + description: The GPIO that controls the CODEC's RESET pin. + + sound-name-prefix: true + +additionalProperties: false + +required: + - compatible + - reg + - interrupts + +examples: + - | + #include + #include + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + audio-codec@1a { + compatible = "realtek,rt5658"; + reg = <0x1a>; + interrupt-parent = <&gpio>; + interrupts = ; + clocks = <&bpmp TEGRA194_CLK_AUD_MCLK>; + clock-names = "mclk"; + realtek,jd-src = <2>; + }; + }; diff --git a/Documentation/devicetree/bindings/sound/rt5659.txt b/Documentation/devicetree/bindings/sound/rt5659.txt deleted file mode 100644 index 013f534..0000000 --- a/Documentation/devicetree/bindings/sound/rt5659.txt +++ /dev/null @@ -1,89 +0,0 @@ -RT5659/RT5658 audio CODEC - -This device supports I2C only. - -Required properties: - -- compatible : One of "realtek,rt5659" or "realtek,rt5658". - -- reg : The I2C address of the device. - -- interrupts : The CODEC's interrupt output. - -Optional properties: - -- clocks: The phandle of the master clock to the CODEC -- clock-names: Should be "mclk" - -- realtek,in1-differential -- realtek,in3-differential -- realtek,in4-differential - Boolean. Indicate MIC1/3/4 input are differential, rather than single-ended. - -- realtek,dmic1-data-pin - 0: dmic1 is not used - 1: using IN2N pin as dmic1 data pin - 2: using GPIO5 pin as dmic1 data pin - 3: using GPIO9 pin as dmic1 data pin - 4: using GPIO11 pin as dmic1 data pin - -- realtek,dmic2-data-pin - 0: dmic2 is not used - 1: using IN2P pin as dmic2 data pin - 2: using GPIO6 pin as dmic2 data pin - 3: using GPIO10 pin as dmic2 data pin - 4: using GPIO12 pin as dmic2 data pin - -- realtek,jd-src - 0: No JD is used - 1: using JD3 as JD source - 2: JD source for Intel HDA header - -- realtek,ldo1-en-gpios : The GPIO that controls the CODEC's LDO1_EN pin. -- realtek,reset-gpios : The GPIO that controls the CODEC's RESET pin. - -- sound-name-prefix: Please refer to name-prefix.yaml - -- ports: A Codec may have a single or multiple I2S interfaces. These - interfaces on Codec side can be described under 'ports' or 'port'. - When the SoC or host device is connected to multiple interfaces of - the Codec, the connectivity can be described using 'ports' property. - If a single interface is used, then 'port' can be used. The usage - depends on the platform or board design. - Please refer to Documentation/devicetree/bindings/graph.txt - -Pins on the device (for linking into audio routes) for RT5659/RT5658: - - * DMIC L1 - * DMIC R1 - * DMIC L2 - * DMIC R2 - * IN1P - * IN1N - * IN2P - * IN2N - * IN3P - * IN3N - * IN4P - * IN4N - * HPOL - * HPOR - * SPOL - * SPOR - * LOUTL - * LOUTR - * MONOOUT - * PDML - * PDMR - * SPDIF - -Example: - -rt5659 { - compatible = "realtek,rt5659"; - reg = <0x1b>; - interrupt-parent = <&gpio>; - interrupts = ; - realtek,ldo1-en-gpios = - <&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_HIGH>; -}; From patchwork Mon Mar 28 06:14:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 554844 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9A5CEC433EF for ; Mon, 28 Mar 2022 06:17:27 +0000 (UTC) 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 BD42216D2; Mon, 28 Mar 2022 08:16:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BD42216D2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1648448245; bh=SwpHnIzkZYB61t5sSHG22qrsOKT16FRiPNCllOM50Lc=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Bdr8veOMmb9k89RrZMeZVSupdxx7FSnWnL0zx2yxBnaXsGP2OIAmx0davmf7VTIIY Q6aLGG6bcgCEtKKs/qVSUltMrrmIPq/9ABmOOJH9VVTYwjzTGG8Cnp3Cgz4zZXE3LC HpWojabgeMifXR9Ms97jjsoPKXOwG3X5ET/0Mus8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 29FDDF80516; Mon, 28 Mar 2022 08:15:58 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 66494F80517; Mon, 28 Mar 2022 08:15:56 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on20617.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eab::617]) (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 2C6E1F8026D for ; Mon, 28 Mar 2022 08:15:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2C6E1F8026D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="PsYcGbX6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Cp8T30aj6473IQ1gUek1pe+7KSPyIDsttdrjSF16aG/r8Hmh/lBAnIaB3Z35qPtGcVZuptYOd1T4apb4nEFbFEaFeLmrkL7mRPjZVGfPz1hHX6FNYEHG9r/kqpEQMctFrRbwHr/dKtEH6hIcco5+QNKguREn/jU99DmsZcJ7x6QsK7ds9JWu+Uwe5nU+ASVjSH6FYIaqwB5fNrG/6REQeGUc6MGbAtBikfDyKoh8dACcHWc2Ujgje6Fp0Z74V+vb2LU+dfMwHhqv3JRD5ZnHKxEkwXAafFi+VB9MQZELyfoqdc9j4TPOizJ7ubI/8FdRBBEIu9K+9GzkOe+G+LrEJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=R1dDbdgBbuRUF/R6Gp1XO1Prxllo1uu315sK6fAK/mI=; b=HS72dUoXPi9yJrng4sF4CMi1P0pZCbZBmqVMVfqp8svYxapbSPc3A8AUdhUaC9lE43KsJsk8l8IoZS5IbLuWEJ14F2w7FtlUCdI0Dq4/f+EBTRTEFPm0p0/RaBBOSsBClKq0yZfg7Ltd8fPhIXECYo5Z2Sl9YnvYvGF6KSyOVe6IHuT1mQFizLLVt5L9JRrfprIHW+s6OlpNLVZEbt5Pu6R/kr8+3jaPjRSIdJL9ruYitjBmfB0UxZEhN3iQufDXNNuJTdGDSyEu9EerU/saJN5ADX5lRjmmVbFBkzn4OVq3nrEJ1HOGgEqsQTLMCoSum0PcAKmHoTsJOfp8/16prA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=gmail.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R1dDbdgBbuRUF/R6Gp1XO1Prxllo1uu315sK6fAK/mI=; b=PsYcGbX6DpUduDnRiSchug9+NJkbOcrf+boYDMft7G3pfvTCsGZzmFOCcwFYjPJ3F92nNLrCGQvDyL4MB8GGmMKdpO68tjKM4+L9hWFIWKIgn/k8ylE1FnEIpk0XUSO5UlLwCo6E0d/gFFF7dUFwpByzgWXcvDjDo0ugPvsxPDWoQCI1Kz2PPYinYAc9qoFq27zOuE0Ibg9czs8jls6tbI0T5+cDqt47jF4iroWeMKktnF5vG47WtXy5wsnmMlx56JbV0VumxaVH6BlYxAHhL4fa2ICUxits0Yi8H8/xI3/brMMYJkdO+28oVCW9BYAIbF6WRWPmqnAe3kUwB0patw== Received: from MW4PR03CA0221.namprd03.prod.outlook.com (2603:10b6:303:b9::16) by DM4PR12MB6010.namprd12.prod.outlook.com (2603:10b6:8:6a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.16; Mon, 28 Mar 2022 06:15:44 +0000 Received: from CO1NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b9:cafe::42) by MW4PR03CA0221.outlook.office365.com (2603:10b6:303:b9::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.26 via Frontend Transport; Mon, 28 Mar 2022 06:15:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.238) by CO1NAM11FT024.mail.protection.outlook.com (10.13.174.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5102.17 via Frontend Transport; Mon, 28 Mar 2022 06:15:44 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Mon, 28 Mar 2022 06:15:43 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Sun, 27 Mar 2022 23:15:42 -0700 Received: from audio.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.22 via Frontend Transport; Sun, 27 Mar 2022 23:15:38 -0700 From: Sameer Pujar To: , , , , , , , Subject: [RFC PATCH v2 2/6] ASoC: dt-bindings: Add audio-graph-port bindings to rt5659 Date: Mon, 28 Mar 2022 11:44:06 +0530 Message-ID: <1648448050-15237-3-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1648448050-15237-1-git-send-email-spujar@nvidia.com> References: <1648448050-15237-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 57391aba-7eae-40cf-0626-08da10826464 X-MS-TrafficTypeDiagnostic: DM4PR12MB6010:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Rk1G3ev2NNLfINnovFkEmIKeHJVYT3NGnalFdhWGUHlYVyA7py1xieLobZWnObQ6XdUZ7liaJ21f1BtcLOC1vMcQx8vBMp3r4gsN4XRYe9jtHCErumTqkqhiqAJ/ZChgY01QZjCmjdCGkM+2qAS6YOFCPTA/9Y4X9IIgNWEpce0fzEDsuao1dN8GQD4JKmf9eXjbbEuuzw9kkC6JTyux0eFioOxEkeJo7IltLGD88tOF/ldth/g27jnhHiUsxPQWQH8chdV3R57DFcL2VJxVxtrOCThBEKTwiwvhHROiuZ3Lski2U69FxywoHwfBZz0WrAqRgSHktvQbLSOvLETGLu319oSRsrYgg/M6a6GcrXHEwpDsfBfAlbeRy7onpvGg75okEha9uPUBmYMKP7QTPoKZVmIBlfrDywUd5k3OpItCuFQNAHaEkeAxa6VNeMyjQCzKUQyvYtMdcfBbsi90uToYLxeLZTbTlt11dHnK2ek7dlKkVEk6Sg9eCvRajD2wYGzgNrcH7orX5aJJxShsfpdVSE8UUUNgEsp+cQpuWKz9+26PYaMbR0rfy/eiwn4P2hP8pBJuKb5SM9UXjTMJA1uS6Bar44vgzBzrLJIS+Sfkx115qdToEmy2EuWIZB9euNE0gxdnueAXjnLbuIhJEoLpfhRggXvghoyZOXNuXdAl8OiBK6fPAxgs8O1jm7No28qEKiGtm8Nw8bQI2pmKAg== X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(82310400004)(7416002)(110136005)(8936002)(54906003)(4744005)(2906002)(86362001)(4326008)(8676002)(5660300002)(70586007)(316002)(356005)(81166007)(47076005)(70206006)(186003)(26005)(426003)(2616005)(336012)(107886003)(7696005)(40460700003)(36860700001)(36756003)(508600001)(6666004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2022 06:15:44.1322 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 57391aba-7eae-40cf-0626-08da10826464 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6010 Cc: oder_chiou@realtek.com, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Sameer Pujar , linux-kernel@vger.kernel.org, jonathanh@nvidia.com, thierry.reding@gmail.com, linux-tegra@vger.kernel.org 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" To use rt5658 or rt5659 audio CODEC with generic audio-graph-card machine driver, the CODEC requires "port" bindings. Thus add "audio-graph-port" reference to the rt5659 binding. Signed-off-by: Sameer Pujar Cc: Oder Chiou --- Documentation/devicetree/bindings/sound/realtek,rt5659.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/realtek,rt5659.yaml b/Documentation/devicetree/bindings/sound/realtek,rt5659.yaml index 3bd9b6f..b0485b8 100644 --- a/Documentation/devicetree/bindings/sound/realtek,rt5659.yaml +++ b/Documentation/devicetree/bindings/sound/realtek,rt5659.yaml @@ -84,6 +84,10 @@ properties: sound-name-prefix: true + port: + $ref: audio-graph-port.yaml# + unevaluatedProperties: false + additionalProperties: false required: From patchwork Mon Mar 28 06:14:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 555005 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9C541C433F5 for ; Mon, 28 Mar 2022 06:17:46 +0000 (UTC) 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 B40C316EE; Mon, 28 Mar 2022 08:16:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B40C316EE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1648448264; bh=DjWN7oZAG82tChhcoSIgrNp4DIrgqwe+6rKSSd9vT8Y=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=HSfVA1AA92tP7hrrOdJwwFg5kxf4x4BFPYqUpUV1XYzYewo6Od2Sv+qzG9Pio72bo hq8doEn4gv/TUoC1FBoTzr2DhTpsfyQe5+vad7iDsF6771mAPrydSd06pGysKH2r3I 8Au4qsK2ynIwDCnZWFe/greOgXa0hoQaUtDEGrcQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B6325F8050F; Mon, 28 Mar 2022 08:16:02 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A9E22F8050F; Mon, 28 Mar 2022 08:16:00 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on20615.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e88::615]) (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 741FAF8050F for ; Mon, 28 Mar 2022 08:15:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 741FAF8050F Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="rz7hwoeM" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SuyfTbFAsZZq5pWS2XJXsDAHhNn2Jt7Qyq9C27WQhCcK2F8oy1BMek8u3uQBEhythNV8PleNeK/IycGx5QhYtd94boKvCG8rQMeOlMI7lxpyoSctrY3efdntEtqOi1MxkLFZc5lO+JP5CSTERY2jgGkOxJ9iOp2hhxXYzKG/HPgnAbNP1Nf11bmLWLMVeB5/vpkRA6abcwV5mU8LgFaQernaNsWxCKpG8X/o1DErztLxY8u7d0qeGF7a26ZsEikBFzHXLLpX+X2xL77WtI7XAIcM2O8X+vY5UQ6rJ+2u2qbzgkfAyeG+bN75eoaWLbnN7pwDieqDTI/FENnOxGmJNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VFugAI6B8RrsIWb50yazBzK0Q5kazWT6V8B7QX7uLgw=; b=fEZ+ytOa/IJK1xgjVp9Mc5zzmsDtAyqK3raeruqNpKnJKkpmeWkDqbMO603irKIkwbWWj4Xek5iDcyJG0Ewkiyczjw4oEJXvyEmru1/j2srak+ulfr4Hpc+7mx2r3mUB/M9z6sm928klFs0TBwvEboVtB+CkkrfnRia8vjoafZUbXq4YbPWKW6Smxhnb0W3YtZ0shtV3RcWPS3rAX6b7kQCBATI0bBCr8UXXeWuDWxqqSjKp4fm6li5RU+4mh/v3StoQRzdhMrGnyhtyVyx3EZdyfnDWLgga457FOkvUbF17ajmv/0eUBj9Zu5V58qqauYnZUjvKDrqXgIL+B05QxQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=gmail.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VFugAI6B8RrsIWb50yazBzK0Q5kazWT6V8B7QX7uLgw=; b=rz7hwoeMJV87y80asiF0j63e60SFfb+u4rZqEC0m0WW71mfg5CwEMoaQxBBvsxYEvtl/xxvSonvo8g6n2dwll8l3EofsHH77riBVs/7f4xRwHff1Iz9nuzd3BGmuC1QhCTz33aswzms2ApK+8FoUEZgblyiHO1ewSmtXFLrqodtg/BZ9qTzJPW38oB0K4SbNyHGC8L/gAvggPheAEqjofae6kuFgoKIbuwpQKxr8LSeqeTyWufjUCyjDcDCy2EKcolFMhcski8UoSQzjkTMu15wiLr6ACmwQnj4SnyU7OvETvJFP3smCYeuZg2XI1mj+hYAeYmJtKrt9mBS552uKoQ== Received: from MW4PR04CA0238.namprd04.prod.outlook.com (2603:10b6:303:87::33) by BY5PR12MB3697.namprd12.prod.outlook.com (2603:10b6:a03:1a2::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.17; Mon, 28 Mar 2022 06:15:48 +0000 Received: from CO1NAM11FT058.eop-nam11.prod.protection.outlook.com (2603:10b6:303:87:cafe::2c) by MW4PR04CA0238.outlook.office365.com (2603:10b6:303:87::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.17 via Frontend Transport; Mon, 28 Mar 2022 06:15:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.238) by CO1NAM11FT058.mail.protection.outlook.com (10.13.174.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5102.17 via Frontend Transport; Mon, 28 Mar 2022 06:15:48 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Mon, 28 Mar 2022 06:15:48 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Sun, 27 Mar 2022 23:15:47 -0700 Received: from audio.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.22 via Frontend Transport; Sun, 27 Mar 2022 23:15:43 -0700 From: Sameer Pujar To: , , , , , , , Subject: [RFC PATCH v2 3/6] ASoC: dt-bindings: Extend clock bindings of rt5659 Date: Mon, 28 Mar 2022 11:44:07 +0530 Message-ID: <1648448050-15237-4-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1648448050-15237-1-git-send-email-spujar@nvidia.com> References: <1648448050-15237-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ff197eb2-2888-41e8-7849-08da108266f5 X-MS-TrafficTypeDiagnostic: BY5PR12MB3697:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VQJz9iiE5r6RsKkiH0F3a701+UWuLxYWs98fM6EuhuVap5VYMIdq1QwfB+V3wXAftiTZKVVbbYYI8z7hGUWlHxZQrQ3avRk46HsqH4W32iGW9ckd2XVOiLQ3iGvNsE/nqMYO+sflbYMfmlVqXbLuf/xWGdysQJ+jrAWz9F2v9wmfv7IqZQVTMi3EkhgSWIydRlPZggfY3q9SaZh5scLNrs+mUJLv9Og08o41ry3XURPMHYd4otBjkiMs/ntDUDIIFoW0k+ZUCJu7B4so+OkYznon0658af0S1pQNf7YSUno6M+jCQJZjta8FHG+/s9kwyLCQ6jBoJMU3aBm7ZZRMIoYmg4kqS3JEnXWs87K+fjZ0R0WBaxooMypefm7vI3n1uNZwioHo0LiOxgEBfT1r3+SfGGEUWIydANr0BoZr6HtLL9H/3rHKztsoB2UCFHOhwjb65ggEjKL1jAW7ARdwkDeC3ee0uQuIgFHbdSFIv2rTMTOtTahVs8DJgZX8niTWvMuDCwjT3tf9Zd3ICS43Q/o8UgQa7QFnjwCiDAsEIJ6ebybnd2r+wn4GuissM+wvYPfY4NgL/cbrhnRGb3N39dz90mX69ARanKTCYI8Qw17Y/gG0Xz9qKeBQQFmlEtUOAHqIIsRzz3JJCMrPcCqxcmhT3p1XvWEIuq0uDe96H25QtOLMJNzRDpSrYYiJleQLnFd2G6sZbiDbg5nWjpGHCg== X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(7696005)(508600001)(6666004)(426003)(107886003)(336012)(26005)(186003)(47076005)(82310400004)(36756003)(36860700001)(83380400001)(316002)(40460700003)(4326008)(70206006)(8676002)(70586007)(54906003)(110136005)(356005)(81166007)(2616005)(5660300002)(2906002)(7416002)(8936002)(86362001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2022 06:15:48.4252 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ff197eb2-2888-41e8-7849-08da108266f5 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT058.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB3697 Cc: oder_chiou@realtek.com, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Sameer Pujar , linux-kernel@vger.kernel.org, jonathanh@nvidia.com, thierry.reding@gmail.com, linux-tegra@vger.kernel.org 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" The rt5658 or rt5659 CODEC system clock (SYSCLK) can be derived from various clock sources. For example it can be derived either from master clock (MCLK) or by internal PLL. The internal PLL again can take input clock references from bit clocks (BCLKs) and MCLK. To enable a flexible clocking configuration the DT binding is extended here. It makes use of standard clock bindings and sets up the clock relation via DT. Signed-off-by: Sameer Pujar Cc: Oder Chiou --- .../devicetree/bindings/sound/realtek,rt5659.yaml | 53 ++++++++++++++++++++-- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/realtek,rt5659.yaml b/Documentation/devicetree/bindings/sound/realtek,rt5659.yaml index b0485b8..0c2f3cb 100644 --- a/Documentation/devicetree/bindings/sound/realtek,rt5659.yaml +++ b/Documentation/devicetree/bindings/sound/realtek,rt5659.yaml @@ -29,12 +29,28 @@ properties: maxItems: 1 clocks: - items: - - description: Master clock (MCLK) to the CODEC + description: | + CODEC can receive multiple clock inputs like Master + clock (MCLK), I2S bit clocks (BCLK1, BCLK2, BCLK3, + BCLK4). The CODEC SYSCLK can be generated from MCLK + or internal PLL. In turn PLL can reference from MCLK + and BCLKs. clock-names: - items: - - const: mclk + description: | + The clock names can be combination of following: + "mclk" : Master clock + "pll_ref" : Reference to CODEC PLL clock + "sysclk" : CODEC SYSCLK + "^bclk[1-4]$" : Bit clocks to CODEC + + "#clock-cells": + const: 1 + + clock-output-names: + description: PLL output clock + $ref: /schemas/types.yaml#/definitions/string + const: rt5659_pll_out realtek,in1-differential: description: MIC1 input is differntial and not single-ended. @@ -97,6 +113,7 @@ required: examples: - | + /* SYSCLK derived from MCLK */ #include #include @@ -114,3 +131,31 @@ examples: realtek,jd-src = <2>; }; }; + + - | + /* + * SYSCLK is derived from CODEC internal PLL and PLL uses I2S1 BCLK + * as the clock reference. + */ + #include + #include + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + rt5658: audio-codec@1a { + compatible = "realtek,rt5658"; + reg = <0x1a>; + interrupt-parent = <&gpio>; + interrupts = ; + clocks = <&bpmp TEGRA194_CLK_AUD_MCLK>, + <&bpmp TEGRA194_CLK_I2S1>, + <&bpmp TEGRA194_CLK_I2S1>, + <&rt5658 0>; + clock-names = "mclk", "bclk1", "pll_ref", "sysclk"; + #clock-cells = <1>; + clock-output-names = "rt5659_pll_out"; + realtek,jd-src = <2>; + }; + }; From patchwork Mon Mar 28 06:14:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 554843 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 777F0C433F5 for ; Mon, 28 Mar 2022 06:18:01 +0000 (UTC) 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 981A516F6; Mon, 28 Mar 2022 08:17:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 981A516F6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1648448279; bh=x4PoYRo0g8dRq1shTohOgKYslV4l4Ya6CWl9VnZzWlo=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=hxlqX8NwRH47cF5rDAIADXlM9dG9peqq/JEG8Z9BMipL/OPSGUzwnm3MAfpGBg8Qq 9fXb0VImIe2U91ge/BR9JPtNcRR6lwhnAv+BAZxqrD4EIptvk1BihRwQMt07Jr69WB DW7SdeRYW0m5mF3ksjO15zvYwUfaphejadV4BVYw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 55A32F80526; Mon, 28 Mar 2022 08:16:05 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 509D8F80526; Mon, 28 Mar 2022 08:16:03 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20612.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5b::612]) (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 9FBD4F8051D for ; Mon, 28 Mar 2022 08:15:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9FBD4F8051D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="qBPcNtK+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bD5JoBUr3S4JW1SN1aajh9yS8z8S+VWoL7PdXpOcZFJ+inNLw72cSI+10Exkc7m0aJMDXEwWyKvONWBaLmL/JR3JVf67SlSi66lGmbdnA42eYGroltUN20VIgd6POriJklW5rd+w2KdMf/4GV6v6puRNUddcZhoP6Ue9N7tI9tx02DlKcbvbd9UrZRZCjvHkYO9bwx8qkt9Eln3S5XWxyCOadHYQ+HFUuDycXUB4F/icPnYnVUOkm2t+d3rQJNX4MGB7gdF5NXpRaAJJn9ZqKhq63YU2yOb2sVAeQDw4Ztx/1TQiO60iJQSOOigEIiLNuJSBB0KI2zg/r0i74CjEGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wkBYi7Bi/sHUSLsgRcl8X+ehZsFuG5iUJZzaW5Cb0po=; b=OMBf4LeKGV5Lal0mXvx0nl4ppWvQZwaJqi6VRRoBz4dp6dZjQMdEKW+L2r42cOKB6XoeeYg1Mfns/i1Mzu4sIewT4fo+xELvsLdfwmX1El31ZyyeZ3ESMOpyTSeYmb7VAE21ni5/aQDUHLLcntjolcTTxmEjei8OFLTYoTVdl04aSvrpAyspz3KMdHEVFaaSpP9/y1EGy1pVHL1Xasz34hM1gY+aTvHWb8sf/4rOZg27sajRJaZgbUygz9xBlS15zE+90qvD0+J+ktLI6DCAgVSzUSiPF/OnyDteZeVHsX/l2nKy6Y7aNdwR+aGyn3aDB6ovZb3McoKd7i/yBzeJ2g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) smtp.rcpttodomain=gmail.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wkBYi7Bi/sHUSLsgRcl8X+ehZsFuG5iUJZzaW5Cb0po=; b=qBPcNtK+gnIqkqtbGtR+9IToJxlmgn1u0QmQGJDZn2jgaCDOsu7/fSPiJp/7/laHQNyEFgj9dZbawzMBdOf4HXG883YzlXQovFdYZf4wDQpsK+ElDnTRNM9wcYyvKJesuoNIQJ5k+9RDLYMD8/pfCr9cqAZe1MEK460q6pzHTo2Lrz2XxLAdkIXXQlRRmlSDAgpeGFxDDewrRkFdzSuQn8ED51LaBor5xkcQ2AhqkeoMbGF5G1kKYQftMpYjAHg4WTUGITG2OKDQ8Ck0CG6vb02r1cdPr2lVcRbZy8tN+9gFp3NSlJfMW1e89YSJ5c1FPxdWCFuCAo8X0ZWTC77yAw== Received: from BN6PR12CA0029.namprd12.prod.outlook.com (2603:10b6:405:70::15) by MW2PR12MB2379.namprd12.prod.outlook.com (2603:10b6:907:9::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.17; Mon, 28 Mar 2022 06:15:55 +0000 Received: from BN8NAM11FT033.eop-nam11.prod.protection.outlook.com (2603:10b6:405:70:cafe::2c) by BN6PR12CA0029.outlook.office365.com (2603:10b6:405:70::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.17 via Frontend Transport; Mon, 28 Mar 2022 06:15:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.234) by BN8NAM11FT033.mail.protection.outlook.com (10.13.177.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5102.17 via Frontend Transport; Mon, 28 Mar 2022 06:15:54 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Mon, 28 Mar 2022 06:15:52 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Sun, 27 Mar 2022 23:15:52 -0700 Received: from audio.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.22 via Frontend Transport; Sun, 27 Mar 2022 23:15:47 -0700 From: Sameer Pujar To: , , , , , , , Subject: [RFC PATCH v2 4/6] ASoC: soc-pcm: tweak DPCM BE hw_param() call order Date: Mon, 28 Mar 2022 11:44:08 +0530 Message-ID: <1648448050-15237-5-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1648448050-15237-1-git-send-email-spujar@nvidia.com> References: <1648448050-15237-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 25187317-a0ec-4c08-8cd0-08da10826abc X-MS-TrafficTypeDiagnostic: MW2PR12MB2379:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dNa/xL/uNU/juMw9tV6U1iD2cHJWbCPX/StepQkzsL1t/3gyUh/Bul/lLV2qIqXX6n4yj0USe6pNdvWlvXCL1utziHkegnCvwq87Mkfbn9EFcj76PQqGtg1lx1EqwNixCvQ2ECKAzirCjWYM2WjjFvjZ7C+RGVjY6/TUD5ufR2NDZUXlAv1rnZ0s6+kZmVYbwbxMWyVe10352QJc6h6fZzcjzLzcgFBqhWFMFXCdOaCnarfq52iexPI6lWqvn6IgF2FOnVH6kXaH32+iVmDJnOY9aiXGcY0uV0VqwDClWmoNrEctNUpa4wZr+iiZPbUYgT35TV2pnXSapPEo8U7TuTgfEM8YT7ZqVbGBEctDVsMcW/Apau8loVLdFWoCvO7rQZ+nCU4OWHssT6albTOh4EbxsA/lo4pZGkerIL6cu/1rMB8SFGNQkk4vqDTK6pZXLiNL7OG7Xtzed+vPBJXqKUrpp9Ic4DVE24IRnaZXTm5/S+izGonJ/ziLsLumTosuFwuCOBFD+aC1NFfTdGV4mxrQqjC1YS5E4IN/rddYP5S1jUo7w0w66R7k6sm87c+wmtiR8vFB2eLPN9RYO84vWQYR1Whjq0ijF1XvedlxrZP010tKMJGv3uA1wG5DNtqlLXPQn6MKSF4KtDP2s+6m0uGZQCdk9g0jlDaCd1zrSXlEt/RLUfjWUf04CQXeXP+8aDwu8ESCqA3aQnyZu50H/A== X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(46966006)(40470700004)(36840700001)(83380400001)(81166007)(508600001)(356005)(2616005)(70206006)(186003)(26005)(40460700003)(86362001)(7696005)(54906003)(36756003)(8936002)(110136005)(82310400004)(7416002)(2906002)(316002)(36860700001)(6666004)(70586007)(4326008)(47076005)(107886003)(336012)(426003)(8676002)(5660300002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2022 06:15:54.7162 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 25187317-a0ec-4c08-8cd0-08da10826abc X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT033.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR12MB2379 Cc: oder_chiou@realtek.com, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Sameer Pujar , linux-kernel@vger.kernel.org, jonathanh@nvidia.com, thierry.reding@gmail.com, linux-tegra@vger.kernel.org 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" For DPCM links, the order of hw_param() call depends on the sequence of BE connection to FE. It is possible that one BE link can provide clock to another BE link. In such cases consumer BE DAI, to get the rate set by provider BE DAI, can use the standard clock functions only if provider has already set the appropriate rate during its hw_param() stage. Presently the order is fixed and does not depend on the provider and consumer relationships. So the clock rates need to be known ahead of hw_param() stage. This patch tweaks the hw_param() order by connecting the provider BEs late to a FE. With this hw_param() calls for provider BEs happen first and then followed by consumer BEs. The consumers can use the standard clk_get_rate() function to get the rate of the clock they depend on. Signed-off-by: Sameer Pujar --- TODO: * The FE link is not considered in this. For Tegra it is fine to call hw_params() for FE at the end. But systems, which want to apply this tweak for FE as well, have to extend this tweak to FE. * Also only DPCM is considered here. If normal links require such tweak, it needs to be extended. sound/soc/soc-pcm.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 9a95468..5829514 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1442,6 +1442,29 @@ static int dpcm_prune_paths(struct snd_soc_pcm_runtime *fe, int stream, return prune; } +static bool defer_dpcm_be_connect(struct snd_soc_pcm_runtime *rtd) +{ + struct snd_soc_dai *dai; + int i; + + if (!(rtd->dai_link->dai_fmt & SND_SOC_DAIFMT_FORMAT_MASK)) + return false; + + if ((rtd->dai_link->dai_fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) == + SND_SOC_DAIFMT_CBC_CFC) { + + for_each_rtd_cpu_dais(rtd, i, dai) { + + if (!snd_soc_dai_is_dummy(dai)) + return true; + } + } + + return false; +} + +#define MAX_CLK_PROVIDER_BE 10 + static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, struct snd_soc_dapm_widget_list **list_) { @@ -1449,7 +1472,8 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, struct snd_soc_dapm_widget_list *list = *list_; struct snd_soc_pcm_runtime *be; struct snd_soc_dapm_widget *widget; - int i, new = 0, err; + struct snd_soc_pcm_runtime *prov[MAX_CLK_PROVIDER_BE]; + int i, new = 0, err, count = 0; /* Create any new FE <--> BE connections */ for_each_dapm_widgets(list, i, widget) { @@ -1489,6 +1513,40 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, (be->dpcm[stream].state != SND_SOC_DPCM_STATE_CLOSE)) continue; + /* Connect clock provider BEs at the end */ + if (defer_dpcm_be_connect(be)) { + if (count >= MAX_CLK_PROVIDER_BE) { + dev_err(fe->dev, "ASoC: too many clock provider BEs\n"); + return -EINVAL; + } + + prov[count++] = be; + continue; + } + + /* newly connected FE and BE */ + err = dpcm_be_connect(fe, be, stream); + if (err < 0) { + dev_err(fe->dev, "ASoC: can't connect %s\n", + widget->name); + break; + } else if (err == 0) /* already connected */ + continue; + + /* new */ + dpcm_set_be_update_state(be, stream, SND_SOC_DPCM_UPDATE_BE); + new++; + } + + /* + * Now connect clock provider BEs. A late connection means, + * these BE links appear first in the list maintained by FE + * and hw_param() call for these happen first. + */ + for (i = 0; i < count; i++) { + + be = prov[i]; + /* newly connected FE and BE */ err = dpcm_be_connect(fe, be, stream); if (err < 0) { From patchwork Mon Mar 28 06:14:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 555004 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 725BDC433EF for ; Mon, 28 Mar 2022 06:18:19 +0000 (UTC) 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 882AD16FC; Mon, 28 Mar 2022 08:17:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 882AD16FC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1648448297; bh=ZzMrX3r01Sqz1kNWMrjksNlh1TnSLTMsUcdfljSPau4=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Gb8ukm3dyLViWvg1rpGr6QGxcrLLpaSwFh4Cplo681+tj+i6a86ad6/QSXSxNamVb 7xk2L3f4H9nalfIt1vgkXD8oZ0qgy6ibrHQa37ZHNnJYTZTMuCVRLqzv/TYQE5RCK+ 752kobjv+qFy/nZibyDRPuDuieY5SwgBcU3RpLGo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4A08CF8051F; Mon, 28 Mar 2022 08:16:11 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 93517F8052D; Mon, 28 Mar 2022 08:16:09 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2061d.outbound.protection.outlook.com [IPv6:2a01:111:f400:7ea9::61d]) (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 6445CF8051F for ; Mon, 28 Mar 2022 08:16:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6445CF8051F Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="a7lapxIP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=URo3GWZ4ag1Ew50i/qSqlNeTmfE+ARjySCLeq5kExlNhYmu2/ndWOB60ZOMLIymqaYWniIN6j6l+YaBwxgZkPDOeGgUkGiEX7rsNnyhfy3FcsxuEnauqb4h5nhlZ8AcbWli4Ap0YW34OJd2PkGvbCJOsSs5rLHGpIFXWLvT2JclDBqZPtL05MCfarDRiv7LYmQaCqRIf30aYxLtw6jLLXyjaftugiot0dj6CPjkSn50amVvvy96Dpg/DNwJ86nkfFR/vPHr+d8AYOUDX2w65Z3pLWY5Jjjv9t10iLdxjoRPGkUTGY+p1vlxsgFDfosml9b99SPmNcE99kTSeKy5wQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UgYC8rsiIXE/L6Yotxa5CwM59DCs8RBz0unGLxb+rGk=; b=SUGSaY/NRnOJXglhbF5/UN1VOrY0hA5EeBGI7HUyuaAce5UB45xhQpja3Jbxe8Ig7VQll/LixJrN6dUdMSmhNGy6FqpalsHXeMjmvB2p242TOgrdxXh3sP6F8+ll3n0j8iqdqAkVLAbFMHi1hJwYAhJXEI9aVSZMiDgdZe8Nb5aRQspL8GcpLp7b/+TtJRRWaG/XKAnYIdk6DqNP2MHuk1Wk7dDvoNQ5gdH1EFkvW7gn11CdBfhBiZFQ/w5h7Unnsb3GVafum1A6bpQuRsB3j837oeaCJFuNHJFXt9DstvgWqHdaml1moSbFiVI4RWZhcu0wge48nXK3LI1tEm9ubw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=gmail.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UgYC8rsiIXE/L6Yotxa5CwM59DCs8RBz0unGLxb+rGk=; b=a7lapxIPW3ffu9cCQKBwHBWa8hMvwar2CNkvv3mnrsS6Fv3bhgSOGmMFJdJhmWF49zC6Nf0W0sS8RRjue8TV2aMEVEfP5HeC46rt9fQaZiEDBvU/e4NjHK/y3spWeHTsJzzqRIxsBHeJ0+W6RzDtDDkkct5orS6sccyf1qM7FEGPX0vLq41UFwwnEkHGbVrtMtT/D0iHsyBQNgx/cSkvMU5vjDxYtPNL0x0lna42X0Z9ykZ3dhnihZFr5/9eHbkO08OPUea5j1hTJNq44G/8whIcZPrSnT3kqa9FNjMPEVWgfO8A5P4ZwcDX28p5iEns5imeuZkZD0Mv6iO0Qi8jJg== Received: from MW4PR03CA0062.namprd03.prod.outlook.com (2603:10b6:303:b6::7) by CH2PR12MB4181.namprd12.prod.outlook.com (2603:10b6:610:a8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.16; Mon, 28 Mar 2022 06:15:58 +0000 Received: from CO1NAM11FT040.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b6:cafe::28) by MW4PR03CA0062.outlook.office365.com (2603:10b6:303:b6::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.17 via Frontend Transport; Mon, 28 Mar 2022 06:15:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.238) by CO1NAM11FT040.mail.protection.outlook.com (10.13.174.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5102.17 via Frontend Transport; Mon, 28 Mar 2022 06:15:58 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Mon, 28 Mar 2022 06:15:57 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Sun, 27 Mar 2022 23:15:56 -0700 Received: from audio.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.22 via Frontend Transport; Sun, 27 Mar 2022 23:15:52 -0700 From: Sameer Pujar To: , , , , , , , Subject: [RFC PATCH v2 5/6] ASoC: rt5659: Expose internal clock relationships Date: Mon, 28 Mar 2022 11:44:09 +0530 Message-ID: <1648448050-15237-6-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1648448050-15237-1-git-send-email-spujar@nvidia.com> References: <1648448050-15237-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 130dcd6b-df31-4a8c-d22c-08da10826cad X-MS-TrafficTypeDiagnostic: CH2PR12MB4181:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Kj9OpxRxFDdxYinOaRLSfZJjC06yaQcdJN05B0Zw8ZRS+8A7SSkawFBYjYU2+BmJ7DtBxOtF3/ZSVTK1xbHFZjiD6iDRGQej88b/UHyQjYwi3d+/+VY3N1RvUS/az6dwEP7aRbMxZ0ih/H+Ly9avRqG7qI6HYk4xtC7n0bDagSV16dHQcvqVwoH3yy4cMjiatJheWKldW7QzqMWtN9dZ0tgRtWgFY7pEiF5/vI5Ru0sqxsUBx+qs0ZUZQSNt/GoiZeFcFDRXBA+sgaSHCmXHgVCiRwRD2vZaCeb3aCzPJehVdN8b3OzeHm+cvbZflGtztl06THcKDzSzbV8JDWUMZyflyC3huGHDrw2xVYHPmhOcz7EKMKZoextOUjjY57poj2C/pmSdMIK5BvEaQNPxfvxyGtTJb+IgSXogclMuQr0S1z+23B4lzvvn1hDdm2ijiOuNYgb+m29OR4fXiVtUbkKT+TQKMFDN3V0lFBqPKNfTcUeKcbbFB2sLffzKMW5TEwFMyBbGUfG6sqP62RcjYSHF5ePZGppnAmrzxKIHKVCvbPm0VVh0R/YLN5RvxAxWSawrNj6QmriPzivUolR/9g3LEDQ2Oi6/x+fz/4SsBK2mebUCjvJODbShgFw+9QlXXnuJ5nfDcRyST3VbeOgzEqsa+i8VECoxcPZDZWKG2qyMJuIT0zX8yBp5ABXxTqoklyvihD8hLwfpGp2W0LQzbUMfG9MtQax26tmraIA9AMsUmDjJHb60smE04ihHoabYQl2qA9hftIDDIN72ScM6c1LRQX6HLkgumuF1Sfdmbys= X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(508600001)(186003)(40460700003)(26005)(426003)(336012)(86362001)(2616005)(47076005)(2906002)(30864003)(7416002)(8936002)(54906003)(110136005)(107886003)(356005)(81166007)(8676002)(966005)(70206006)(36860700001)(70586007)(316002)(4326008)(7696005)(36756003)(5660300002)(6666004)(82310400004)(83380400001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2022 06:15:58.0064 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 130dcd6b-df31-4a8c-d22c-08da10826cad X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT040.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4181 Cc: oder_chiou@realtek.com, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Sameer Pujar , linux-kernel@vger.kernel.org, jonathanh@nvidia.com, thierry.reding@gmail.com, linux-tegra@vger.kernel.org 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" The RT5658 or RT5659 codecs have multiple options to derive Sysclk: * Sysclk sourced from MCLK clock supplied by SoC * Sysclk sourced from codec internal PLL. The PLL again can take reference from I2S BCLKs and MCLK. * Sysclk sourced from RCCLK. The clock relationship for codec is as following: |\ | \ |\ BCLK1 ---->| \ RCCLK | \ | \ |----------->| \ BCLK2 ---->| M \ ____________ | \ | U | | | PLL output | M \ BCLK3 ---->| X |----->| Codec PLL |---------------->| U | | | |____________| | X |----> Sysclk BCLK4 ---->| / |----->| | | / | | / MCLK ---->| / | | / | |/ | | / | MCLK | |/ |_______________________________________| Presently 'snd_soc_component_driver' and 'snd_soc_dai_driver' expose callbacks, set_sysclk() for Sysclk and set_pll() for PLL configurations, which are implemented on codec driver side. The generic machine drivers (simple-card or audio-graph-card) depend on default values for Sysclk source or PLL reference. Specific clock relationships are not supported. The simpler solution would be to expose new DT binding properties to convey the PLL and Sysclk source. This attempt was made before with [0], but was not encouraged because it tries to do the same thing what standard clock bindings already provide This patch uses standard clock bindings to establish the codec clock relationships. Specific configurations can be applied by DT bindings from codec device node. The codec driver registers PLL and MUX clocks to provide this flexibility. [0] https://patchwork.kernel.org/project/alsa-devel/list/?series=438531&archive=both&state=* Signed-off-by: Sameer Pujar Cc: Oder Chiou --- Note: If such model is OK, other codec drivers will require similar handling. Objective is to drive clock relationships from DT using standard clock bindings. With this machine driver need not know the details for configuring codec PLL or other clocks and thus can be more generic. sound/soc/codecs/rt5659.c | 248 ++++++++++++++++++++++++++++++++++++++++++++-- sound/soc/codecs/rt5659.h | 9 ++ 2 files changed, 249 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/rt5659.c b/sound/soc/codecs/rt5659.c index e1503c2..3bf9680 100644 --- a/sound/soc/codecs/rt5659.c +++ b/sound/soc/codecs/rt5659.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -18,6 +19,8 @@ #include #include #include +#include +#include #include #include #include @@ -3527,6 +3530,9 @@ static int rt5659_set_component_pll(struct snd_soc_component *component, int pll rt5659->pll_out = freq_out; rt5659->pll_src = source; + dev_dbg(component->dev, "pll_in = %u Hz, pll_out = %u Hz, pll_src = %d\n", + freq_in, freq_out, source); + return 0; } @@ -3843,6 +3849,237 @@ static int rt5659_parse_dt(struct rt5659_priv *rt5659, struct device *dev) return 0; } +static unsigned long rt5659_pll_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) +{ + struct rt5659_priv *rt5659 = + container_of(hw, struct rt5659_priv, clk_pll_out); + + return rt5659->pll_out; +} + +static long rt5659_pll_round_rate(struct clk_hw *hw, unsigned long rate, + unsigned long *parent_rate) +{ + return rate; +} + +static int rt5659_pll_set_rate(struct clk_hw *hw, unsigned long rate, + unsigned long parent_rate) +{ + struct rt5659_priv *rt5659 = + container_of(hw, struct rt5659_priv, clk_pll_out); + + rt5659->pll_out = rate; + + return 0; +} + +static const struct clk_ops rt5659_pll_out_ops = { + .recalc_rate = &rt5659_pll_recalc_rate, + .round_rate = &rt5659_pll_round_rate, + .set_rate = &rt5659_pll_set_rate, +}; + +static int rt5659_setup_clk(struct snd_soc_dai *dai, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_component *component = dai->component; + struct rt5659_priv *rt5659 = snd_soc_component_get_drvdata(component); + int ret, sysclk_src; + + /* + * Update the clock rate if Codec is driving it. The consumers + * can use clk_get_rate() function to get the rate. + */ + if (rt5659->master[dai->id] && rt5659->clk_bclk[dai->id]) { + unsigned int bclk_rate = params_rate(params) * + params_width(params) * + params_channels(params); + + clk_set_rate(rt5659->clk_bclk[dai->id], bclk_rate); + } + + if (rt5659->clk_sysclk_src) { + sysclk_src = clk_hw_get_parent_index(rt5659->clk_sysclk_src); + + ret = rt5659_set_component_sysclk(component, sysclk_src, 0, + rt5659->sysclk, 0); + if (ret) + return ret; + } + + if (rt5659->clk_pll_src && (sysclk_src == RT5659_SCLK_S_PLL1)) { + unsigned int pll_src = + clk_hw_get_parent_index(rt5659->clk_pll_src); + unsigned int freq_in = clk_get_rate(rt5659->clk_pll_src->clk); + + ret = rt5659_set_component_pll(component, 0, pll_src, + freq_in, rt5659->sysclk); + if (ret) + return ret; + } + + return 0; +} + +static int rt5659_register_clks(struct device *dev, struct rt5659_priv *rt5659) +{ + const struct clk_hw *sysclk_clk_hw[RT5659_NUM_SCLK_SRC_CLKS] = { NULL }; + const char *pnames_sysclk[RT5659_NUM_SCLK_SRC_CLKS] = { NULL }; + const char *pnames_pll[RT5659_NUM_PLL1_SRC_CLKS] = { NULL }; + struct clk_init_data init = { }; + static void __iomem *clk_base; + const char *clk_name; + int ret, i, count_pll_src = 0, count_sysclk_src = 0; + + /* Check if MCLK provided */ + rt5659->mclk = devm_clk_get(dev, "mclk"); + if (IS_ERR(rt5659->mclk)) { + if (PTR_ERR(rt5659->mclk) != -ENOENT) + return PTR_ERR(rt5659->mclk); + /* Otherwise mark the mclk pointer to NULL */ + rt5659->mclk = NULL; + } + + if (!of_find_property(dev->of_node, "#clock-cells", NULL)) + return 0; + + /* Get PLL source */ + rt5659->pll_ref = devm_clk_get(dev, "pll_ref"); + if (IS_ERR(rt5659->pll_ref)) { + if (PTR_ERR(rt5659->pll_ref) != -ENOENT) + return PTR_ERR(rt5659->pll_ref); + + rt5659->pll_ref = NULL; + } + + /* Possible parents for PLL */ + if (rt5659->mclk) { + pnames_pll[count_pll_src] = __clk_get_name(rt5659->mclk); + count_pll_src++; + } + + for (i = 0; i < RT5659_AIFS; i++) { + char name[50]; + + memset(name, '\0', sizeof(name)); + snprintf(name, sizeof(name), "%s%d", "bclk", i + 1); + + rt5659->clk_bclk[i] = devm_clk_get(dev, name); + if (IS_ERR(rt5659->clk_bclk[i])) { + if (PTR_ERR(rt5659->clk_bclk[i]) != -ENOENT) + return PTR_ERR(rt5659->clk_bclk[i]); + + rt5659->clk_bclk[i] = NULL; + continue; + } + + pnames_pll[count_pll_src] = __clk_get_name(rt5659->clk_bclk[i]); + count_pll_src++; + } + + clk_base = devm_kzalloc(dev, sizeof(char) * 4, GFP_KERNEL); + + /* Register MUX for PLL source */ + rt5659->clk_pll_src = clk_hw_register_mux(dev, "rt5659_pll_ref", + pnames_pll, count_pll_src, + CLK_SET_RATE_PARENT, + clk_base, 0, 1, 0, NULL); + + ret = of_clk_add_hw_provider(dev->of_node, of_clk_hw_simple_get, + rt5659->clk_pll_src); + if (ret) { + dev_err(dev, "failed to register clk hw\n"); + return ret; + } + + if (rt5659->pll_ref) { + ret = clk_set_parent(rt5659->clk_pll_src->clk, rt5659->pll_ref); + if (ret) { + dev_err(dev, "failaed to set parent for clk %s\n", + __clk_get_name(rt5659->clk_pll_src->clk)); + return ret; + } + } + + /* Register PLL out clock */ + if (of_property_read_string(dev->of_node, "clock-output-names", + (const char **) &clk_name)) + clk_name = "rt5659_pll_out"; + + init.name = clk_name; + init.ops = &rt5659_pll_out_ops; + init.flags = CLK_GET_RATE_NOCACHE | CLK_SET_RATE_GATE; + init.parent_hws = (const struct clk_hw **) &rt5659->clk_pll_src; + init.num_parents = 1; + + rt5659->clk_pll_out.init = &init; + + ret = devm_clk_hw_register(dev, &rt5659->clk_pll_out); + if (ret) { + dev_err(dev, "failed to register PLL clock HW\n"); + return ret; + } + + ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, + &rt5659->clk_pll_out); + if (ret) { + dev_err(dev, "failed to add PLL clock provider\n"); + return ret; + } + + /* Get sysclk source */ + rt5659->sysclk_ref = devm_clk_get(dev, "sysclk"); + if (IS_ERR(rt5659->sysclk_ref)) { + if (PTR_ERR(rt5659->sysclk_ref) != -ENOENT) + return PTR_ERR(rt5659->sysclk_ref); + + rt5659->sysclk_ref = NULL; + } + + /* Possible parents for Sysclk */ + if (rt5659->mclk) { + /* For sysclk */ + pnames_sysclk[count_sysclk_src] = __clk_get_name(rt5659->mclk); + sysclk_clk_hw[count_sysclk_src] = __clk_get_hw(rt5659->mclk); + count_sysclk_src++; + } + + if (rt5659->clk_pll_out.clk) { + pnames_sysclk[count_sysclk_src] = __clk_get_name(rt5659->clk_pll_out.clk); + sysclk_clk_hw[count_sysclk_src] = __clk_get_hw(rt5659->clk_pll_out.clk); + count_sysclk_src++; + } + + /* Register MUX for sysclk source */ + rt5659->clk_sysclk_src = __clk_hw_register_mux(dev, dev->of_node, + "rt5659_sysclk", + count_sysclk_src, + pnames_sysclk, + sysclk_clk_hw, NULL, + CLK_SET_RATE_PARENT, + clk_base, 0, 1, 0, + NULL, NULL); + + ret = of_clk_add_hw_provider(dev->of_node, of_clk_hw_simple_get, + rt5659->clk_sysclk_src); + if (ret) { + dev_err(dev, "failed to register clk hw\n"); + return ret; + } + + if (rt5659->sysclk_ref) { + ret = clk_set_parent(rt5659->clk_sysclk_src->clk, rt5659->sysclk_ref); + if (ret) { + dev_err(dev, "failed to set parent for clk %s\n", + __clk_get_name(rt5659->clk_sysclk_src->clk)); + return ret; + } + } + + return 0; +} + static void rt5659_calibrate(struct rt5659_priv *rt5659) { int value, count; @@ -4142,14 +4379,9 @@ static int rt5659_i2c_probe(struct i2c_client *i2c, regmap_write(rt5659->regmap, RT5659_RESET, 0); - /* Check if MCLK provided */ - rt5659->mclk = devm_clk_get(&i2c->dev, "mclk"); - if (IS_ERR(rt5659->mclk)) { - if (PTR_ERR(rt5659->mclk) != -ENOENT) - return PTR_ERR(rt5659->mclk); - /* Otherwise mark the mclk pointer to NULL */ - rt5659->mclk = NULL; - } + ret = rt5659_register_clks(&i2c->dev, rt5659); + if (ret) + return ret; rt5659_calibrate(rt5659); diff --git a/sound/soc/codecs/rt5659.h b/sound/soc/codecs/rt5659.h index b49fd8b..d46d39f 100644 --- a/sound/soc/codecs/rt5659.h +++ b/sound/soc/codecs/rt5659.h @@ -1763,6 +1763,7 @@ enum { RT5659_SCLK_S_MCLK, RT5659_SCLK_S_PLL1, RT5659_SCLK_S_RCCLK, + RT5659_NUM_SCLK_SRC_CLKS, }; /* PLL1 Source */ @@ -1772,6 +1773,7 @@ enum { RT5659_PLL1_S_BCLK2, RT5659_PLL1_S_BCLK3, RT5659_PLL1_S_BCLK4, + RT5659_NUM_PLL1_SRC_CLKS, }; enum { @@ -1797,6 +1799,13 @@ struct rt5659_priv { struct gpio_desc *gpiod_reset; struct snd_soc_jack *hs_jack; struct delayed_work jack_detect_work; + + struct clk_hw *clk_sysclk_src; + struct clk_hw *clk_pll_src; + struct clk_hw clk_pll_out; + struct clk *clk_bclk[RT5659_AIFS]; + struct clk *sysclk_ref; + struct clk *pll_ref; struct clk *mclk; int sysclk; From patchwork Mon Mar 28 06:14:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 554842 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id BEF65C433F5 for ; Mon, 28 Mar 2022 06:18:42 +0000 (UTC) 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 123551702; Mon, 28 Mar 2022 08:17:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 123551702 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1648448321; bh=YPU6xZrhS/X9SuvmRQyNuu0/i6sYdgY4IlVb+i1iCe4=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=kf6+RvxgyqQPiMQe/LU+pUJhMzErTUjPEWXQa5V6Cve2j1lVUmKoVuZCLhoOVrjtf MsDjK3FK4ikhKcyYq/yCG2yuZPGlBQ48SBOvODq4CwIYT3UCqACwMXjZl80VhAqK5c M5k62lrf5ywdvlQqolIaAuPo7/zVG4ZOQiJ15n4g= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3E4A8F80538; Mon, 28 Mar 2022 08:16:17 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C100EF80539; Mon, 28 Mar 2022 08:16:15 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on20624.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5a::624]) (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 16244F80536 for ; Mon, 28 Mar 2022 08:16:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 16244F80536 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="dV9wJgdr" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kBL+E3FhpgepBlSjfL8Ve1SJ0cEL5Da59dP0vCCIJxEIAhmsVeGDWRObertidcr+wJOkSE1G5uHZFa3dxLQzN5Xi5XlLl/6SS5HsJkcTax5P8QkSogJdAzW2baxDtQxTK9Dba3GFW39oDVnz9HwggIFtIfyQXwGDn1KZIBn/GKbu3v88sEjj7FNsFEPKf4baneNnCPWCCpEMl5xx06hWgcPeuUxDFC8uMZ7u2mUHP8GR84izEE2Me4gf6fztzukk1LpGqURK1xm48XX/kDU9kas6hjQ4ptjDm+M8DkfgDQ3a0C+ZVgAGsyDbplzYkSCJJrfau2vex954R7P1YpvG8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XVbAgiWj7uQBw+VCLMddmZGQpgzkOz+iiy3XW8lKpUY=; b=caM1H1mUhgRzerC2l/HdtDjagnERnzk2AnY0mqbJ6P+kn6dsU38aXLpEOda+oT6xeSrMwBpbsBrLvoGefbgSRgbpEXghkh3C9QcW5D6QQ3Tq6Vlhmfph2ye0tacf1oduPfVZoftPayL7isZcYjqnUrm02xZQd++xXGN6kwANKsFjDHyYSPIe8ZMQZaocGaD4mGK9q8MRCaQ7fNrh1QzQ/3F2wPOgaRwTjly/tGZm2Dtlw3YiQ9lKbpJOMsRuJlTp8EHeTzw/dY7xFJC+BsD6H+7Hj51RahglpYVl68J6eD4sI6/TRO5FkFrwjWptYJpJXrKNg//ELGAAIEFP34w8eQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) smtp.rcpttodomain=gmail.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XVbAgiWj7uQBw+VCLMddmZGQpgzkOz+iiy3XW8lKpUY=; b=dV9wJgdr8tfwdZNL6KIYBE5lWTpFnNoyEPC4aQ0qgufd769v5G5P0r8rjDxBXI6w5P8/z64o/yeNixatNXSaRHZpcOrxSXZCXV837X7K/jh34Yq2XdTPEsLEhJYje0HRRWu7lEwJ6p/ao0HIDVhoyJ7w/jsM9M+ANvnTOPZkYAeeZ1JBHlT7Fpxk7zjC+Qfe7RCsE8s58XJa/GhcS9hLFMh64VDMnzsnJOKfmrFFci7lXOv3YEbSgVfrk+YAaLD+gDqRD/66GQI6Jaz5a7hfAKGKdsYrWoEG6x/yl05kgY7avOjpmTj8jlzwNyvmpqSCNWSiE55bXVHoJu305Wazkw== Received: from BN9P222CA0006.NAMP222.PROD.OUTLOOK.COM (2603:10b6:408:10c::11) by PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.17; Mon, 28 Mar 2022 06:16:03 +0000 Received: from BN8NAM11FT060.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10c:cafe::f4) by BN9P222CA0006.outlook.office365.com (2603:10b6:408:10c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.17 via Frontend Transport; Mon, 28 Mar 2022 06:16:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.234) by BN8NAM11FT060.mail.protection.outlook.com (10.13.177.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5102.17 via Frontend Transport; Mon, 28 Mar 2022 06:16:03 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Mon, 28 Mar 2022 06:16:02 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Sun, 27 Mar 2022 23:16:01 -0700 Received: from audio.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.22 via Frontend Transport; Sun, 27 Mar 2022 23:15:57 -0700 From: Sameer Pujar To: , , , , , , , Subject: [RFC PATCH v2 6/6] ASoC: tegra: Get clock rate in consumer mode Date: Mon, 28 Mar 2022 11:44:10 +0530 Message-ID: <1648448050-15237-7-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1648448050-15237-1-git-send-email-spujar@nvidia.com> References: <1648448050-15237-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a37d4cff-22ec-4b6c-ba8b-08da10826faf X-MS-TrafficTypeDiagnostic: PH7PR12MB5685:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aHdu+izTmoMjRSmgsmwZx8FWJqSeIkSQnp4yMYVx5YI2fNm5SgHf2KYPwL/gD2R6d0hYCjRrddRhVX3MNYyjDpv0Bg33fqCWOBLa6GskRftdKpJYjc2zxrpkecOkT5wfcc3TUUwphZhJd+vh3oMeFNUlA+R15xT39BBj+Rd8nPgaUDQbQnyBwUQsoiWRTVeYnGUrYTKypAvsRQ0SEPQ3pj6OoyV27ZV6NrzUSG4UDJVJZKjME8kPmn+gP5InL3Rz5lywH9JkBzXpBkGoSP4uWaZm81VP2/nRKLQXrxE8AbvsUqKywkWLl9m5eD4qjwGu7WrLjDhF3s4VCwB8UqgeeFvik198uGpl1/7iLfIOE0Vl2yKn5/ZlYNI8NcaDJa/1e/Z7OD7s5XjbWid5qnsqfZgh+fsgw/u4bQbfg3AMcQ6arXTWYFL+0mGtkFhciI8OFycfoyUtuL87Wo338Flia5rXcoOYbyLR+Gb+PWUIl1uMjgkH426Zf0AB5Quv5xzCLifPg+CEdkV8I9IUKjCoUI4JNH+j8yFcSD5ynn5SWeDi2qrvzLOLSAtMadImz79JWfZDlqIc70/RkL8AImSmYityL+ZbGAWsdYRJkmpVvi5EnCLuT5ZVj+j9iq1RXS3oeHQXzi1FRGIVSnbQDbjCX7F9+3YXAqIddn0HVhCW6H37AcdVlnDpigXWPYQK87DuekNbAbC6IFrTm6Bf/PK32w== X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(40470700004)(46966006)(70206006)(7416002)(336012)(26005)(86362001)(40460700003)(316002)(426003)(70586007)(81166007)(356005)(47076005)(6666004)(107886003)(508600001)(8936002)(186003)(82310400004)(7696005)(110136005)(8676002)(2906002)(36860700001)(83380400001)(2616005)(4326008)(5660300002)(54906003)(36756003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2022 06:16:03.0208 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a37d4cff-22ec-4b6c-ba8b-08da10826faf X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT060.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5685 Cc: oder_chiou@realtek.com, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Sameer Pujar , linux-kernel@vger.kernel.org, jonathanh@nvidia.com, thierry.reding@gmail.com, linux-tegra@vger.kernel.org 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" When Tegra I2S is consumer the clock is driven by the external codec. In such cases, ideally the bit clock (BCLK) rate needs to be updated by provider. Consumer can use standard clock function to get the rate. On Tegra HW it is possible to use I2S BCLK clock as reference to the I/O (other I2S or DMIC or DSPK) interfaces. This input clock is called as SYNC input clock and it can act as a parent clock to any of the remaining I/O interfaces. Thus it is important to set the clock rate in Tegra I2S consumer mode as well. With this patch SYNC input clock rate is updated and any I/O interface relying on this can derive required rate. Signed-off-by: Sameer Pujar --- Following are the DT binding cases I tried on Jetson AGX Xavier platform. 1. Sysclk derived from MCLK : This is currently being used. No DT binding change would be necessary. Clock tree dump snippet in this case with proposed series: ... pll_a | |-- plla_out0 | |-- ahub | |-- aud_mclk | | | |-- rt5659_sysclk | |-- i2s1 ... 2. Sysclk is derived from codec internal PLL and this PLL uses I2S bit clock (BCLK) as reference. rt5658: audio-codec@1a { ... clocks = <&bpmp TEGRA194_CLK_AUD_MCLK>, <&bpmp TEGRA194_CLK_I2S1>, <&bpmp TEGRA194_CLK_I2S1>, <&rt5658 0>; clock-names = "mclk", "bclk1", "pll_ref", "sysclk"; #clock-cells = <1>; clock-output-names = "rt5659_pll_out"; ... }; Clock tree dump snippet in this case with proposed series: ... pll_a | |-- plla_out0 | |-- ahub | |-- aud_mclk | |-- i2s1 | |-- rt5659_pll_ref | |-- rt5659_pll_out | |-- rt5659_sysclk ... sound/soc/tegra/tegra210_i2s.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/sound/soc/tegra/tegra210_i2s.c b/sound/soc/tegra/tegra210_i2s.c index 9552bbb..53e5307 100644 --- a/sound/soc/tegra/tegra210_i2s.c +++ b/sound/soc/tegra/tegra210_i2s.c @@ -53,17 +53,24 @@ static int tegra210_i2s_set_clock_rate(struct device *dev, regmap_read(i2s->regmap, TEGRA210_I2S_CTRL, &val); - /* No need to set rates if I2S is being operated in slave */ - if (!(val & I2S_CTRL_MASTER_EN)) - return 0; - - err = clk_set_rate(i2s->clk_i2s, clock_rate); - if (err) { - dev_err(dev, "can't set I2S bit clock rate %u, err: %d\n", - clock_rate, err); - return err; + /* + * If I2S is consumer, then the clock rate is expected to be + * set by the respective provider and thus just read the rate + * in such case. If I2S is provider, then set the clock rate. + */ + if (!(val & I2S_CTRL_MASTER_EN)) { + clock_rate = clk_get_rate(i2s->clk_i2s); + } else { + err = clk_set_rate(i2s->clk_i2s, clock_rate); + if (err) { + dev_err(dev, "can't set I2S bit clock rate %u, err: %d\n", + clock_rate, err); + return err; + } } + dev_dbg(dev, "bit clock (BCLK) rate is %u\n", clock_rate); + if (!IS_ERR(i2s->clk_sync_input)) { /* * Other I/O modules in AHUB can use i2s bclk as reference